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/python
import roslib;
roslib.load_manifest('rfid_people_following')
roslib.load_manifest('std_srvs')
roslib.load_manifest('explore_hrl')
roslib.load_manifest('move_base_msgs')
roslib.load_manifest('actionlib')
roslib.load_manifest('geometry_msgs')
roslib.load_manifest('tf')
roslib.load_manifest('hrl_rfid')
import rospy
import tf
import tf.transformations as tft
import actionlib
from move_base_msgs.msg import MoveBaseAction, MoveBaseGoal
import hrl_rfid.ros_M5e_client as rmc
from rfid_people_following.srv import StringInt32_Int32
from rfid_people_following.srv import String_Int32
from rfid_people_following.srv import Int32_Int32
from rfid_people_following.srv import String_StringArr
from std_srvs.srv import Empty
from geometry_msgs.msg import PointStamped
import actionlib
import explore_hrl.msg
from geometry_msgs.msg import PoseStamped
from geometry_msgs.msg import Quaternion
import numpy as np, math
import time
from threading import Thread
import os
# A more general form of this should be folded back into ros_M5e_client!
# It also appears in new_servo_node (rfid_people_following)
class rfid_poller( Thread ):
def __init__( self, tagid ):
Thread.__init__( self )
self.reader = rmc.ROS_M5e_Client('ears')
self.listener = tf.TransformListener()
self.listener.waitForTransform('/ear_antenna_left', '/map',
rospy.Time(0), timeout = rospy.Duration(100) )
self.listener.waitForTransform('/ear_antenna_right', '/map',
rospy.Time(0), timeout = rospy.Duration(100) )
self.should_run = True
self.should_poll = False
self.data = []
self.tagid = tagid
self.start()
def transform( self, antname ):
ps = PointStamped()
ps2 = PointStamped()
ps2.point.x = 0.1
if antname == 'EleLeftEar':
ps.header.frame_id = '/ear_antenna_left'
ps.header.stamp = rospy.Time( 0 )
ps2.header.frame_id = '/ear_antenna_left'
ps2.header.stamp = rospy.Time( 0 )
elif antname == 'EleRightEar':
ps.header.frame_id = '/ear_antenna_right'
ps.header.stamp = rospy.Time( 0 )
ps2.header.frame_id = '/ear_antenna_right'
ps2.header.stamp = rospy.Time( 0 )
else:
rospy.logout( 'Bad ear' )
return False, 0.0, 0.0, 0.0
try:
ps_map = self.listener.transformPoint( '/map', ps )
x = ps_map.point.x
y = ps_map.point.y
#rospy.logout( 'Done 1' )
ps2_map = self.listener.transformPoint( '/map', ps2 )
x2 = ps2_map.point.x
y2 = ps2_map.point.y
#rospy.logout( 'Done 1' )
#rospy.logout( 'Transform Success ' + ps.header.frame_id )
return True, x, y, np.arctan2( y2 - y, x2 - x )
except:
rospy.logout( 'Transform failed! ' + ps.header.frame_id )
return False, 0.0, 0.0, 0.0
def start_poller( self ):
# Start appending into self.data
#self.reader.track_mode( self.tagid )
self.should_poll = True
def stop_poller( self ):
# Stop appending into self.data
#self.reader.stop()
self.should_poll = False
def run( self ):
rospy.logout( 'rfid_poller: Starting' )
while self.should_run and not rospy.is_shutdown():
if self.should_poll:
left = self.reader.read('EleLeftEar')[-1]
success, x, y, ang = self.transform( 'EleLeftEar' )
if success:
self.data.append( [left, [x,y,ang]] )
right = self.reader.read('EleRightEar')[-1]
success, x, y, ang = self.transform( 'EleRightEar' )
if success:
self.data.append( [right, [x,y,ang]] )
else:
rospy.sleep( 0.050 )
try: # Shut it down to conserve power. Something of a race condition (exception)
self.reader.stop()
except:
pass
rospy.logout( 'rfid_poller: Exiting' )
def stop( self ):
# Kill off the poller thread.
self.should_run = False
self.join(5)
if (self.isAlive()):
raise RuntimeError("rfid_poller: Unable to stop thread")
# A more general form of this should be folded back into orient_node (rfid_people_following)!
class Flapper( Thread ):
def __init__( self, tagid = 'person '):
Thread.__init__( self )
rospy.logout('Flapper: Initializing' )
rospy.wait_for_service( '/rfid_orient/flap' )
rospy.logout('Flapper: flap service ready.' )
self._flap = rospy.ServiceProxy( '/rfid_orient/flap', String_StringArr )
self.flap = lambda : self._flap( tagid )
self.should_run = True
self.should_flap = False
self.start()
def start_flapper( self ):
# Start appending into self.data
#self.reader.track_mode( self.tagid )
self.should_flap = True
def stop_flapper( self ):
# Stop appending into self.data
#self.reader.stop()
self.should_flap = False
def run( self ):
rospy.logout( 'Flapper: Starting' )
r = rospy.Rate( 10 )
while self.should_run and not rospy.is_shutdown():
if self.should_flap:
self.flap()
else:
r.sleep()
rospy.logout( 'Flapper: Exiting' )
def stop( self ):
# Kill off the poller thread.
self.should_run = False
self.join(15)
if (self.isAlive()):
raise RuntimeError("Flapper: Unable to stop thread")
def navstack( x, y, ang ):
try:
rospy.logout( 'Requesting navstack move to <x,y,ang-deg> %3.3f %3.3f %3.3f.' % (x, y, math.degrees(ang)) )
client = actionlib.SimpleActionClient( 'move_base', MoveBaseAction )
client.wait_for_server()
ps = PoseStamped()
ps.header.frame_id = '/map'
ps.header.stamp = rospy.Time(0)
ps.pose.position.x = x
ps.pose.position.y = y
ps.pose.orientation = Quaternion( *tft.quaternion_from_euler( 0.0, 0.0, ang ))
goal = MoveBaseGoal( ps )
client.send_goal( goal )
rospy.logout( 'Waiting for base to stop moving.' )
client.wait_for_result()
rospy.logout( 'Successfully navigated to desired position.' )
return True
except:
rospy.logout( 'Navstack did not achieve desired position.' )
return False
class RFIDSearch():
def __init__( self ):
try:
rospy.init_node( 'rfid_search' )
except:
pass
rospy.logout( 'rfid_search: Initializing.' )
rospy.wait_for_service( '/rfid_servo/servo' )
rospy.wait_for_service( '/rfid_orient/orient' )
rospy.wait_for_service( '/rfid_orient/flap' )
rospy.wait_for_service( '/rfid_demo/demo' )
#rospy.wait_for_service( '/rfid_gui/select' )
self.explore_act = actionlib.SimpleActionClient('explore', explore_hrl.msg.ExploreAction)
self.explore_act.wait_for_server()
rospy.logout( 'rfid_search: Done Initializing.' )
self._servo = rospy.ServiceProxy( '/rfid_servo/servo', StringInt32_Int32 )
self.follow1 = lambda : self._servo( 'person ', 1 ) # Stops at first obs
self.follow = lambda : self._servo( 'person ', 0 ) # Runs forever
self._demo = rospy.ServiceProxy( '/rfid_demo/demo', Empty )
self.demo = lambda : self._demo()
self._servo_stop = rospy.ServiceProxy( '/rfid_servo/stop_next_obs', Int32_Int32 )
self.servo_toggle = lambda : self._servo_stop( 1 )
self._orient = rospy.ServiceProxy( '/rfid_orient/orient', String_Int32 )
self.orient = lambda tagid: self._orient( tagid )
self.rp = rfid_poller('person ')
self.flapper = Flapper()
rospy.logout( 'rfid_search: ready to go!' )
def wait_for_finish( self, radius = 2.0 ):
print 'Starting RFID tag scanning'
self.rp.start_poller()
self.flapper.start_flapper()
rospy.sleep( 0.3 )
print 'Starting Search'
goal = explore_hrl.msg.ExploreGoal( radius = radius )
self.explore_act.send_goal(goal)
rospy.sleep( 0.5 )
self.explore_act.wait_for_result()
res = self.explore_act.get_result()
print 'Search Complete'
print 'Disabling RFID scanning'
self.flapper.stop_flapper()
self.rp.stop_poller()
print 'Computing Best Position'
readings = self.rp.data
print readings
rr = list( self.rp.data ) # rfid_reads: [ [rssi,[x,y,ang]], ...]
rssi = [ r for r,vec in rr ]
max_rssi, max_pose = rr[ np.argmax( rssi ) ]
print 'Moving to best Position: ', max_pose
navstack( *max_pose )
print 'Executing Remainder of Demo'
if (os.environ.has_key('ROBOT') and os.environ['ROBOT'] == 'sim'):
self.follow1() # Only do servoing in simulation
else:
try:
self.demo() # Run the full demo IRL
except: # for some reason, NoneType throws exception...
pass
print 'Shutting down threads'
self.rp.stop()
self.flapper.stop()
if __name__ == '__main__':
rs = RFIDSearch()
time.sleep( 3 )
rs.wait_for_finish( radius = 1.7 )
#print rs.flap()
# while True:
# print 'DoneSearching: ', rs.doneSearching()
| ajibawa-2023/Python-Code-Large/train/row_99753 | 196 | 289 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Import_L3_C0", "label": "roslib import roslib", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0104, 0.0035, 0, 0.66, 0.0, 796, 0, 1, 0, 0, 796, 0, 0], "semantic": {"name": "roslib", "arg_names": [], "import_names": ["roslib"], "rhs_call_name": "", "annotation": ""}, "snippet": "import roslib; "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Expr_L4_C0", "label": "load_manifest()", "type": "expression", "loc": [4, 4], "level": 0, "parent": null, "vector": [8, 0, 0.0138, 0.0035, 0, 0.66, 0.0303, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "roslib.load_manifest('rfid_people_following')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Expr_L5_C0", "label": "load_manifest()", "type": "expression", "loc": [5, 5], "level": 0, "parent": null, "vector": [8, 0, 0.0173, 0.0035, 0, 0.66, 0.0606, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "roslib.load_manifest('std_srvs')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Expr_L6_C0", "label": "load_manifest()", "type": "expression", "loc": [6, 6], "level": 0, "parent": null, "vector": [8, 0, 0.0208, 0.0035, 0, 0.66, 0.0909, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "roslib.load_manifest('explore_hrl')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Expr_L7_C0", "label": "load_manifest()", "type": "expression", "loc": [7, 7], "level": 0, "parent": null, "vector": [8, 0, 0.0242, 0.0035, 0, 0.66, 0.1212, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "roslib.load_manifest('move_base_msgs')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Expr_L8_C0", "label": "load_manifest()", "type": "expression", "loc": [8, 8], "level": 0, "parent": null, "vector": [8, 0, 0.0277, 0.0035, 0, 0.66, 0.1515, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "roslib.load_manifest('actionlib')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Expr_L9_C0", "label": "load_manifest()", "type": "expression", "loc": [9, 9], "level": 0, "parent": null, "vector": [8, 0, 0.0311, 0.0035, 0, 0.66, 0.1818, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "roslib.load_manifest('geometry_msgs')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Expr_L10_C0", "label": "load_manifest()", "type": "expression", "loc": [10, 10], "level": 0, "parent": null, "vector": [8, 0, 0.0346, 0.0035, 0, 0.66, 0.2121, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "roslib.load_manifest('tf')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Expr_L11_C0", "label": "load_manifest()", "type": "expression", "loc": [11, 11], "level": 0, "parent": null, "vector": [8, 0, 0.0381, 0.0035, 0, 0.66, 0.2424, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "roslib.load_manifest('hrl_rfid')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Import_L12_C0", "label": "rospy import rospy", "type": "import", "loc": [12, 12], "level": 0, "parent": null, "vector": [1, 0, 0.0415, 0.0035, 0, 0.66, 0.2727, 164, 0, 1, 0, 0, 164, 0, 0], "semantic": {"name": "rospy", "arg_names": [], "import_names": ["rospy"], "rhs_call_name": "", "annotation": ""}, "snippet": "import rospy"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Import_L14_C0", "label": "tf import tf", "type": "import", "loc": [14, 14], "level": 0, "parent": null, "vector": [1, 0, 0.0484, 0.0035, 0, 0.66, 0.303, 951, 0, 1, 0, 0, 951, 0, 0], "semantic": {"name": "tf", "arg_names": [], "import_names": ["tf"], "rhs_call_name": "", "annotation": ""}, "snippet": "import tf"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Import_L15_C0", "label": "tf.transformations import tft", "type": "import", "loc": [15, 15], "level": 0, "parent": null, "vector": [1, 0, 0.0519, 0.0035, 0, 0.66, 0.3333, 762, 0, 1, 0, 0, 762, 0, 0], "semantic": {"name": "tf.transformations", "arg_names": [], "import_names": ["tft"], "rhs_call_name": "", "annotation": ""}, "snippet": "import tf.transformations as tft"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Import_L16_C0", "label": "actionlib import actionlib", "type": "import", "loc": [16, 16], "level": 0, "parent": null, "vector": [1, 0, 0.0554, 0.0035, 0, 0.66, 0.3636, 694, 0, 1, 0, 0, 694, 0, 0], "semantic": {"name": "actionlib", "arg_names": [], "import_names": ["actionlib"], "rhs_call_name": "", "annotation": ""}, "snippet": "import actionlib"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:ImportFrom_L17_C0", "label": "from move_base_msgs.msg import MoveBaseAction, MoveBaseGoal", "type": "import", "loc": [17, 17], "level": 0, "parent": null, "vector": [1, 0, 0.0588, 0.0035, 0, 0.66, 0.3939, 440, 0, 2, 0, 0, 440, 0, 0], "semantic": {"name": "move_base_msgs.msg", "arg_names": [], "import_names": ["MoveBaseAction", "MoveBaseGoal"], "rhs_call_name": "", "annotation": ""}, "snippet": "from move_base_msgs.msg import MoveBaseAction, MoveBaseGoal"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Import_L18_C0", "label": "hrl_rfid.ros_M5e_client import rmc", "type": "import", "loc": [18, 18], "level": 0, "parent": null, "vector": [1, 0, 0.0623, 0.0035, 0, 0.66, 0.4242, 460, 0, 1, 0, 0, 460, 0, 0], "semantic": {"name": "hrl_rfid.ros_M5e_client", "arg_names": [], "import_names": ["rmc"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_rfid.ros_M5e_client as rmc"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:ImportFrom_L20_C0", "label": "from rfid_people_following.srv import StringInt32_Int32", "type": "import", "loc": [20, 20], "level": 0, "parent": null, "vector": [1, 0, 0.0692, 0.0035, 0, 0.66, 0.4545, 80, 0, 1, 0, 0, 80, 0, 0], "semantic": {"name": "rfid_people_following.srv", "arg_names": [], "import_names": ["StringInt32_Int32"], "rhs_call_name": "", "annotation": ""}, "snippet": "from rfid_people_following.srv import StringInt32_Int32"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:ImportFrom_L21_C0", "label": "from rfid_people_following.srv import String_Int32", "type": "import", "loc": [21, 21], "level": 0, "parent": null, "vector": [1, 0, 0.0727, 0.0035, 0, 0.66, 0.4848, 80, 0, 1, 0, 0, 80, 0, 0], "semantic": {"name": "rfid_people_following.srv", "arg_names": [], "import_names": ["String_Int32"], "rhs_call_name": "", "annotation": ""}, "snippet": "from rfid_people_following.srv import String_Int32"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:ImportFrom_L22_C0", "label": "from rfid_people_following.srv import Int32_Int32", "type": "import", "loc": [22, 22], "level": 0, "parent": null, "vector": [1, 0, 0.0761, 0.0035, 0, 0.66, 0.5152, 80, 0, 1, 0, 0, 80, 0, 0], "semantic": {"name": "rfid_people_following.srv", "arg_names": [], "import_names": ["Int32_Int32"], "rhs_call_name": "", "annotation": ""}, "snippet": "from rfid_people_following.srv import Int32_Int32"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:ImportFrom_L23_C0", "label": "from rfid_people_following.srv import String_StringArr", "type": "import", "loc": [23, 23], "level": 0, "parent": null, "vector": [1, 0, 0.0796, 0.0035, 0, 0.66, 0.5455, 80, 0, 1, 0, 0, 80, 0, 0], "semantic": {"name": "rfid_people_following.srv", "arg_names": [], "import_names": ["String_StringArr"], "rhs_call_name": "", "annotation": ""}, "snippet": "from rfid_people_following.srv import String_StringArr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:ImportFrom_L24_C0", "label": "from std_srvs.srv import Empty", "type": "import", "loc": [24, 24], "level": 0, "parent": null, "vector": [1, 0, 0.083, 0.0035, 0, 0.66, 0.5758, 261, 0, 1, 0, 0, 261, 0, 0], "semantic": {"name": "std_srvs.srv", "arg_names": [], "import_names": ["Empty"], "rhs_call_name": "", "annotation": ""}, "snippet": "from std_srvs.srv import Empty"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:ImportFrom_L25_C0", "label": "from geometry_msgs.msg import PointStamped", "type": "import", "loc": [25, 25], "level": 0, "parent": null, "vector": [1, 0, 0.0865, 0.0035, 0, 0.66, 0.6061, 951, 0, 1, 0, 0, 951, 0, 0], "semantic": {"name": "geometry_msgs.msg", "arg_names": [], "import_names": ["PointStamped"], "rhs_call_name": "", "annotation": ""}, "snippet": "from geometry_msgs.msg import PointStamped"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Import_L26_C0", "label": "actionlib import actionlib", "type": "import", "loc": [26, 26], "level": 0, "parent": null, "vector": [1, 0, 0.09, 0.0035, 0, 0.66, 0.6364, 694, 0, 1, 0, 0, 694, 0, 0], "semantic": {"name": "actionlib", "arg_names": [], "import_names": ["actionlib"], "rhs_call_name": "", "annotation": ""}, "snippet": "import actionlib"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Import_L27_C0", "label": "explore_hrl.msg import explore_hrl.msg", "type": "import", "loc": [27, 27], "level": 0, "parent": null, "vector": [1, 0, 0.0934, 0.0035, 0, 0.66, 0.6667, 232, 0, 1, 0, 0, 232, 0, 0], "semantic": {"name": "explore_hrl.msg", "arg_names": [], "import_names": ["explore_hrl.msg"], "rhs_call_name": "", "annotation": ""}, "snippet": "import explore_hrl.msg"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:ImportFrom_L29_C0", "label": "from geometry_msgs.msg import PoseStamped", "type": "import", "loc": [29, 29], "level": 0, "parent": null, "vector": [1, 0, 0.1003, 0.0035, 0, 0.66, 0.697, 951, 0, 1, 0, 0, 951, 0, 0], "semantic": {"name": "geometry_msgs.msg", "arg_names": [], "import_names": ["PoseStamped"], "rhs_call_name": "", "annotation": ""}, "snippet": "from geometry_msgs.msg import PoseStamped"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:ImportFrom_L30_C0", "label": "from geometry_msgs.msg import Quaternion", "type": "import", "loc": [30, 30], "level": 0, "parent": null, "vector": [1, 0, 0.1038, 0.0035, 0, 0.66, 0.7273, 951, 0, 1, 0, 0, 951, 0, 0], "semantic": {"name": "geometry_msgs.msg", "arg_names": [], "import_names": ["Quaternion"], "rhs_call_name": "", "annotation": ""}, "snippet": "from geometry_msgs.msg import Quaternion"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Import_L32_C0", "label": "numpy import np, math", "type": "import", "loc": [32, 32], "level": 0, "parent": null, "vector": [1, 0, 0.1107, 0.0035, 0, 0.66, 0.7576, 954, 0, 2, 0, 0, 954, 0, 0], "semantic": {"name": "numpy", "arg_names": [], "import_names": ["np", "math"], "rhs_call_name": "", "annotation": ""}, "snippet": "import numpy as np, math"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Import_L33_C0", "label": "time import time", "type": "import", "loc": [33, 33], "level": 0, "parent": null, "vector": [1, 0, 0.1142, 0.0035, 0, 0.66, 0.7879, 654, 0, 1, 0, 0, 654, 0, 0], "semantic": {"name": "time", "arg_names": [], "import_names": ["time"], "rhs_call_name": "", "annotation": ""}, "snippet": "import time"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:ImportFrom_L34_C0", "label": "from threading import Thread", "type": "import", "loc": [34, 34], "level": 0, "parent": null, "vector": [1, 0, 0.1176, 0.0035, 0, 0.66, 0.8182, 83, 0, 1, 0, 0, 83, 0, 0], "semantic": {"name": "threading", "arg_names": [], "import_names": ["Thread"], "rhs_call_name": "", "annotation": ""}, "snippet": "from threading import Thread"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Import_L35_C0", "label": "os import os", "type": "import", "loc": [35, 35], "level": 0, "parent": null, "vector": [1, 0, 0.1211, 0.0035, 0, 0.66, 0.8485, 688, 0, 1, 0, 0, 688, 0, 0], "semantic": {"name": "os", "arg_names": [], "import_names": ["os"], "rhs_call_name": "", "annotation": ""}, "snippet": "import os"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:ClassDef_L40_C0", "label": "rfid_poller", "type": "class", "loc": [40, 133], "level": 0, "parent": null, "vector": [3, 0, 0.2993, 0.3253, 0, 0.66, 0.8788, 763, 0, 6, 0, 0, 134, 0, 35], "semantic": {"name": "rfid_poller", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class rfid_poller( Thread ):\n def __init__( self, tagid ):\n Thread.__init__( self )\n self.reader = rmc.ROS_M5e_Client('ears')\n self.listener = tf.TransformListener()\n self.listener.waitForTransform('/ear_antenna_left', '/map',\n rospy.Time(0), timeout = rospy.Duration(100) )\n self.listener.waitForTransform('/ear_antenna_right', '/map',"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L41_C4", "label": "__init__", "type": "function", "loc": [41, 54], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:ClassDef_L40_C0", "vector": [2, 1, 0.1644, 0.0484, 1, 0.3, 0.0, 555, 0, 2, 0, 0, 0, 0, 10], "semantic": {"name": "__init__", "arg_names": ["self", "tagid"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__( self, tagid ):\n Thread.__init__( self )\n self.reader = rmc.ROS_M5e_Client('ears')\n self.listener = tf.TransformListener()\n self.listener.waitForTransform('/ear_antenna_left', '/map',\n rospy.Time(0), timeout = rospy.Duration(100) )\n self.listener.waitForTransform('/ear_antenna_right', '/map',\n rospy.Time(0), timeout = rospy.Duration(100) )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Expr_L42_C8", "label": "__init__()", "type": "expression", "loc": [42, 42], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L41_C4", "vector": [8, 2, 0.1453, 0.0035, 2, 0.59, 0.0, 555, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " Thread.__init__( self )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Assign_L43_C8", "label": "self.reader = ROS_M5e_Client()", "type": "assigned_variable", "loc": [43, 43], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L41_C4", "vector": [14, 2, 0.1488, 0.0035, 2, 0.59, 0.1111, 536, 3, 1, 0, 0, 479, 10, 1], "semantic": {"name": "self.reader", "arg_names": [], "import_names": [], "rhs_call_name": "ROS_M5e_Client", "annotation": ""}, "snippet": " self.reader = rmc.ROS_M5e_Client('ears')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Assign_L44_C8", "label": "self.listener = TransformListener()", "type": "assigned_variable", "loc": [44, 44], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L41_C4", "vector": [14, 2, 0.1522, 0.0035, 2, 0.59, 0.2222, 686, 3, 0, 0, 0, 108, 10, 1], "semantic": {"name": "self.listener", "arg_names": [], "import_names": [], "rhs_call_name": "TransformListener", "annotation": ""}, "snippet": " self.listener = tf.TransformListener()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Expr_L45_C8", "label": "waitForTransform()", "type": "expression", "loc": [45, 46], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L41_C4", "vector": [8, 2, 0.1574, 0.0069, 2, 0.59, 0.3333, 900, 3, 4, 0, 0, 0, 0, 3], "semantic": {"name": "waitForTransform", "arg_names": [], "import_names": [], "rhs_call_name": "waitForTransform", "annotation": ""}, "snippet": " self.listener.waitForTransform('/ear_antenna_left', '/map',\n rospy.Time(0), timeout = rospy.Duration(100) )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Expr_L47_C8", "label": "waitForTransform()", "type": "expression", "loc": [47, 48], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L41_C4", "vector": [8, 2, 0.1644, 0.0069, 2, 0.59, 0.4444, 900, 3, 4, 0, 0, 0, 0, 3], "semantic": {"name": "waitForTransform", "arg_names": [], "import_names": [], "rhs_call_name": "waitForTransform", "annotation": ""}, "snippet": " self.listener.waitForTransform('/ear_antenna_right', '/map',\n rospy.Time(0), timeout = rospy.Duration(100) )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Assign_L50_C8", "label": "self.should_run =", "type": "assigned_variable", "loc": [50, 50], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L41_C4", "vector": [14, 2, 0.173, 0.0035, 2, 0.59, 0.5556, 736, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.should_run", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.should_run = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Assign_L51_C8", "label": "self.should_poll =", "type": "assigned_variable", "loc": [51, 51], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L41_C4", "vector": [14, 2, 0.1765, 0.0035, 2, 0.59, 0.6667, 471, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.should_poll", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.should_poll = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Assign_L52_C8", "label": "self.data =", "type": "assigned_variable", "loc": [52, 52], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L41_C4", "vector": [14, 2, 0.1799, 0.0035, 2, 0.59, 0.7778, 838, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.data", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.data = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Assign_L53_C8", "label": "self.tagid =", "type": "assigned_variable", "loc": [53, 53], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L41_C4", "vector": [14, 2, 0.1834, 0.0035, 2, 0.59, 0.8889, 251, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.tagid", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.tagid = tagid"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Expr_L54_C8", "label": "start()", "type": "expression", "loc": [54, 54], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L41_C4", "vector": [8, 2, 0.1869, 0.0035, 2, 0.59, 1.0, 511, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "start", "arg_names": [], "import_names": [], "rhs_call_name": "start", "annotation": ""}, "snippet": " self.start()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L56_C4", "label": "transform", "type": "function", "loc": [56, 93], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:ClassDef_L40_C0", "vector": [2, 1, 0.2578, 0.1315, 1, 0.3, 0.2, 48, 0, 2, 1, 0, 0, 0, 11], "semantic": {"name": "transform", "arg_names": ["self", "antname"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def transform( self, antname ):\n ps = PointStamped()\n\n ps2 = PointStamped()\n ps2.point.x = 0.1\n\n if antname == 'EleLeftEar':\n ps.header.frame_id = '/ear_antenna_left'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Assign_L57_C8", "label": "ps = PointStamped()", "type": "assigned_variable", "loc": [57, 57], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L56_C4", "vector": [14, 2, 0.1972, 0.0035, 2, 0.01, 0.0, 232, 3, 0, 0, 0, 969, 10, 1], "semantic": {"name": "ps", "arg_names": [], "import_names": [], "rhs_call_name": "PointStamped", "annotation": ""}, "snippet": " ps = PointStamped()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Assign_L59_C8", "label": "ps2 = PointStamped()", "type": "assigned_variable", "loc": [59, 59], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L56_C4", "vector": [14, 2, 0.2042, 0.0035, 2, 0.01, 0.25, 298, 3, 0, 0, 0, 969, 10, 1], "semantic": {"name": "ps2", "arg_names": [], "import_names": [], "rhs_call_name": "PointStamped", "annotation": ""}, "snippet": " ps2 = PointStamped()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Assign_L60_C8", "label": "ps2.point.x =", "type": "assigned_variable", "loc": [60, 60], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L56_C4", "vector": [14, 2, 0.2076, 0.0035, 2, 0.01, 0.5, 634, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "ps2.point.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ps2.point.x = 0.1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:If_L62_C8", "label": "if", "type": "if", "loc": [62, 76], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L56_C4", "vector": [4, 2, 0.2388, 0.0519, 2, 0.01, 0.75, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if antname == 'EleLeftEar':\n ps.header.frame_id = '/ear_antenna_left'\n ps.header.stamp = rospy.Time( 0 )\n\n ps2.header.frame_id = '/ear_antenna_left'\n ps2.header.stamp = rospy.Time( 0 )\n elif antname == 'EleRightEar':\n ps.header.frame_id = '/ear_antenna_right'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Assign_L63_C12", "label": "ps.header.frame_id =", "type": "assigned_variable", "loc": [63, 63], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:If_L62_C8", "vector": [14, 3, 0.218, 0.0035, 3, 0.29, 0.0, 293, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "ps.header.frame_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ps.header.frame_id = '/ear_antenna_left'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Assign_L64_C12", "label": "ps.header.stamp = Time()", "type": "assigned_variable", "loc": [64, 64], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:If_L62_C8", "vector": [14, 3, 0.2215, 0.0035, 3, 0.29, 0.25, 161, 3, 1, 0, 0, 451, 10, 1], "semantic": {"name": "ps.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "Time", "annotation": ""}, "snippet": " ps.header.stamp = rospy.Time( 0 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Assign_L66_C12", "label": "ps2.header.frame_id =", "type": "assigned_variable", "loc": [66, 66], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:If_L62_C8", "vector": [14, 3, 0.2284, 0.0035, 3, 0.29, 0.5, 869, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "ps2.header.frame_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ps2.header.frame_id = '/ear_antenna_left'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Assign_L67_C12", "label": "ps2.header.stamp = Time()", "type": "assigned_variable", "loc": [67, 67], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:If_L62_C8", "vector": [14, 3, 0.2318, 0.0035, 3, 0.29, 0.75, 334, 3, 1, 0, 0, 451, 10, 1], "semantic": {"name": "ps2.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "Time", "annotation": ""}, "snippet": " ps2.header.stamp = rospy.Time( 0 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:If_L68_C8", "label": "if", "type": "if", "loc": [68, 76], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:If_L62_C8", "vector": [4, 3, 0.2491, 0.0311, 3, 0.29, 1.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif antname == 'EleRightEar':\n ps.header.frame_id = '/ear_antenna_right'\n ps.header.stamp = rospy.Time( 0 )\n\n ps2.header.frame_id = '/ear_antenna_right'\n ps2.header.stamp = rospy.Time( 0 )\n else:\n rospy.logout( 'Bad ear' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Assign_L69_C12", "label": "ps.header.frame_id =", "type": "assigned_variable", "loc": [69, 69], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:If_L68_C8", "vector": [14, 4, 0.2388, 0.0035, 4, 0.58, 0.0, 293, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "ps.header.frame_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ps.header.frame_id = '/ear_antenna_right'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Assign_L70_C12", "label": "ps.header.stamp = Time()", "type": "assigned_variable", "loc": [70, 70], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:If_L68_C8", "vector": [14, 4, 0.2422, 0.0035, 4, 0.58, 0.2, 161, 3, 1, 0, 0, 451, 10, 1], "semantic": {"name": "ps.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "Time", "annotation": ""}, "snippet": " ps.header.stamp = rospy.Time( 0 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Assign_L72_C12", "label": "ps2.header.frame_id =", "type": "assigned_variable", "loc": [72, 72], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:If_L68_C8", "vector": [14, 4, 0.2491, 0.0035, 4, 0.58, 0.4, 869, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "ps2.header.frame_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ps2.header.frame_id = '/ear_antenna_right'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Assign_L73_C12", "label": "ps2.header.stamp = Time()", "type": "assigned_variable", "loc": [73, 73], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:If_L68_C8", "vector": [14, 4, 0.2526, 0.0035, 4, 0.58, 0.6, 334, 3, 1, 0, 0, 451, 10, 1], "semantic": {"name": "ps2.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "Time", "annotation": ""}, "snippet": " ps2.header.stamp = rospy.Time( 0 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Expr_L75_C12", "label": "logout()", "type": "expression", "loc": [75, 75], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:If_L68_C8", "vector": [8, 4, 0.2595, 0.0035, 4, 0.58, 0.8, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout( 'Bad ear' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Return_L76_C12", "label": "return", "type": "return", "loc": [76, 76], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:If_L68_C8", "vector": [13, 4, 0.263, 0.0035, 4, 0.58, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return False, 0.0, 0.0, 0.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Try_L78_C8", "label": "try", "type": "try", "loc": [78, 93], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L56_C4", "vector": [7, 2, 0.2958, 0.0554, 2, 0.01, 1.0, 0, 0, 1, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n ps_map = self.listener.transformPoint( '/map', ps )\n x = ps_map.point.x\n y = ps_map.point.y\n #rospy.logout( 'Done 1' )\n\n ps2_map = self.listener.transformPoint( '/map', ps2 )\n x2 = ps2_map.point.x"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Assign_L79_C12", "label": "ps_map = transformPoint()", "type": "assigned_variable", "loc": [79, 79], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:Try_L78_C8", "vector": [14, 3, 0.2734, 0.0035, 3, 0.13, 0.0, 938, 3, 2, 0, 0, 987, 10, 1], "semantic": {"name": "ps_map", "arg_names": [], "import_names": [], "rhs_call_name": "transformPoint", "annotation": ""}, "snippet": " ps_map = self.listener.transformPoint( '/map', ps )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Assign_L80_C12", "label": "x =", "type": "assigned_variable", "loc": [80, 80], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:Try_L78_C8", "vector": [14, 3, 0.2768, 0.0035, 3, 0.13, 0.1667, 190, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " x = ps_map.point.x"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Assign_L81_C12", "label": "y =", "type": "assigned_variable", "loc": [81, 81], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:Try_L78_C8", "vector": [14, 3, 0.2803, 0.0035, 3, 0.13, 0.3333, 304, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " y = ps_map.point.y"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Assign_L84_C12", "label": "ps2_map = transformPoint()", "type": "assigned_variable", "loc": [84, 84], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:Try_L78_C8", "vector": [14, 3, 0.2907, 0.0035, 3, 0.13, 0.5, 537, 3, 2, 0, 0, 987, 10, 1], "semantic": {"name": "ps2_map", "arg_names": [], "import_names": [], "rhs_call_name": "transformPoint", "annotation": ""}, "snippet": " ps2_map = self.listener.transformPoint( '/map', ps2 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Assign_L85_C12", "label": "x2 =", "type": "assigned_variable", "loc": [85, 85], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:Try_L78_C8", "vector": [14, 3, 0.2941, 0.0035, 3, 0.13, 0.6667, 837, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "x2", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " x2 = ps2_map.point.x"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Assign_L86_C12", "label": "y2 =", "type": "assigned_variable", "loc": [86, 86], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:Try_L78_C8", "vector": [14, 3, 0.2976, 0.0035, 3, 0.13, 0.8333, 160, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "y2", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " y2 = ps2_map.point.y"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Return_L90_C12", "label": "return", "type": "return", "loc": [90, 90], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:Try_L78_C8", "vector": [13, 3, 0.3114, 0.0035, 3, 0.13, 1.0, 0, 0, 0, 0, 0, 0, 8, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return True, x, y, np.arctan2( y2 - y, x2 - x )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Expr_L92_C12", "label": "logout()", "type": "expression", "loc": [92, 92], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:Try_L78_C8", "vector": [8, 3, 0.3183, 0.0035, 3, 0.13, 0.0, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout( 'Transform failed! ' + ps.header.frame_id )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Return_L93_C12", "label": "return", "type": "return", "loc": [93, 93], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:Try_L78_C8", "vector": [13, 3, 0.3218, 0.0035, 3, 0.13, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return False, 0.0, 0.0, 0.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L96_C4", "label": "start_poller", "type": "function", "loc": [96, 99], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:ClassDef_L40_C0", "vector": [2, 1, 0.3374, 0.0138, 1, 0.3, 0.4, 550, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "start_poller", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def start_poller( self ):\n # Start appending into self.data\n #self.reader.track_mode( self.tagid )\n self.should_poll = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Assign_L99_C8", "label": "self.should_poll =", "type": "assigned_variable", "loc": [99, 99], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L96_C4", "vector": [14, 2, 0.3426, 0.0035, 2, 0.09, 0.0, 471, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.should_poll", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.should_poll = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L101_C4", "label": "stop_poller", "type": "function", "loc": [101, 104], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:ClassDef_L40_C0", "vector": [2, 1, 0.3547, 0.0138, 1, 0.3, 0.6, 692, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "stop_poller", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def stop_poller( self ):\n # Stop appending into self.data\n #self.reader.stop()\n self.should_poll = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Assign_L104_C8", "label": "self.should_poll =", "type": "assigned_variable", "loc": [104, 104], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L101_C4", "vector": [14, 2, 0.3599, 0.0035, 2, 0.24, 0.0, 471, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.should_poll", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.should_poll = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L106_C4", "label": "run", "type": "function", "loc": [106, 126], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:ClassDef_L40_C0", "vector": [2, 1, 0.4014, 0.0727, 1, 0.3, 0.8, 679, 0, 1, 0, 0, 0, 0, 11], "semantic": {"name": "run", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def run( self ):\n rospy.logout( 'rfid_poller: Starting' )\n while self.should_run and not rospy.is_shutdown():\n if self.should_poll:\n left = self.reader.read('EleLeftEar')[-1]\n success, x, y, ang = self.transform( 'EleLeftEar' )\n if success:\n self.data.append( [left, [x,y,ang]] )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Expr_L107_C8", "label": "logout()", "type": "expression", "loc": [107, 107], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L106_C4", "vector": [8, 2, 0.3702, 0.0035, 2, 0.62, 0.0, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout( 'rfid_poller: Starting' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:While_L108_C8", "label": "while", "type": "while", "loc": [108, 120], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L106_C4", "vector": [5, 2, 0.3945, 0.045, 2, 0.62, 0.3333, 0, 0, 0, 0, 0, 0, 0, 8], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while self.should_run and not rospy.is_shutdown():\n if self.should_poll:\n left = self.reader.read('EleLeftEar')[-1]\n success, x, y, ang = self.transform( 'EleLeftEar' )\n if success:\n self.data.append( [left, [x,y,ang]] )\n\n right = self.reader.read('EleRightEar')[-1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:If_L109_C12", "label": "if", "type": "if", "loc": [109, 120], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:While_L108_C8", "vector": [4, 3, 0.3962, 0.0415, 3, 0.69, 0.0, 0, 7, 0, 0, 0, 0, 0, 7], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.should_poll:\n left = self.reader.read('EleLeftEar')[-1]\n success, x, y, ang = self.transform( 'EleLeftEar' )\n if success:\n self.data.append( [left, [x,y,ang]] )\n\n right = self.reader.read('EleRightEar')[-1]\n success, x, y, ang = self.transform( 'EleRightEar' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Assign_L110_C16", "label": "left =", "type": "assigned_variable", "loc": [110, 110], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:If_L109_C12", "vector": [14, 4, 0.3806, 0.0035, 4, 0.7, 0.0, 605, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "left", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " left = self.reader.read('EleLeftEar')[-1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Assign_L111_C16", "label": "success, x, y, ang = transform()", "type": "assigned_variable", "loc": [111, 111], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:If_L109_C12", "vector": [14, 4, 0.3841, 0.0035, 4, 0.7, 0.1667, 475, 3, 1, 0, 0, 48, 10, 1], "semantic": {"name": "success, x, y, ang", "arg_names": [], "import_names": [], "rhs_call_name": "transform", "annotation": ""}, "snippet": " success, x, y, ang = self.transform( 'EleLeftEar' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:If_L112_C16", "label": "if", "type": "if", "loc": [112, 113], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:If_L109_C12", "vector": [4, 4, 0.3893, 0.0069, 4, 0.7, 0.3333, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if success:\n self.data.append( [left, [x,y,ang]] )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Expr_L113_C20", "label": "append()", "type": "expression", "loc": [113, 113], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:If_L112_C16", "vector": [8, 5, 0.391, 0.0035, 5, 0.91, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.data.append( [left, [x,y,ang]] )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Assign_L115_C16", "label": "right =", "type": "assigned_variable", "loc": [115, 115], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:If_L109_C12", "vector": [14, 4, 0.3979, 0.0035, 4, 0.7, 0.5, 724, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "right", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " right = self.reader.read('EleRightEar')[-1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Assign_L116_C16", "label": "success, x, y, ang = transform()", "type": "assigned_variable", "loc": [116, 116], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:If_L109_C12", "vector": [14, 4, 0.4014, 0.0035, 4, 0.7, 0.6667, 475, 3, 1, 0, 0, 48, 10, 1], "semantic": {"name": "success, x, y, ang", "arg_names": [], "import_names": [], "rhs_call_name": "transform", "annotation": ""}, "snippet": " success, x, y, ang = self.transform( 'EleRightEar' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:If_L117_C16", "label": "if", "type": "if", "loc": [117, 118], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:If_L109_C12", "vector": [4, 4, 0.4066, 0.0069, 4, 0.7, 0.8333, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if success:\n self.data.append( [right, [x,y,ang]] )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Expr_L118_C20", "label": "append()", "type": "expression", "loc": [118, 118], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:If_L117_C16", "vector": [8, 5, 0.4083, 0.0035, 5, 0.74, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.data.append( [right, [x,y,ang]] )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Expr_L120_C16", "label": "sleep()", "type": "expression", "loc": [120, 120], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:If_L109_C12", "vector": [8, 4, 0.4152, 0.0035, 4, 0.7, 1.0, 476, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " rospy.sleep( 0.050 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Try_L122_C8", "label": "try", "type": "try", "loc": [122, 125], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L106_C4", "vector": [7, 2, 0.4273, 0.0138, 2, 0.62, 0.6667, 0, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try: # Shut it down to conserve power. Something of a race condition (exception)\n self.reader.stop()\n except:\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Expr_L123_C12", "label": "stop()", "type": "expression", "loc": [123, 123], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:Try_L122_C8", "vector": [8, 3, 0.4256, 0.0035, 3, 0.85, 0.0, 343, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "stop", "arg_names": [], "import_names": [], "rhs_call_name": "stop", "annotation": ""}, "snippet": " self.reader.stop()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Expr_L126_C8", "label": "logout()", "type": "expression", "loc": [126, 126], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L106_C4", "vector": [8, 2, 0.436, 0.0035, 2, 0.62, 1.0, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout( 'rfid_poller: Exiting' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L128_C4", "label": "stop", "type": "function", "loc": [128, 133], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:ClassDef_L40_C0", "vector": [2, 1, 0.4516, 0.0208, 1, 0.3, 1.0, 343, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "stop", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def stop( self ):\n # Kill off the poller thread.\n self.should_run = False\n self.join(5)\n if (self.isAlive()):\n raise RuntimeError(\"rfid_poller: Unable to stop thread\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Assign_L130_C8", "label": "self.should_run =", "type": "assigned_variable", "loc": [130, 130], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L128_C4", "vector": [14, 2, 0.4498, 0.0035, 2, 0.59, 0.0, 736, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.should_run", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.should_run = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Expr_L131_C8", "label": "join()", "type": "expression", "loc": [131, 131], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L128_C4", "vector": [8, 2, 0.4533, 0.0035, 2, 0.59, 0.5, 933, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "join", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": " self.join(5)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:If_L132_C8", "label": "if", "type": "if", "loc": [132, 133], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L128_C4", "vector": [4, 2, 0.4585, 0.0069, 2, 0.59, 1.0, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if (self.isAlive()):\n raise RuntimeError(\"rfid_poller: Unable to stop thread\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:ClassDef_L137_C0", "label": "Flapper", "type": "class", "loc": [137, 177], "level": 0, "parent": null, "vector": [3, 0, 0.5433, 0.1419, 0, 0.66, 0.9091, 540, 0, 5, 0, 0, 134, 0, 16], "semantic": {"name": "Flapper", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Flapper( Thread ):\n def __init__( self, tagid = 'person '):\n Thread.__init__( self )\n rospy.logout('Flapper: Initializing' )\n rospy.wait_for_service( '/rfid_orient/flap' )\n rospy.logout('Flapper: flap service ready.' )\n\n self._flap = rospy.ServiceProxy( '/rfid_orient/flap', String_StringArr )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L138_C4", "label": "__init__", "type": "function", "loc": [138, 149], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:ClassDef_L137_C0", "vector": [2, 1, 0.4965, 0.0415, 1, 0.58, 0.0, 555, 0, 2, 0, 0, 0, 0, 7], "semantic": {"name": "__init__", "arg_names": ["self", "tagid"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__( self, tagid = 'person '):\n Thread.__init__( self )\n rospy.logout('Flapper: Initializing' )\n rospy.wait_for_service( '/rfid_orient/flap' )\n rospy.logout('Flapper: flap service ready.' )\n\n self._flap = rospy.ServiceProxy( '/rfid_orient/flap', String_StringArr )\n self.flap = lambda : self._flap( tagid )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Expr_L139_C8", "label": "__init__()", "type": "expression", "loc": [139, 139], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L138_C4", "vector": [8, 2, 0.481, 0.0035, 2, 0.62, 0.0, 555, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " Thread.__init__( self )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Expr_L140_C8", "label": "logout()", "type": "expression", "loc": [140, 140], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L138_C4", "vector": [8, 2, 0.4844, 0.0035, 2, 0.62, 0.125, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout('Flapper: Initializing' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Expr_L141_C8", "label": "wait_for_service()", "type": "expression", "loc": [141, 141], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L138_C4", "vector": [8, 2, 0.4879, 0.0035, 2, 0.62, 0.25, 617, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "wait_for_service", "arg_names": [], "import_names": [], "rhs_call_name": "wait_for_service", "annotation": ""}, "snippet": " rospy.wait_for_service( '/rfid_orient/flap' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Expr_L142_C8", "label": "logout()", "type": "expression", "loc": [142, 142], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L138_C4", "vector": [8, 2, 0.4913, 0.0035, 2, 0.62, 0.375, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout('Flapper: flap service ready.' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Assign_L144_C8", "label": "self._flap = ServiceProxy()", "type": "assigned_variable", "loc": [144, 144], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L138_C4", "vector": [14, 2, 0.4983, 0.0035, 2, 0.62, 0.5, 835, 3, 2, 0, 0, 915, 10, 1], "semantic": {"name": "self._flap", "arg_names": [], "import_names": [], "rhs_call_name": "ServiceProxy", "annotation": ""}, "snippet": " self._flap = rospy.ServiceProxy( '/rfid_orient/flap', String_StringArr )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Assign_L145_C8", "label": "self.flap =", "type": "assigned_variable", "loc": [145, 145], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L138_C4", "vector": [14, 2, 0.5017, 0.0035, 2, 0.62, 0.625, 124, 9, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self.flap", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.flap = lambda : self._flap( tagid )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Assign_L147_C8", "label": "self.should_run =", "type": "assigned_variable", "loc": [147, 147], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L138_C4", "vector": [14, 2, 0.5087, 0.0035, 2, 0.62, 0.75, 736, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.should_run", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.should_run = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Assign_L148_C8", "label": "self.should_flap =", "type": "assigned_variable", "loc": [148, 148], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L138_C4", "vector": [14, 2, 0.5121, 0.0035, 2, 0.62, 0.875, 547, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.should_flap", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.should_flap = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Expr_L149_C8", "label": "start()", "type": "expression", "loc": [149, 149], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L138_C4", "vector": [8, 2, 0.5156, 0.0035, 2, 0.62, 1.0, 511, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "start", "arg_names": [], "import_names": [], "rhs_call_name": "start", "annotation": ""}, "snippet": " self.start()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L151_C4", "label": "start_flapper", "type": "function", "loc": [151, 154], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:ClassDef_L137_C0", "vector": [2, 1, 0.5277, 0.0138, 1, 0.58, 0.25, 112, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "start_flapper", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def start_flapper( self ):\n # Start appending into self.data\n #self.reader.track_mode( self.tagid )\n self.should_flap = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Assign_L154_C8", "label": "self.should_flap =", "type": "assigned_variable", "loc": [154, 154], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L151_C4", "vector": [14, 2, 0.5329, 0.0035, 2, 0.64, 0.0, 547, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.should_flap", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.should_flap = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L156_C4", "label": "stop_flapper", "type": "function", "loc": [156, 159], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:ClassDef_L137_C0", "vector": [2, 1, 0.545, 0.0138, 1, 0.58, 0.5, 417, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "stop_flapper", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def stop_flapper( self ):\n # Stop appending into self.data\n #self.reader.stop()\n self.should_flap = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Assign_L159_C8", "label": "self.should_flap =", "type": "assigned_variable", "loc": [159, 159], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L156_C4", "vector": [14, 2, 0.5502, 0.0035, 2, 0.88, 0.0, 547, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.should_flap", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.should_flap = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L161_C4", "label": "run", "type": "function", "loc": [161, 170], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:ClassDef_L137_C0", "vector": [2, 1, 0.5727, 0.0346, 1, 0.58, 0.75, 679, 0, 1, 0, 0, 0, 0, 6], "semantic": {"name": "run", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def run( self ):\n rospy.logout( 'Flapper: Starting' )\n r = rospy.Rate( 10 )\n while self.should_run and not rospy.is_shutdown():\n if self.should_flap:\n self.flap()\n else:\n r.sleep()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Expr_L162_C8", "label": "logout()", "type": "expression", "loc": [162, 162], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L161_C4", "vector": [8, 2, 0.5606, 0.0035, 2, 0.57, 0.0, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout( 'Flapper: Starting' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Assign_L163_C8", "label": "r = Rate()", "type": "assigned_variable", "loc": [163, 163], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L161_C4", "vector": [14, 2, 0.564, 0.0035, 2, 0.57, 0.3333, 436, 3, 1, 0, 0, 543, 10, 1], "semantic": {"name": "r", "arg_names": [], "import_names": [], "rhs_call_name": "Rate", "annotation": ""}, "snippet": " r = rospy.Rate( 10 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:While_L164_C8", "label": "while", "type": "while", "loc": [164, 168], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L161_C4", "vector": [5, 2, 0.5744, 0.0173, 2, 0.57, 0.6667, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while self.should_run and not rospy.is_shutdown():\n if self.should_flap:\n self.flap()\n else:\n r.sleep()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:If_L165_C12", "label": "if", "type": "if", "loc": [165, 168], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:While_L164_C8", "vector": [4, 3, 0.5761, 0.0138, 3, 0.19, 0.0, 0, 7, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.should_flap:\n self.flap()\n else:\n r.sleep()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Expr_L166_C16", "label": "flap()", "type": "expression", "loc": [166, 166], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:If_L165_C12", "vector": [8, 4, 0.5744, 0.0035, 4, 0.36, 0.0, 845, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "flap", "arg_names": [], "import_names": [], "rhs_call_name": "flap", "annotation": ""}, "snippet": " self.flap()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Expr_L168_C16", "label": "sleep()", "type": "expression", "loc": [168, 168], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:If_L165_C12", "vector": [8, 4, 0.5813, 0.0035, 4, 0.36, 1.0, 476, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " r.sleep()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Expr_L170_C8", "label": "logout()", "type": "expression", "loc": [170, 170], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L161_C4", "vector": [8, 2, 0.5882, 0.0035, 2, 0.57, 1.0, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout( 'Flapper: Exiting' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L172_C4", "label": "stop", "type": "function", "loc": [172, 177], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:ClassDef_L137_C0", "vector": [2, 1, 0.6038, 0.0208, 1, 0.58, 1.0, 343, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "stop", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def stop( self ):\n # Kill off the poller thread.\n self.should_run = False\n self.join(15)\n if (self.isAlive()):\n raise RuntimeError(\"Flapper: Unable to stop thread\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Assign_L174_C8", "label": "self.should_run =", "type": "assigned_variable", "loc": [174, 174], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L172_C4", "vector": [14, 2, 0.6021, 0.0035, 2, 0.62, 0.0, 736, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.should_run", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.should_run = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Expr_L175_C8", "label": "join()", "type": "expression", "loc": [175, 175], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L172_C4", "vector": [8, 2, 0.6055, 0.0035, 2, 0.62, 0.5, 933, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "join", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": " self.join(15)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:If_L176_C8", "label": "if", "type": "if", "loc": [176, 177], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L172_C4", "vector": [4, 2, 0.6107, 0.0069, 2, 0.62, 1.0, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if (self.isAlive()):\n raise RuntimeError(\"Flapper: Unable to stop thread\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L180_C0", "label": "navstack", "type": "function", "loc": [180, 202], "level": 0, "parent": null, "vector": [2, 0, 0.6609, 0.0796, 0, 0.66, 0.9394, 791, 0, 3, 1, 0, 0, 0, 14], "semantic": {"name": "navstack", "arg_names": ["x", "y", "ang"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def navstack( x, y, ang ):\n try:\n rospy.logout( 'Requesting navstack move to <x,y,ang-deg> %3.3f %3.3f %3.3f.' % (x, y, math.degrees(ang)) )\n\n client = actionlib.SimpleActionClient( 'move_base', MoveBaseAction )\n client.wait_for_server()\n\n ps = PoseStamped()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Try_L181_C4", "label": "try", "type": "try", "loc": [181, 202], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L180_C0", "vector": [7, 1, 0.6626, 0.0761, 1, 0.95, 0.0, 0, 0, 1, 0, 0, 0, 0, 14], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n rospy.logout( 'Requesting navstack move to <x,y,ang-deg> %3.3f %3.3f %3.3f.' % (x, y, math.degrees(ang)) )\n\n client = actionlib.SimpleActionClient( 'move_base', MoveBaseAction )\n client.wait_for_server()\n\n ps = PoseStamped()\n ps.header.frame_id = '/map'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Expr_L182_C8", "label": "logout()", "type": "expression", "loc": [182, 182], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:Try_L181_C4", "vector": [8, 2, 0.6298, 0.0035, 2, 0.58, 0.0, 525, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout( 'Requesting navstack move to <x,y,ang-deg> %3.3f %3.3f %3.3f.' % (x, y, math.degrees(ang)) )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Assign_L184_C8", "label": "client = SimpleActionClient()", "type": "assigned_variable", "loc": [184, 184], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:Try_L181_C4", "vector": [14, 2, 0.6367, 0.0035, 2, 0.58, 0.0714, 608, 3, 2, 0, 0, 230, 10, 1], "semantic": {"name": "client", "arg_names": [], "import_names": [], "rhs_call_name": "SimpleActionClient", "annotation": ""}, "snippet": " client = actionlib.SimpleActionClient( 'move_base', MoveBaseAction )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Expr_L185_C8", "label": "wait_for_server()", "type": "expression", "loc": [185, 185], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:Try_L181_C4", "vector": [8, 2, 0.6401, 0.0035, 2, 0.58, 0.1429, 784, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "wait_for_server", "arg_names": [], "import_names": [], "rhs_call_name": "wait_for_server", "annotation": ""}, "snippet": " client.wait_for_server()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Assign_L187_C8", "label": "ps = PoseStamped()", "type": "assigned_variable", "loc": [187, 187], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:Try_L181_C4", "vector": [14, 2, 0.6471, 0.0035, 2, 0.58, 0.2143, 232, 3, 0, 0, 0, 226, 10, 1], "semantic": {"name": "ps", "arg_names": [], "import_names": [], "rhs_call_name": "PoseStamped", "annotation": ""}, "snippet": " ps = PoseStamped()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Assign_L188_C8", "label": "ps.header.frame_id =", "type": "assigned_variable", "loc": [188, 188], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:Try_L181_C4", "vector": [14, 2, 0.6505, 0.0035, 2, 0.58, 0.2857, 293, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "ps.header.frame_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ps.header.frame_id = '/map'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Assign_L189_C8", "label": "ps.header.stamp = Time()", "type": "assigned_variable", "loc": [189, 189], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:Try_L181_C4", "vector": [14, 2, 0.654, 0.0035, 2, 0.58, 0.3571, 161, 3, 1, 0, 0, 451, 10, 1], "semantic": {"name": "ps.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "Time", "annotation": ""}, "snippet": " ps.header.stamp = rospy.Time(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Assign_L190_C8", "label": "ps.pose.position.x =", "type": "assigned_variable", "loc": [190, 190], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:Try_L181_C4", "vector": [14, 2, 0.6574, 0.0035, 2, 0.58, 0.4286, 782, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ps.pose.position.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ps.pose.position.x = x"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Assign_L191_C8", "label": "ps.pose.position.y =", "type": "assigned_variable", "loc": [191, 191], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:Try_L181_C4", "vector": [14, 2, 0.6609, 0.0035, 2, 0.58, 0.5, 661, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ps.pose.position.y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ps.pose.position.y = y"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Assign_L192_C8", "label": "ps.pose.orientation = Quaternion()", "type": "assigned_variable", "loc": [192, 192], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:Try_L181_C4", "vector": [14, 2, 0.6644, 0.0035, 2, 0.58, 0.5714, 670, 3, 1, 0, 0, 747, 10, 2], "semantic": {"name": "ps.pose.orientation", "arg_names": [], "import_names": [], "rhs_call_name": "Quaternion", "annotation": ""}, "snippet": " ps.pose.orientation = Quaternion( *tft.quaternion_from_euler( 0.0, 0.0, ang ))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Assign_L194_C8", "label": "goal = MoveBaseGoal()", "type": "assigned_variable", "loc": [194, 194], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:Try_L181_C4", "vector": [14, 2, 0.6713, 0.0035, 2, 0.58, 0.6429, 914, 3, 1, 0, 0, 968, 10, 1], "semantic": {"name": "goal", "arg_names": [], "import_names": [], "rhs_call_name": "MoveBaseGoal", "annotation": ""}, "snippet": " goal = MoveBaseGoal( ps )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Expr_L195_C8", "label": "send_goal()", "type": "expression", "loc": [195, 195], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:Try_L181_C4", "vector": [8, 2, 0.6747, 0.0035, 2, 0.58, 0.7143, 184, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "send_goal", "arg_names": [], "import_names": [], "rhs_call_name": "send_goal", "annotation": ""}, "snippet": " client.send_goal( goal )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Expr_L196_C8", "label": "logout()", "type": "expression", "loc": [196, 196], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:Try_L181_C4", "vector": [8, 2, 0.6782, 0.0035, 2, 0.58, 0.7857, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout( 'Waiting for base to stop moving.' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Expr_L197_C8", "label": "wait_for_result()", "type": "expression", "loc": [197, 197], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:Try_L181_C4", "vector": [8, 2, 0.6817, 0.0035, 2, 0.58, 0.8571, 328, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "wait_for_result", "arg_names": [], "import_names": [], "rhs_call_name": "wait_for_result", "annotation": ""}, "snippet": " client.wait_for_result()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Expr_L198_C8", "label": "logout()", "type": "expression", "loc": [198, 198], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:Try_L181_C4", "vector": [8, 2, 0.6851, 0.0035, 2, 0.58, 0.9286, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout( 'Successfully navigated to desired position.' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Return_L199_C8", "label": "return", "type": "return", "loc": [199, 199], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:Try_L181_C4", "vector": [13, 2, 0.6886, 0.0035, 2, 0.58, 1.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Expr_L201_C8", "label": "logout()", "type": "expression", "loc": [201, 201], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:Try_L181_C4", "vector": [8, 2, 0.6955, 0.0035, 2, 0.58, 0.0, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout( 'Navstack did not achieve desired position.' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Return_L202_C8", "label": "return", "type": "return", "loc": [202, 202], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:Try_L181_C4", "vector": [13, 2, 0.699, 0.0035, 2, 0.58, 1.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:ClassDef_L205_C0", "label": "RFIDSearch", "type": "class", "loc": [205, 279], "level": 0, "parent": null, "vector": [3, 0, 0.8374, 0.2595, 0, 0.66, 0.9697, 848, 0, 2, 0, 0, 0, 0, 48], "semantic": {"name": "RFIDSearch", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class RFIDSearch():\n def __init__( self ):\n try:\n rospy.init_node( 'rfid_search' )\n except:\n pass\n \n rospy.logout( 'rfid_search: Initializing.' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L206_C4", "label": "__init__", "type": "function", "loc": [206, 238], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:ClassDef_L205_C0", "vector": [2, 1, 0.7682, 0.1142, 1, 0.44, 0.0, 555, 0, 1, 0, 0, 0, 0, 21], "semantic": {"name": "__init__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__( self ):\n try:\n rospy.init_node( 'rfid_search' )\n except:\n pass\n \n rospy.logout( 'rfid_search: Initializing.' )\n rospy.wait_for_service( '/rfid_servo/servo' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Try_L207_C8", "label": "try", "type": "try", "loc": [207, 210], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L206_C4", "vector": [7, 2, 0.7215, 0.0138, 2, 0.35, 0.0, 0, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n rospy.init_node( 'rfid_search' )\n except:\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Expr_L208_C12", "label": "init_node()", "type": "expression", "loc": [208, 208], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:Try_L207_C8", "vector": [8, 3, 0.7197, 0.0035, 3, 0.44, 0.0, 463, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "init_node", "arg_names": [], "import_names": [], "rhs_call_name": "init_node", "annotation": ""}, "snippet": " rospy.init_node( 'rfid_search' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Expr_L212_C8", "label": "logout()", "type": "expression", "loc": [212, 212], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L206_C4", "vector": [8, 2, 0.7336, 0.0035, 2, 0.35, 0.05, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout( 'rfid_search: Initializing.' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Expr_L213_C8", "label": "wait_for_service()", "type": "expression", "loc": [213, 213], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L206_C4", "vector": [8, 2, 0.737, 0.0035, 2, 0.35, 0.1, 617, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "wait_for_service", "arg_names": [], "import_names": [], "rhs_call_name": "wait_for_service", "annotation": ""}, "snippet": " rospy.wait_for_service( '/rfid_servo/servo' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Expr_L214_C8", "label": "wait_for_service()", "type": "expression", "loc": [214, 214], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L206_C4", "vector": [8, 2, 0.7405, 0.0035, 2, 0.35, 0.15, 617, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "wait_for_service", "arg_names": [], "import_names": [], "rhs_call_name": "wait_for_service", "annotation": ""}, "snippet": " rospy.wait_for_service( '/rfid_orient/orient' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Expr_L215_C8", "label": "wait_for_service()", "type": "expression", "loc": [215, 215], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L206_C4", "vector": [8, 2, 0.7439, 0.0035, 2, 0.35, 0.2, 617, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "wait_for_service", "arg_names": [], "import_names": [], "rhs_call_name": "wait_for_service", "annotation": ""}, "snippet": " rospy.wait_for_service( '/rfid_orient/flap' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Expr_L216_C8", "label": "wait_for_service()", "type": "expression", "loc": [216, 216], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L206_C4", "vector": [8, 2, 0.7474, 0.0035, 2, 0.35, 0.25, 617, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "wait_for_service", "arg_names": [], "import_names": [], "rhs_call_name": "wait_for_service", "annotation": ""}, "snippet": " rospy.wait_for_service( '/rfid_demo/demo' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Assign_L218_C8", "label": "self.explore_act = SimpleActionClient()", "type": "assigned_variable", "loc": [218, 218], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L206_C4", "vector": [14, 2, 0.7543, 0.0035, 2, 0.35, 0.3, 635, 3, 2, 0, 0, 230, 10, 1], "semantic": {"name": "self.explore_act", "arg_names": [], "import_names": [], "rhs_call_name": "SimpleActionClient", "annotation": ""}, "snippet": " self.explore_act = actionlib.SimpleActionClient('explore', explore_hrl.msg.ExploreAction)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Expr_L219_C8", "label": "wait_for_server()", "type": "expression", "loc": [219, 219], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L206_C4", "vector": [8, 2, 0.7578, 0.0035, 2, 0.35, 0.35, 784, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "wait_for_server", "arg_names": [], "import_names": [], "rhs_call_name": "wait_for_server", "annotation": ""}, "snippet": " self.explore_act.wait_for_server()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Expr_L220_C8", "label": "logout()", "type": "expression", "loc": [220, 220], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L206_C4", "vector": [8, 2, 0.7612, 0.0035, 2, 0.35, 0.4, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout( 'rfid_search: Done Initializing.' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Assign_L222_C8", "label": "self._servo = ServiceProxy()", "type": "assigned_variable", "loc": [222, 222], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L206_C4", "vector": [14, 2, 0.7682, 0.0035, 2, 0.35, 0.45, 631, 3, 2, 0, 0, 915, 10, 1], "semantic": {"name": "self._servo", "arg_names": [], "import_names": [], "rhs_call_name": "ServiceProxy", "annotation": ""}, "snippet": " self._servo = rospy.ServiceProxy( '/rfid_servo/servo', StringInt32_Int32 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Assign_L223_C8", "label": "self.follow1 =", "type": "assigned_variable", "loc": [223, 223], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L206_C4", "vector": [14, 2, 0.7716, 0.0035, 2, 0.35, 0.5, 595, 9, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self.follow1", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.follow1 = lambda : self._servo( 'person ', 1 ) # Stops at first obs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Assign_L224_C8", "label": "self.follow =", "type": "assigned_variable", "loc": [224, 224], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L206_C4", "vector": [14, 2, 0.7751, 0.0035, 2, 0.35, 0.55, 949, 9, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self.follow", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.follow = lambda : self._servo( 'person ', 0 ) # Runs forever"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Assign_L226_C8", "label": "self._demo = ServiceProxy()", "type": "assigned_variable", "loc": [226, 226], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L206_C4", "vector": [14, 2, 0.782, 0.0035, 2, 0.35, 0.6, 63, 3, 2, 0, 0, 915, 10, 1], "semantic": {"name": "self._demo", "arg_names": [], "import_names": [], "rhs_call_name": "ServiceProxy", "annotation": ""}, "snippet": " self._demo = rospy.ServiceProxy( '/rfid_demo/demo', Empty )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Assign_L227_C8", "label": "self.demo =", "type": "assigned_variable", "loc": [227, 227], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L206_C4", "vector": [14, 2, 0.7855, 0.0035, 2, 0.35, 0.65, 6, 9, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self.demo", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.demo = lambda : self._demo() "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Assign_L229_C8", "label": "self._servo_stop = ServiceProxy()", "type": "assigned_variable", "loc": [229, 229], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L206_C4", "vector": [14, 2, 0.7924, 0.0035, 2, 0.35, 0.7, 505, 3, 2, 0, 0, 915, 10, 1], "semantic": {"name": "self._servo_stop", "arg_names": [], "import_names": [], "rhs_call_name": "ServiceProxy", "annotation": ""}, "snippet": " self._servo_stop = rospy.ServiceProxy( '/rfid_servo/stop_next_obs', Int32_Int32 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Assign_L230_C8", "label": "self.servo_toggle =", "type": "assigned_variable", "loc": [230, 230], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L206_C4", "vector": [14, 2, 0.7958, 0.0035, 2, 0.35, 0.75, 613, 9, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self.servo_toggle", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.servo_toggle = lambda : self._servo_stop( 1 ) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Assign_L232_C8", "label": "self._orient = ServiceProxy()", "type": "assigned_variable", "loc": [232, 232], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L206_C4", "vector": [14, 2, 0.8028, 0.0035, 2, 0.35, 0.8, 142, 3, 2, 0, 0, 915, 10, 1], "semantic": {"name": "self._orient", "arg_names": [], "import_names": [], "rhs_call_name": "ServiceProxy", "annotation": ""}, "snippet": " self._orient = rospy.ServiceProxy( '/rfid_orient/orient', String_Int32 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Assign_L233_C8", "label": "self.orient =", "type": "assigned_variable", "loc": [233, 233], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L206_C4", "vector": [14, 2, 0.8062, 0.0035, 2, 0.35, 0.85, 883, 9, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self.orient", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.orient = lambda tagid: self._orient( tagid )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Assign_L235_C8", "label": "self.rp = rfid_poller()", "type": "assigned_variable", "loc": [235, 235], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L206_C4", "vector": [14, 2, 0.8131, 0.0035, 2, 0.35, 0.9, 429, 3, 1, 0, 0, 763, 10, 1], "semantic": {"name": "self.rp", "arg_names": [], "import_names": [], "rhs_call_name": "rfid_poller", "annotation": ""}, "snippet": " self.rp = rfid_poller('person ')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Assign_L236_C8", "label": "self.flapper = Flapper()", "type": "assigned_variable", "loc": [236, 236], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L206_C4", "vector": [14, 2, 0.8166, 0.0035, 2, 0.35, 0.95, 227, 3, 0, 0, 0, 540, 10, 1], "semantic": {"name": "self.flapper", "arg_names": [], "import_names": [], "rhs_call_name": "Flapper", "annotation": ""}, "snippet": " self.flapper = Flapper()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Expr_L238_C8", "label": "logout()", "type": "expression", "loc": [238, 238], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L206_C4", "vector": [8, 2, 0.8235, 0.0035, 2, 0.35, 1.0, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout( 'rfid_search: ready to go!' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L240_C4", "label": "wait_for_finish", "type": "function", "loc": [240, 279], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:ClassDef_L205_C0", "vector": [2, 1, 0.8979, 0.1384, 1, 0.44, 1.0, 249, 0, 2, 0, 0, 0, 0, 27], "semantic": {"name": "wait_for_finish", "arg_names": ["self", "radius"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def wait_for_finish( self, radius = 2.0 ):\n print('Starting RFID tag scanning')\n self.rp.start_poller()\n self.flapper.start_flapper()\n rospy.sleep( 0.3 )\n\n print('Starting Search')\n goal = explore_hrl.msg.ExploreGoal( radius = radius )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Expr_L241_C8", "label": "print()", "type": "expression", "loc": [241, 241], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L240_C4", "vector": [8, 2, 0.8339, 0.0035, 2, 0.29, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Starting RFID tag scanning')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Expr_L242_C8", "label": "start_poller()", "type": "expression", "loc": [242, 242], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L240_C4", "vector": [8, 2, 0.8374, 0.0035, 2, 0.29, 0.0385, 550, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "start_poller", "arg_names": [], "import_names": [], "rhs_call_name": "start_poller", "annotation": ""}, "snippet": " self.rp.start_poller()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Expr_L243_C8", "label": "start_flapper()", "type": "expression", "loc": [243, 243], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L240_C4", "vector": [8, 2, 0.8408, 0.0035, 2, 0.29, 0.0769, 112, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "start_flapper", "arg_names": [], "import_names": [], "rhs_call_name": "start_flapper", "annotation": ""}, "snippet": " self.flapper.start_flapper()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Expr_L244_C8", "label": "sleep()", "type": "expression", "loc": [244, 244], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L240_C4", "vector": [8, 2, 0.8443, 0.0035, 2, 0.29, 0.1154, 476, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " rospy.sleep( 0.3 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Expr_L246_C8", "label": "print()", "type": "expression", "loc": [246, 246], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L240_C4", "vector": [8, 2, 0.8512, 0.0035, 2, 0.29, 0.1538, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Starting Search')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Assign_L247_C8", "label": "goal = ExploreGoal()", "type": "assigned_variable", "loc": [247, 247], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L240_C4", "vector": [14, 2, 0.8547, 0.0035, 2, 0.29, 0.1923, 914, 3, 1, 0, 0, 717, 10, 1], "semantic": {"name": "goal", "arg_names": [], "import_names": [], "rhs_call_name": "ExploreGoal", "annotation": ""}, "snippet": " goal = explore_hrl.msg.ExploreGoal( radius = radius )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Expr_L248_C8", "label": "send_goal()", "type": "expression", "loc": [248, 248], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L240_C4", "vector": [8, 2, 0.8581, 0.0035, 2, 0.29, 0.2308, 184, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "send_goal", "arg_names": [], "import_names": [], "rhs_call_name": "send_goal", "annotation": ""}, "snippet": " self.explore_act.send_goal(goal)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Expr_L249_C8", "label": "sleep()", "type": "expression", "loc": [249, 249], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L240_C4", "vector": [8, 2, 0.8616, 0.0035, 2, 0.29, 0.2692, 476, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " rospy.sleep( 0.5 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Expr_L250_C8", "label": "wait_for_result()", "type": "expression", "loc": [250, 250], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L240_C4", "vector": [8, 2, 0.8651, 0.0035, 2, 0.29, 0.3077, 328, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "wait_for_result", "arg_names": [], "import_names": [], "rhs_call_name": "wait_for_result", "annotation": ""}, "snippet": " self.explore_act.wait_for_result()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Assign_L251_C8", "label": "res = get_result()", "type": "assigned_variable", "loc": [251, 251], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L240_C4", "vector": [14, 2, 0.8685, 0.0035, 2, 0.29, 0.3462, 413, 3, 0, 0, 0, 569, 10, 1], "semantic": {"name": "res", "arg_names": [], "import_names": [], "rhs_call_name": "get_result", "annotation": ""}, "snippet": " res = self.explore_act.get_result()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Expr_L252_C8", "label": "print()", "type": "expression", "loc": [252, 252], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L240_C4", "vector": [8, 2, 0.872, 0.0035, 2, 0.29, 0.3846, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Search Complete')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Expr_L254_C8", "label": "print()", "type": "expression", "loc": [254, 254], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L240_C4", "vector": [8, 2, 0.8789, 0.0035, 2, 0.29, 0.4231, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Disabling RFID scanning')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Expr_L255_C8", "label": "stop_flapper()", "type": "expression", "loc": [255, 255], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L240_C4", "vector": [8, 2, 0.8824, 0.0035, 2, 0.29, 0.4615, 417, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "stop_flapper", "arg_names": [], "import_names": [], "rhs_call_name": "stop_flapper", "annotation": ""}, "snippet": " self.flapper.stop_flapper()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Expr_L256_C8", "label": "stop_poller()", "type": "expression", "loc": [256, 256], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L240_C4", "vector": [8, 2, 0.8858, 0.0035, 2, 0.29, 0.5, 692, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "stop_poller", "arg_names": [], "import_names": [], "rhs_call_name": "stop_poller", "annotation": ""}, "snippet": " self.rp.stop_poller()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Expr_L258_C8", "label": "print()", "type": "expression", "loc": [258, 258], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L240_C4", "vector": [8, 2, 0.8927, 0.0035, 2, 0.29, 0.5385, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Computing Best Position')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Assign_L259_C8", "label": "readings =", "type": "assigned_variable", "loc": [259, 259], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L240_C4", "vector": [14, 2, 0.8962, 0.0035, 2, 0.29, 0.5769, 608, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "readings", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " readings = self.rp.data"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Expr_L260_C8", "label": "print()", "type": "expression", "loc": [260, 260], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L240_C4", "vector": [8, 2, 0.8997, 0.0035, 2, 0.29, 0.6154, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(readings)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Assign_L261_C8", "label": "rr = list()", "type": "assigned_variable", "loc": [261, 261], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L240_C4", "vector": [14, 2, 0.9031, 0.0035, 2, 0.29, 0.6538, 220, 3, 1, 0, 0, 430, 10, 1], "semantic": {"name": "rr", "arg_names": [], "import_names": [], "rhs_call_name": "list", "annotation": ""}, "snippet": " rr = list( self.rp.data ) # rfid_reads: [ [rssi,[x,y,ang]], ...]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Assign_L262_C8", "label": "rssi =", "type": "assigned_variable", "loc": [262, 262], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L240_C4", "vector": [14, 2, 0.9066, 0.0035, 2, 0.29, 0.6923, 906, 5, 0, 0, 0, 0, 0, 0], "semantic": {"name": "rssi", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rssi = [ r for r,vec in rr ]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Assign_L263_C8", "label": "max_rssi, max_pose =", "type": "assigned_variable", "loc": [263, 263], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L240_C4", "vector": [14, 2, 0.91, 0.0035, 2, 0.29, 0.7308, 14, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "max_rssi, max_pose", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " max_rssi, max_pose = rr[ np.argmax( rssi ) ]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Expr_L265_C8", "label": "print()", "type": "expression", "loc": [265, 265], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L240_C4", "vector": [8, 2, 0.917, 0.0035, 2, 0.29, 0.7692, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Moving to best Position: ', max_pose)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Expr_L266_C8", "label": "navstack()", "type": "expression", "loc": [266, 266], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L240_C4", "vector": [8, 2, 0.9204, 0.0035, 2, 0.29, 0.8077, 791, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "navstack", "arg_names": [], "import_names": [], "rhs_call_name": "navstack", "annotation": ""}, "snippet": " navstack( *max_pose )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Expr_L268_C8", "label": "print()", "type": "expression", "loc": [268, 268], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L240_C4", "vector": [8, 2, 0.9273, 0.0035, 2, 0.29, 0.8462, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Executing Remainder of Demo')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:If_L269_C8", "label": "if", "type": "if", "loc": [269, 275], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L240_C4", "vector": [4, 2, 0.9412, 0.0242, 2, 0.29, 0.8846, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if (os.environ.has_key('ROBOT') and os.environ['ROBOT'] == 'sim'):\n self.follow1() # Only do servoing in simulation\n else:\n try:\n self.demo() # Run the full demo IRL\n except: # for some reason, NoneType throws exception...\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Expr_L270_C12", "label": "follow1()", "type": "expression", "loc": [270, 270], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:If_L269_C8", "vector": [8, 3, 0.9343, 0.0035, 3, 0.43, 0.0, 425, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "follow1", "arg_names": [], "import_names": [], "rhs_call_name": "follow1", "annotation": ""}, "snippet": " self.follow1() # Only do servoing in simulation"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Try_L272_C12", "label": "try", "type": "try", "loc": [272, 275], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:If_L269_C8", "vector": [7, 3, 0.9464, 0.0138, 3, 0.43, 1.0, 0, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n self.demo() # Run the full demo IRL\n except: # for some reason, NoneType throws exception...\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Expr_L273_C16", "label": "demo()", "type": "expression", "loc": [273, 273], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:Try_L272_C12", "vector": [8, 4, 0.9446, 0.0035, 4, 0.62, 0.0, 886, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "demo", "arg_names": [], "import_names": [], "rhs_call_name": "demo", "annotation": ""}, "snippet": " self.demo() # Run the full demo IRL"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Expr_L277_C8", "label": "print()", "type": "expression", "loc": [277, 277], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L240_C4", "vector": [8, 2, 0.9585, 0.0035, 2, 0.29, 0.9231, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Shutting down threads')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Expr_L278_C8", "label": "stop()", "type": "expression", "loc": [278, 278], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L240_C4", "vector": [8, 2, 0.9619, 0.0035, 2, 0.29, 0.9615, 343, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "stop", "arg_names": [], "import_names": [], "rhs_call_name": "stop", "annotation": ""}, "snippet": " self.rp.stop()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Expr_L279_C8", "label": "stop()", "type": "expression", "loc": [279, 279], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L240_C4", "vector": [8, 2, 0.9654, 0.0035, 2, 0.29, 1.0, 343, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "stop", "arg_names": [], "import_names": [], "rhs_call_name": "stop", "annotation": ""}, "snippet": " self.flapper.stop()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:If_L282_C0", "label": "if", "type": "if", "loc": [282, 285], "level": 0, "parent": null, "vector": [4, 0, 0.981, 0.0138, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == '__main__':\n rs = RFIDSearch()\n time.sleep( 3 )\n rs.wait_for_finish( radius = 1.7 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Assign_L283_C4", "label": "rs = RFIDSearch()", "type": "assigned_variable", "loc": [283, 283], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:If_L282_C0", "vector": [14, 1, 0.9792, 0.0035, 1, 0.69, 0.0, 594, 3, 0, 0, 0, 848, 10, 1], "semantic": {"name": "rs", "arg_names": [], "import_names": [], "rhs_call_name": "RFIDSearch", "annotation": ""}, "snippet": " rs = RFIDSearch()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Expr_L284_C4", "label": "sleep()", "type": "expression", "loc": [284, 284], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:If_L282_C0", "vector": [8, 1, 0.9827, 0.0035, 1, 0.69, 0.5, 476, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " time.sleep( 3 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99753:Expr_L285_C4", "label": "wait_for_finish()", "type": "expression", "loc": [285, 285], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99753:If_L282_C0", "vector": [8, 1, 0.9862, 0.0035, 1, 0.69, 1.0, 249, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "wait_for_finish", "arg_names": [], "import_names": [], "rhs_call_name": "wait_for_finish", "annotation": ""}, "snippet": " rs.wait_for_finish( radius = 1.7 )"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99753:ClassDef_L40_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L41_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L41_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Expr_L42_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L41_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Assign_L43_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L41_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Assign_L44_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L41_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Expr_L45_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L41_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Expr_L47_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L41_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Assign_L50_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L41_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Assign_L51_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L41_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Assign_L52_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L41_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Assign_L53_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L41_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Expr_L54_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:ClassDef_L40_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L56_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L56_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Assign_L57_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L56_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Assign_L59_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L56_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Assign_L60_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L56_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:If_L62_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:If_L62_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Assign_L63_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:If_L62_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Assign_L64_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:If_L62_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Assign_L66_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:If_L62_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Assign_L67_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:If_L62_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:If_L68_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:If_L68_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Assign_L69_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:If_L68_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Assign_L70_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:If_L68_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Assign_L72_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:If_L68_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Assign_L73_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:If_L68_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Expr_L75_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:If_L68_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Return_L76_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L56_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Try_L78_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:Try_L78_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Assign_L79_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:Try_L78_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Assign_L80_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:Try_L78_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Assign_L81_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:Try_L78_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Assign_L84_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:Try_L78_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Assign_L85_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:Try_L78_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Assign_L86_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:Try_L78_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Return_L90_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:Try_L78_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Expr_L92_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:Try_L78_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Return_L93_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:ClassDef_L40_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L96_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L96_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Assign_L99_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:ClassDef_L40_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L101_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L101_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Assign_L104_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:ClassDef_L40_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L106_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L106_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Expr_L107_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L106_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:While_L108_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:While_L108_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:If_L109_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:If_L109_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Assign_L110_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:If_L109_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Assign_L111_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:If_L109_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:If_L112_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:If_L112_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Expr_L113_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:If_L109_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Assign_L115_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:If_L109_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Assign_L116_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:If_L109_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:If_L117_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:If_L117_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Expr_L118_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:If_L109_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Expr_L120_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L106_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Try_L122_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:Try_L122_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Expr_L123_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L106_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Expr_L126_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:ClassDef_L40_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L128_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L128_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Assign_L130_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L128_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Expr_L131_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L128_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:If_L132_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:ClassDef_L137_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L138_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L138_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Expr_L139_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L138_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Expr_L140_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L138_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Expr_L141_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L138_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Expr_L142_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L138_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Assign_L144_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L138_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Assign_L145_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L138_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Assign_L147_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L138_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Assign_L148_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L138_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Expr_L149_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:ClassDef_L137_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L151_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L151_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Assign_L154_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:ClassDef_L137_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L156_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L156_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Assign_L159_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:ClassDef_L137_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L161_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L161_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Expr_L162_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L161_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Assign_L163_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L161_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:While_L164_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:While_L164_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:If_L165_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:If_L165_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Expr_L166_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:If_L165_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Expr_L168_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L161_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Expr_L170_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:ClassDef_L137_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L172_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L172_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Assign_L174_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L172_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Expr_L175_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L172_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:If_L176_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L180_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Try_L181_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:Try_L181_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Expr_L182_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:Try_L181_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Assign_L184_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:Try_L181_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Expr_L185_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:Try_L181_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Assign_L187_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:Try_L181_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Assign_L188_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:Try_L181_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Assign_L189_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:Try_L181_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Assign_L190_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:Try_L181_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Assign_L191_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:Try_L181_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Assign_L192_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:Try_L181_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Assign_L194_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:Try_L181_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Expr_L195_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:Try_L181_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Expr_L196_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:Try_L181_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Expr_L197_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:Try_L181_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Expr_L198_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:Try_L181_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Return_L199_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:Try_L181_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Expr_L201_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:Try_L181_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Return_L202_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:ClassDef_L205_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L206_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L206_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Try_L207_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:Try_L207_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Expr_L208_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L206_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Expr_L212_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L206_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Expr_L213_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L206_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Expr_L214_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L206_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Expr_L215_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L206_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Expr_L216_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L206_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Assign_L218_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L206_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Expr_L219_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L206_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Expr_L220_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L206_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Assign_L222_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L206_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Assign_L223_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L206_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Assign_L224_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L206_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Assign_L226_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L206_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Assign_L227_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L206_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Assign_L229_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L206_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Assign_L230_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L206_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Assign_L232_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L206_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Assign_L233_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L206_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Assign_L235_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L206_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Assign_L236_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L206_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Expr_L238_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:ClassDef_L205_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L240_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L240_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Expr_L241_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L240_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Expr_L242_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L240_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Expr_L243_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L240_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Expr_L244_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L240_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Expr_L246_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L240_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Assign_L247_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L240_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Expr_L248_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L240_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Expr_L249_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L240_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Expr_L250_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L240_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Assign_L251_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L240_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Expr_L252_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L240_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Expr_L254_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L240_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Expr_L255_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L240_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Expr_L256_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L240_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Expr_L258_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L240_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Assign_L259_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L240_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Expr_L260_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L240_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Assign_L261_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L240_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Assign_L262_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L240_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Assign_L263_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L240_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Expr_L265_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L240_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Expr_L266_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L240_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Expr_L268_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L240_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:If_L269_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:If_L269_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Expr_L270_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:If_L269_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Try_L272_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:Try_L272_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Expr_L273_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L240_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Expr_L277_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L240_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Expr_L278_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:FunctionDef_L240_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Expr_L279_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:If_L282_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Assign_L283_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:If_L282_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Expr_L284_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99753:If_L282_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99753:Expr_L285_C4"}] |
#!/usr/bin/python
import roslib
roslib.load_manifest('explore_hrl')
import rospy
import actionlib
import explore_hrl.msg
def explore_client( radius ):
client = actionlib.SimpleActionClient('explore', explore_hrl.msg.ExploreAction)
# Waits until the action server has started up and started
# listening for goals.
client.wait_for_server()
# Creates a goal to send to the action server.
goal = explore_hrl.msg.ExploreGoal( radius = radius )
# Sends the goal to the action server.
client.send_goal(goal)
r = rospy.Rate( 1 )
t0 = rospy.Time.now().to_time()
# while True:
# print 'State: ', client.get_state()
# r.sleep()
# Waits for the server to finish performing the action.
client.wait_for_result()
# Prints out the result of executing the action
#return client.get_result() # A FibonacciResult
return client.get_state()
if __name__ == '__main__':
import optparse
p = optparse.OptionParser()
p.add_option('-r', action='store', type='float', dest='radius', help='Sensing radius', default=2.0)
opt, args = p.parse_args()
try:
# Initializes a rospy node so that the SimpleActionClient can
# publish and subscribe over ROS.
rospy.init_node('explore_client_py')
result = explore_client( opt.radius )
if result == actionlib.GoalStatus.SUCCEEDED:
print 'SUCCEEDED'
else:
print 'FAILED'
except rospy.ROSInterruptException:
print "program interrupted before completion"
| ajibawa-2023/Python-Code-Large/train/row_99754 | 26 | 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_99754:Import_L3_C0", "label": "roslib import roslib", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0577, 0.0192, 0, 0.66, 0.0, 796, 0, 1, 0, 0, 796, 0, 0], "semantic": {"name": "roslib", "arg_names": [], "import_names": ["roslib"], "rhs_call_name": "", "annotation": ""}, "snippet": "import roslib"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99754:Expr_L4_C0", "label": "load_manifest()", "type": "expression", "loc": [4, 4], "level": 0, "parent": null, "vector": [8, 0, 0.0769, 0.0192, 0, 0.66, 0.1667, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "roslib.load_manifest('explore_hrl')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99754:Import_L5_C0", "label": "rospy import rospy", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0962, 0.0192, 0, 0.66, 0.3333, 164, 0, 1, 0, 0, 164, 0, 0], "semantic": {"name": "rospy", "arg_names": [], "import_names": ["rospy"], "rhs_call_name": "", "annotation": ""}, "snippet": "import rospy"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99754:Import_L7_C0", "label": "actionlib import actionlib", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.1346, 0.0192, 0, 0.66, 0.5, 694, 0, 1, 0, 0, 694, 0, 0], "semantic": {"name": "actionlib", "arg_names": [], "import_names": ["actionlib"], "rhs_call_name": "", "annotation": ""}, "snippet": "import actionlib"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99754:Import_L8_C0", "label": "explore_hrl.msg import explore_hrl.msg", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.1538, 0.0192, 0, 0.66, 0.6667, 232, 0, 1, 0, 0, 232, 0, 0], "semantic": {"name": "explore_hrl.msg", "arg_names": [], "import_names": ["explore_hrl.msg"], "rhs_call_name": "", "annotation": ""}, "snippet": "import explore_hrl.msg"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99754:FunctionDef_L10_C0", "label": "explore_client", "type": "function", "loc": [10, 34], "level": 0, "parent": null, "vector": [2, 0, 0.4231, 0.4808, 0, 0.66, 0.8333, 399, 0, 1, 1, 0, 0, 0, 9], "semantic": {"name": "explore_client", "arg_names": ["radius"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def explore_client( radius ):\n client = actionlib.SimpleActionClient('explore', explore_hrl.msg.ExploreAction)\n\n # Waits until the action server has started up and started\n # listening for goals.\n client.wait_for_server()\n\n # Creates a goal to send to the action server."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99754:Assign_L11_C4", "label": "client = SimpleActionClient()", "type": "assigned_variable", "loc": [11, 11], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99754:FunctionDef_L10_C0", "vector": [14, 1, 0.2115, 0.0192, 1, 0.31, 0.0, 608, 3, 2, 0, 0, 230, 10, 1], "semantic": {"name": "client", "arg_names": [], "import_names": [], "rhs_call_name": "SimpleActionClient", "annotation": ""}, "snippet": " client = actionlib.SimpleActionClient('explore', explore_hrl.msg.ExploreAction)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99754:Expr_L15_C4", "label": "wait_for_server()", "type": "expression", "loc": [15, 15], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99754:FunctionDef_L10_C0", "vector": [8, 1, 0.2885, 0.0192, 1, 0.31, 0.1429, 784, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "wait_for_server", "arg_names": [], "import_names": [], "rhs_call_name": "wait_for_server", "annotation": ""}, "snippet": " client.wait_for_server()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99754:Assign_L18_C4", "label": "goal = ExploreGoal()", "type": "assigned_variable", "loc": [18, 18], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99754:FunctionDef_L10_C0", "vector": [14, 1, 0.3462, 0.0192, 1, 0.31, 0.2857, 914, 3, 1, 0, 0, 717, 10, 1], "semantic": {"name": "goal", "arg_names": [], "import_names": [], "rhs_call_name": "ExploreGoal", "annotation": ""}, "snippet": " goal = explore_hrl.msg.ExploreGoal( radius = radius )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99754:Expr_L21_C4", "label": "send_goal()", "type": "expression", "loc": [21, 21], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99754:FunctionDef_L10_C0", "vector": [8, 1, 0.4038, 0.0192, 1, 0.31, 0.4286, 184, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "send_goal", "arg_names": [], "import_names": [], "rhs_call_name": "send_goal", "annotation": ""}, "snippet": " client.send_goal(goal)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99754:Assign_L23_C4", "label": "r = Rate()", "type": "assigned_variable", "loc": [23, 23], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99754:FunctionDef_L10_C0", "vector": [14, 1, 0.4423, 0.0192, 1, 0.31, 0.5714, 436, 3, 1, 0, 0, 543, 10, 1], "semantic": {"name": "r", "arg_names": [], "import_names": [], "rhs_call_name": "Rate", "annotation": ""}, "snippet": " r = rospy.Rate( 1 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99754:Assign_L24_C4", "label": "t0 = to_time()", "type": "assigned_variable", "loc": [24, 24], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99754:FunctionDef_L10_C0", "vector": [14, 1, 0.4615, 0.0192, 1, 0.31, 0.7143, 573, 3, 0, 0, 0, 739, 10, 2], "semantic": {"name": "t0", "arg_names": [], "import_names": [], "rhs_call_name": "to_time", "annotation": ""}, "snippet": " t0 = rospy.Time.now().to_time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99754:Expr_L30_C4", "label": "wait_for_result()", "type": "expression", "loc": [30, 30], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99754:FunctionDef_L10_C0", "vector": [8, 1, 0.5769, 0.0192, 1, 0.31, 0.8571, 328, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "wait_for_result", "arg_names": [], "import_names": [], "rhs_call_name": "wait_for_result", "annotation": ""}, "snippet": " client.wait_for_result()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99754:Return_L34_C4", "label": "return", "type": "return", "loc": [34, 34], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99754:FunctionDef_L10_C0", "vector": [13, 1, 0.6538, 0.0192, 1, 0.31, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return client.get_state()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99754:If_L36_C0", "label": "if", "type": "if", "loc": [36, 52], "level": 0, "parent": null, "vector": [4, 0, 0.8462, 0.3269, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 8], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == '__main__':\n import optparse\n p = optparse.OptionParser()\n p.add_option('-r', action='store', type='float', dest='radius', help='Sensing radius', default=2.0)\n opt, args = p.parse_args()\n \n try:\n # Initializes a rospy node so that the SimpleActionClient can"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99754:Import_L37_C4", "label": "optparse import optparse", "type": "import", "loc": [37, 37], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99754:If_L36_C0", "vector": [1, 1, 0.7115, 0.0192, 1, 0.98, 0.0, 323, 0, 1, 0, 0, 323, 0, 0], "semantic": {"name": "optparse", "arg_names": [], "import_names": ["optparse"], "rhs_call_name": "", "annotation": ""}, "snippet": " import optparse"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99754:Assign_L38_C4", "label": "p = OptionParser()", "type": "assigned_variable", "loc": [38, 38], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99754:If_L36_C0", "vector": [14, 1, 0.7308, 0.0192, 1, 0.98, 0.25, 491, 3, 0, 0, 0, 894, 10, 1], "semantic": {"name": "p", "arg_names": [], "import_names": [], "rhs_call_name": "OptionParser", "annotation": ""}, "snippet": " p = optparse.OptionParser()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99754:Expr_L39_C4", "label": "add_option()", "type": "expression", "loc": [39, 39], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99754:If_L36_C0", "vector": [8, 1, 0.75, 0.0192, 1, 0.98, 0.5, 176, 3, 6, 0, 0, 0, 0, 1], "semantic": {"name": "add_option", "arg_names": [], "import_names": [], "rhs_call_name": "add_option", "annotation": ""}, "snippet": " p.add_option('-r', action='store', type='float', dest='radius', help='Sensing radius', default=2.0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99754:Assign_L40_C4", "label": "opt, args = parse_args()", "type": "assigned_variable", "loc": [40, 40], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99754:If_L36_C0", "vector": [14, 1, 0.7692, 0.0192, 1, 0.98, 0.75, 852, 3, 0, 0, 0, 187, 10, 1], "semantic": {"name": "opt, args", "arg_names": [], "import_names": [], "rhs_call_name": "parse_args", "annotation": ""}, "snippet": " opt, args = p.parse_args()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99754:Try_L42_C4", "label": "try", "type": "try", "loc": [42, 52], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99754:If_L36_C0", "vector": [7, 1, 0.9038, 0.2115, 1, 0.98, 1.0, 0, 0, 1, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n # Initializes a rospy node so that the SimpleActionClient can\n # publish and subscribe over ROS.\n rospy.init_node('explore_client_py')\n result = explore_client( opt.radius )\n if result == actionlib.GoalStatus.SUCCEEDED:\n print('SUCCEEDED')\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99754:Expr_L45_C8", "label": "init_node()", "type": "expression", "loc": [45, 45], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99754:Try_L42_C4", "vector": [8, 2, 0.8654, 0.0192, 2, 0.18, 0.0, 463, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "init_node", "arg_names": [], "import_names": [], "rhs_call_name": "init_node", "annotation": ""}, "snippet": " rospy.init_node('explore_client_py')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99754:Assign_L46_C8", "label": "result = explore_client()", "type": "assigned_variable", "loc": [46, 46], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99754:Try_L42_C4", "vector": [14, 2, 0.8846, 0.0192, 2, 0.18, 0.5, 51, 3, 1, 0, 0, 399, 10, 1], "semantic": {"name": "result", "arg_names": [], "import_names": [], "rhs_call_name": "explore_client", "annotation": ""}, "snippet": " result = explore_client( opt.radius )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99754:If_L47_C8", "label": "if", "type": "if", "loc": [47, 50], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99754:Try_L42_C4", "vector": [4, 2, 0.9327, 0.0769, 2, 0.18, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if result == actionlib.GoalStatus.SUCCEEDED:\n print('SUCCEEDED')\n else:\n print('FAILED')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99754:Expr_L48_C12", "label": "print()", "type": "expression", "loc": [48, 48], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99754:If_L47_C8", "vector": [8, 3, 0.9231, 0.0192, 3, 0.84, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('SUCCEEDED')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99754:Expr_L50_C12", "label": "print()", "type": "expression", "loc": [50, 50], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99754:If_L47_C8", "vector": [8, 3, 0.9615, 0.0192, 3, 0.84, 1.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('FAILED')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99754:Expr_L52_C8", "label": "print()", "type": "expression", "loc": [52, 52], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99754:Try_L42_C4", "vector": [8, 2, 1.0, 0.0192, 2, 0.18, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"program interrupted before completion\")"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99754:FunctionDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99754:Assign_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99754:FunctionDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99754:Expr_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99754:FunctionDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99754:Assign_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99754:FunctionDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99754:Expr_L21_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99754:FunctionDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99754:Assign_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99754:FunctionDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99754:Assign_L24_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99754:FunctionDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99754:Expr_L30_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99754:FunctionDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99754:Return_L34_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99754:If_L36_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99754:Import_L37_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99754:If_L36_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99754:Assign_L38_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99754:If_L36_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99754:Expr_L39_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99754:If_L36_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99754:Assign_L40_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99754:If_L36_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99754:Try_L42_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99754:Try_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99754:Expr_L45_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99754:Try_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99754:Assign_L46_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99754:Try_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99754:If_L47_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99754:If_L47_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99754:Expr_L48_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99754:If_L47_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99754:Expr_L50_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99754:Try_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99754:Expr_L52_C8"}] |
#!/usr/bin/python2.6
#
# Copyright 2011 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Build the BITE Extension."""
__author__ = 'ralphj@google.com (Julie Ralph)'
import logging
import optparse
import os
import shutil
import subprocess
import urllib
import zipfile
CHECKOUT_ACE_COMMAND = ('git clone git://github.com/ajaxorg/ace.git')
CHECKOUT_CLOSURE_COMMAND = ('svn checkout http://closure-library.googlecode.com'
'/svn/trunk/ closure-library')
CHECKOUT_SELENIUM_COMMAND = ('svn checkout http://selenium.googlecode.com'
'/svn/trunk/javascript/atoms selenium-atoms-lib')
CLOSURE_COMPILER_URL = ('http://closure-compiler.googlecode.com/files/'
'compiler-latest.zip')
SOY_COMPILER_URL = ('http://closure-templates.googlecode.com/files/'
'closure-templates-for-javascript-latest.zip')
SOYDATA_URL = ('http://closure-templates.googlecode.com/svn/trunk/javascript/'
'soydata.js')
COMPILE_CLOSURE_COMMAND = ('closure-library/closure/bin/build/closurebuilder.py'
' --root=src'
' --root=closure-library'
' --root=build_gen'
' --root=selenium-atoms-lib'
' --input=%(input)s'
' --output_mode=compiled'
' --output_file=%(output)s'
' --compiler_jar=compiler.jar')
SOY_COMPILER_COMMAND = ('java -jar SoyToJsSrcCompiler.jar'
' --shouldProvideRequireSoyNamespaces'
' --outputPathFormat %(output)s'
' %(file)s')
class ClosureError(Exception):
pass
def BuildClosureScript(input_filename, output_filename):
"""Build a compiled closure script based on the given input file.
Args:
input_filename: A string representing the name of the input script to
compile
output_filename: A string representing the name of the output script.
Raises:
ClosureError: If closure fails to compile the given input file.
"""
result = ExecuteCommand(
COMPILE_CLOSURE_COMMAND % {
'input': input_filename,
'output': output_filename})
if result or not os.path.exists(output_filename):
raise ClosureError('Failed while compiling %s.' % input_filename)
def BuildSoyJs(input_file):
"""Builds a javascript file from a soy file.
Args:
input_file: A path to the soy file to compile into JavaScript. The js file
will be stored in build_gen/{FILENAME}.soy.js
Raises:
ClosureError: If the soy compiler fails to compile.
"""
output_name = os.path.join('build_gen', '%s.js' % input_file)
result = ExecuteCommand(
SOY_COMPILER_COMMAND % {
'file': input_file,
'output': output_name})
if result or not os.path.exists(output_name):
raise ClosureError('Failed while compiling the soy file %s.' % input_file)
def Clean():
if os.path.exists('clean'):
shutil.rmtree('build')
if os.path.exists('build_gen'):
shutil.rmtree('build_gen')
def ExecuteCommand(command):
"""Execute the given command and return the output.
Args:
command: A string representing the command to execute.
Returns:
The return code of the process.
"""
print 'Running command: %s' % command
process = subprocess.Popen(command.split(' '),
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
results = process.communicate()
if process.returncode:
logging.error(results[1])
return process.returncode
def SetupAce():
"""Setup the Ace library.
Checkout the Ace library using git.
Raises:
ClosureError: If the setup fails.
"""
if not os.path.exists('ace'):
ExecuteCommand(CHECKOUT_ACE_COMMAND)
if not os.path.exists('ace'):
logging.error('Could not checkout ACE from github.')
raise ClosureError('Could not set up ACE.')
def SetupClosure():
"""Setup the closure library and compiler.
Checkout the closure library using svn if it doesn't exist. Also, download
the closure compiler.
Raises:
ClosureError: If the setup fails.
"""
# Set up the svn repo for closure if it doesn't exist.
if not os.path.exists('closure-library'):
ExecuteCommand(CHECKOUT_CLOSURE_COMMAND)
if not os.path.exists('closure-library'):
logging.error(('Could not check out the closure library from svn. '
'Please check out the closure library to the '
'"closure-library" directory.'))
raise ClosureError('Could not set up the closure library.')
# Download the compiler jar if it doesn't exist.
if not os.path.exists('compiler.jar'):
(compiler_zip, _) = urllib.urlretrieve(CLOSURE_COMPILER_URL)
compiler_zipfile = zipfile.ZipFile(compiler_zip)
compiler_zipfile.extract('compiler.jar')
if not os.path.exists('compiler.jar'):
logging.error('Could not download the closure compiler jar.')
raise ClosureError('Could not find the closure compiler.')
# Download the soy compiler jar if it doesn't exist.
if (not os.path.exists('SoyToJsSrcCompiler.jar') or
not os.path.exists('build_gen/soyutils_usegoog.js')):
(soy_compiler_zip, _) = urllib.urlretrieve(SOY_COMPILER_URL)
soy_compiler_zipfile = zipfile.ZipFile(soy_compiler_zip)
soy_compiler_zipfile.extract('SoyToJsSrcCompiler.jar')
soy_compiler_zipfile.extract('soyutils_usegoog.js', 'build_gen')
if (not os.path.exists('SoyToJsSrcCompiler.jar') or
not os.path.exists('build_gen/soyutils_usegoog.js')):
logging.error('Could not download the soy compiler jar.')
raise ClosureError('Could not find the soy compiler.')
# Download required soydata file, which is required for soyutils_usegoog.js
# to work.
if not os.path.exists('build_gen/soydata.js'):
urllib.urlretrieve(SOYDATA_URL, 'build_gen/soydata.js')
if not os.path.exists('build_gen/soydata.js'):
logging.error('Could not download soydata.js.')
raise ClosureError('Could not fine soydata.js')
def SetupSelenium():
"""Setup the selenium library.
Checkout necessary files from the selenium library using svn, if they
don't exist.
Raises:
ClosureError: If the setup fails.
"""
if not os.path.exists('selenium-atoms-lib/bot.js'):
ExecuteCommand(CHECKOUT_SELENIUM_COMMAND)
if not os.path.exists('selenium-atoms-lib/bot.js'):
logging.error('Could not download the selenium library.')
raise ClosureError('Could not find the selenium library.')
def main():
usage = 'usage: %prog [options]'
parser = optparse.OptionParser(usage)
parser.add_option('--clean', dest='build_clean',
action='store_true', default=False,
help='Clean the build directories.')
(options, _) = parser.parse_args()
if options.build_clean:
Clean()
exit()
# Set up the directories that will be built into.
if not os.path.exists('build'):
os.mkdir('build')
if not os.path.exists('build/options'):
os.mkdir('build/options')
if not os.path.exists('build_gen'):
os.mkdir('build_gen')
# Get external resources.
SetupClosure()
SetupSelenium()
SetupAce()
# Compile the closure scripts.
soy_files = ['consoles.soy',
'rpfconsole.soy',
'rpf_dialogs.soy',
'locatorsupdater.soy',
'newbug_console.soy',
'newbug_type_selector.soy',
'popup.soy']
for soy_filename in soy_files:
BuildSoyJs(os.path.join('src', soy_filename))
js_targets = {'background.js': 'background_script.js',
'content.js': 'content_script.js',
'getactioninfo.js': 'getactioninfo_script.js',
'console.js': 'console_script.js',
'elementhelper.js': 'elementhelper_script.js',
'popup.js': 'popup_script.js',
'options/page.js': 'options_script.js'}
for target in js_targets:
BuildClosureScript(os.path.join('src', target),
os.path.join('build', js_targets[target]))
# Copy over the static resources
if os.path.exists('build/styles'):
shutil.rmtree('build/styles')
shutil.copytree('src/styles', 'build/styles')
if os.path.exists('build/imgs'):
shutil.rmtree('build/imgs')
shutil.copytree('src/imgs', 'build/imgs')
static_files = ['src/background.html',
'src/console.html',
'src/options/options.html',
'src/popup.html',
'manifest.json']
for static_file in static_files:
shutil.copy(static_file, 'build')
# Copy the required ACE files.
if os.path.exists('build/ace'):
shutil.rmtree('build/ace')
shutil.copytree('ace/build/src', 'build/ace')
if __name__ == '__main__':
main()
| ajibawa-2023/Python-Code-Large/train/row_99755 | 112 | 277 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99755:Expr_L18_C0", "label": "expression", "type": "expression", "loc": [18, 18], "level": 0, "parent": null, "vector": [8, 0, 0.065, 0.0036, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\"\"\"Build the BITE Extension.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99755:Assign_L20_C0", "label": "__author__ =", "type": "assigned_variable", "loc": [20, 20], "level": 0, "parent": null, "vector": [14, 0, 0.0722, 0.0036, 0, 0.66, 0.0385, 777, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__author__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "__author__ = 'ralphj@google.com (Julie Ralph)'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99755:Import_L22_C0", "label": "logging import logging", "type": "import", "loc": [22, 22], "level": 0, "parent": null, "vector": [1, 0, 0.0794, 0.0036, 0, 0.66, 0.0769, 715, 0, 1, 0, 0, 715, 0, 0], "semantic": {"name": "logging", "arg_names": [], "import_names": ["logging"], "rhs_call_name": "", "annotation": ""}, "snippet": "import logging"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99755:Import_L23_C0", "label": "optparse import optparse", "type": "import", "loc": [23, 23], "level": 0, "parent": null, "vector": [1, 0, 0.083, 0.0036, 0, 0.66, 0.1154, 323, 0, 1, 0, 0, 323, 0, 0], "semantic": {"name": "optparse", "arg_names": [], "import_names": ["optparse"], "rhs_call_name": "", "annotation": ""}, "snippet": "import optparse"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99755:Import_L24_C0", "label": "os import os", "type": "import", "loc": [24, 24], "level": 0, "parent": null, "vector": [1, 0, 0.0866, 0.0036, 0, 0.66, 0.1538, 688, 0, 1, 0, 0, 688, 0, 0], "semantic": {"name": "os", "arg_names": [], "import_names": ["os"], "rhs_call_name": "", "annotation": ""}, "snippet": "import os"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99755:Import_L25_C0", "label": "shutil import shutil", "type": "import", "loc": [25, 25], "level": 0, "parent": null, "vector": [1, 0, 0.0903, 0.0036, 0, 0.66, 0.1923, 614, 0, 1, 0, 0, 614, 0, 0], "semantic": {"name": "shutil", "arg_names": [], "import_names": ["shutil"], "rhs_call_name": "", "annotation": ""}, "snippet": "import shutil"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99755:Import_L26_C0", "label": "subprocess import subprocess", "type": "import", "loc": [26, 26], "level": 0, "parent": null, "vector": [1, 0, 0.0939, 0.0036, 0, 0.66, 0.2308, 394, 0, 1, 0, 0, 394, 0, 0], "semantic": {"name": "subprocess", "arg_names": [], "import_names": ["subprocess"], "rhs_call_name": "", "annotation": ""}, "snippet": "import subprocess"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99755:Import_L27_C0", "label": "urllib import urllib", "type": "import", "loc": [27, 27], "level": 0, "parent": null, "vector": [1, 0, 0.0975, 0.0036, 0, 0.66, 0.2692, 614, 0, 1, 0, 0, 614, 0, 0], "semantic": {"name": "urllib", "arg_names": [], "import_names": ["urllib"], "rhs_call_name": "", "annotation": ""}, "snippet": "import urllib"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99755:Import_L28_C0", "label": "zipfile import zipfile", "type": "import", "loc": [28, 28], "level": 0, "parent": null, "vector": [1, 0, 0.1011, 0.0036, 0, 0.66, 0.3077, 93, 0, 1, 0, 0, 93, 0, 0], "semantic": {"name": "zipfile", "arg_names": [], "import_names": ["zipfile"], "rhs_call_name": "", "annotation": ""}, "snippet": "import zipfile"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99755:Assign_L30_C0", "label": "CHECKOUT_ACE_COMMAND =", "type": "assigned_variable", "loc": [30, 30], "level": 0, "parent": null, "vector": [14, 0, 0.1083, 0.0036, 0, 0.66, 0.3462, 268, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "CHECKOUT_ACE_COMMAND", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "CHECKOUT_ACE_COMMAND = ('git clone git://github.com/ajaxorg/ace.git')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99755:Assign_L31_C0", "label": "CHECKOUT_CLOSURE_COMMAND =", "type": "assigned_variable", "loc": [31, 32], "level": 0, "parent": null, "vector": [14, 0, 0.1137, 0.0072, 0, 0.66, 0.3846, 505, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "CHECKOUT_CLOSURE_COMMAND", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "CHECKOUT_CLOSURE_COMMAND = ('svn checkout http://closure-library.googlecode.com'\n '/svn/trunk/ closure-library')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99755:Assign_L33_C0", "label": "CHECKOUT_SELENIUM_COMMAND =", "type": "assigned_variable", "loc": [33, 34], "level": 0, "parent": null, "vector": [14, 0, 0.1209, 0.0072, 0, 0.66, 0.4231, 873, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "CHECKOUT_SELENIUM_COMMAND", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "CHECKOUT_SELENIUM_COMMAND = ('svn checkout http://selenium.googlecode.com'\n '/svn/trunk/javascript/atoms selenium-atoms-lib')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99755:Assign_L35_C0", "label": "CLOSURE_COMPILER_URL =", "type": "assigned_variable", "loc": [35, 36], "level": 0, "parent": null, "vector": [14, 0, 0.1282, 0.0072, 0, 0.66, 0.4615, 345, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "CLOSURE_COMPILER_URL", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "CLOSURE_COMPILER_URL = ('http://closure-compiler.googlecode.com/files/'\n 'compiler-latest.zip')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99755:Assign_L37_C0", "label": "SOY_COMPILER_URL =", "type": "assigned_variable", "loc": [37, 38], "level": 0, "parent": null, "vector": [14, 0, 0.1354, 0.0072, 0, 0.66, 0.5, 98, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "SOY_COMPILER_URL", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "SOY_COMPILER_URL = ('http://closure-templates.googlecode.com/files/'\n 'closure-templates-for-javascript-latest.zip')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99755:Assign_L39_C0", "label": "SOYDATA_URL =", "type": "assigned_variable", "loc": [39, 40], "level": 0, "parent": null, "vector": [14, 0, 0.1426, 0.0072, 0, 0.66, 0.5385, 107, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "SOYDATA_URL", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "SOYDATA_URL = ('http://closure-templates.googlecode.com/svn/trunk/javascript/'\n 'soydata.js')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99755:Assign_L41_C0", "label": "COMPILE_CLOSURE_COMMAND =", "type": "assigned_variable", "loc": [41, 49], "level": 0, "parent": null, "vector": [14, 0, 0.1625, 0.0325, 0, 0.66, 0.5769, 644, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "COMPILE_CLOSURE_COMMAND", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "COMPILE_CLOSURE_COMMAND = ('closure-library/closure/bin/build/closurebuilder.py'\n ' --root=src'\n ' --root=closure-library'\n ' --root=build_gen'\n ' --root=selenium-atoms-lib'\n ' --input=%(input)s'\n ' --output_mode=compiled'\n ' --output_file=%(output)s'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99755:Assign_L50_C0", "label": "SOY_COMPILER_COMMAND =", "type": "assigned_variable", "loc": [50, 53], "level": 0, "parent": null, "vector": [14, 0, 0.1859, 0.0144, 0, 0.66, 0.6154, 590, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "SOY_COMPILER_COMMAND", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "SOY_COMPILER_COMMAND = ('java -jar SoyToJsSrcCompiler.jar'\n ' --shouldProvideRequireSoyNamespaces'\n ' --outputPathFormat %(output)s'\n ' %(file)s')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99755:ClassDef_L56_C0", "label": "ClosureError", "type": "class", "loc": [56, 57], "level": 0, "parent": null, "vector": [3, 0, 0.204, 0.0072, 0, 0.66, 0.6538, 106, 0, 0, 0, 0, 645, 0, 0], "semantic": {"name": "ClosureError", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class ClosureError(Exception):\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99755:FunctionDef_L60_C0", "label": "BuildClosureScript", "type": "function", "loc": [60, 77], "level": 0, "parent": null, "vector": [2, 0, 0.2473, 0.065, 0, 0.66, 0.6923, 257, 0, 2, 0, 0, 0, 0, 3], "semantic": {"name": "BuildClosureScript", "arg_names": ["input_filename", "output_filename"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def BuildClosureScript(input_filename, output_filename):\n \"\"\"Build a compiled closure script based on the given input file.\n\n Args:\n input_filename: A string representing the name of the input script to\n compile\n output_filename: A string representing the name of the output script.\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99755:Expr_L61_C2", "label": "expression", "type": "expression", "loc": [61, 70], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99755:FunctionDef_L60_C0", "vector": [8, 1, 0.2365, 0.0361, 1, 0.26, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Build a compiled closure script based on the given input file.\n\n Args:\n input_filename: A string representing the name of the input script to\n compile\n output_filename: A string representing the name of the output script.\n\n Raises:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99755:Assign_L71_C2", "label": "result = ExecuteCommand()", "type": "assigned_variable", "loc": [71, 74], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99755:FunctionDef_L60_C0", "vector": [14, 1, 0.2617, 0.0144, 1, 0.26, 0.5, 51, 3, 1, 0, 0, 789, 10, 1], "semantic": {"name": "result", "arg_names": [], "import_names": [], "rhs_call_name": "ExecuteCommand", "annotation": ""}, "snippet": " result = ExecuteCommand(\n COMPILE_CLOSURE_COMMAND % {\n 'input': input_filename,\n 'output': output_filename})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99755:If_L76_C2", "label": "if", "type": "if", "loc": [76, 77], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99755:FunctionDef_L60_C0", "vector": [4, 1, 0.2762, 0.0072, 1, 0.26, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if result or not os.path.exists(output_filename):\n raise ClosureError('Failed while compiling %s.' % input_filename)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99755:FunctionDef_L80_C0", "label": "BuildSoyJs", "type": "function", "loc": [80, 96], "level": 0, "parent": null, "vector": [2, 0, 0.3177, 0.0614, 0, 0.66, 0.7308, 853, 0, 1, 0, 0, 0, 0, 4], "semantic": {"name": "BuildSoyJs", "arg_names": ["input_file"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def BuildSoyJs(input_file):\n \"\"\"Builds a javascript file from a soy file.\n\n Args:\n input_file: A path to the soy file to compile into JavaScript. The js file\n will be stored in build_gen/{FILENAME}.soy.js\n\n Raises:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99755:Expr_L81_C2", "label": "expression", "type": "expression", "loc": [81, 89], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99755:FunctionDef_L80_C0", "vector": [8, 1, 0.3069, 0.0325, 1, 0.1, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Builds a javascript file from a soy file.\n\n Args:\n input_file: A path to the soy file to compile into JavaScript. The js file\n will be stored in build_gen/{FILENAME}.soy.js\n\n Raises:\n ClosureError: If the soy compiler fails to compile."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99755:Assign_L90_C2", "label": "output_name = join()", "type": "assigned_variable", "loc": [90, 90], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99755:FunctionDef_L80_C0", "vector": [14, 1, 0.3249, 0.0036, 1, 0.1, 0.3333, 992, 3, 2, 0, 0, 933, 10, 1], "semantic": {"name": "output_name", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": " output_name = os.path.join('build_gen', '%s.js' % input_file)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99755:Assign_L91_C2", "label": "result = ExecuteCommand()", "type": "assigned_variable", "loc": [91, 94], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99755:FunctionDef_L80_C0", "vector": [14, 1, 0.3339, 0.0144, 1, 0.1, 0.6667, 51, 3, 1, 0, 0, 789, 10, 1], "semantic": {"name": "result", "arg_names": [], "import_names": [], "rhs_call_name": "ExecuteCommand", "annotation": ""}, "snippet": " result = ExecuteCommand(\n SOY_COMPILER_COMMAND % {\n 'file': input_file,\n 'output': output_name})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99755:If_L95_C2", "label": "if", "type": "if", "loc": [95, 96], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99755:FunctionDef_L80_C0", "vector": [4, 1, 0.3448, 0.0072, 1, 0.1, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if result or not os.path.exists(output_name):\n raise ClosureError('Failed while compiling the soy file %s.' % input_file)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99755:FunctionDef_L99_C0", "label": "Clean", "type": "function", "loc": [99, 103], "level": 0, "parent": null, "vector": [2, 0, 0.3646, 0.0181, 0, 0.66, 0.7692, 416, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "Clean", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def Clean():\n if os.path.exists('clean'):\n shutil.rmtree('build')\n if os.path.exists('build_gen'):\n shutil.rmtree('build_gen')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99755:If_L100_C2", "label": "if", "type": "if", "loc": [100, 101], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99755:FunctionDef_L99_C0", "vector": [4, 1, 0.3628, 0.0072, 1, 0.61, 0.0, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if os.path.exists('clean'):\n shutil.rmtree('build')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99755:Expr_L101_C4", "label": "rmtree()", "type": "expression", "loc": [101, 101], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99755:If_L100_C2", "vector": [8, 2, 0.3646, 0.0036, 2, 0.75, 0.0, 317, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "rmtree", "arg_names": [], "import_names": [], "rhs_call_name": "rmtree", "annotation": ""}, "snippet": " shutil.rmtree('build')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99755:If_L102_C2", "label": "if", "type": "if", "loc": [102, 103], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99755:FunctionDef_L99_C0", "vector": [4, 1, 0.37, 0.0072, 1, 0.61, 1.0, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if os.path.exists('build_gen'):\n shutil.rmtree('build_gen')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99755:Expr_L103_C4", "label": "rmtree()", "type": "expression", "loc": [103, 103], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99755:If_L102_C2", "vector": [8, 2, 0.3718, 0.0036, 2, 0.65, 0.0, 317, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "rmtree", "arg_names": [], "import_names": [], "rhs_call_name": "rmtree", "annotation": ""}, "snippet": " shutil.rmtree('build_gen')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99755:FunctionDef_L106_C0", "label": "ExecuteCommand", "type": "function", "loc": [106, 122], "level": 0, "parent": null, "vector": [2, 0, 0.4116, 0.0614, 0, 0.66, 0.8077, 789, 0, 1, 1, 0, 0, 0, 5], "semantic": {"name": "ExecuteCommand", "arg_names": ["command"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def ExecuteCommand(command):\n \"\"\"Execute the given command and return the output.\n\n Args:\n command: A string representing the command to execute.\n\n Returns:\n The return code of the process."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99755:Expr_L107_C2", "label": "expression", "type": "expression", "loc": [107, 114], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99755:FunctionDef_L106_C0", "vector": [8, 1, 0.3989, 0.0289, 1, 0.98, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Execute the given command and return the output.\n\n Args:\n command: A string representing the command to execute.\n\n Returns:\n The return code of the process.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99755:Expr_L115_C2", "label": "print()", "type": "expression", "loc": [115, 115], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99755:FunctionDef_L106_C0", "vector": [8, 1, 0.4152, 0.0036, 1, 0.98, 0.2, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Running command: %s' % command)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99755:Assign_L116_C2", "label": "process = Popen()", "type": "assigned_variable", "loc": [116, 118], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99755:FunctionDef_L106_C0", "vector": [14, 1, 0.4224, 0.0108, 1, 0.98, 0.4, 712, 3, 3, 0, 0, 568, 10, 2], "semantic": {"name": "process", "arg_names": [], "import_names": [], "rhs_call_name": "Popen", "annotation": ""}, "snippet": " process = subprocess.Popen(command.split(' '),\n stdout=subprocess.PIPE,\n stderr=subprocess.PIPE)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99755:Assign_L119_C2", "label": "results = communicate()", "type": "assigned_variable", "loc": [119, 119], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99755:FunctionDef_L106_C0", "vector": [14, 1, 0.4296, 0.0036, 1, 0.98, 0.6, 143, 3, 0, 0, 0, 768, 10, 1], "semantic": {"name": "results", "arg_names": [], "import_names": [], "rhs_call_name": "communicate", "annotation": ""}, "snippet": " results = process.communicate()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99755:If_L120_C2", "label": "if", "type": "if", "loc": [120, 121], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99755:FunctionDef_L106_C0", "vector": [4, 1, 0.435, 0.0072, 1, 0.98, 0.8, 0, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if process.returncode:\n logging.error(results[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99755:Expr_L121_C4", "label": "error()", "type": "expression", "loc": [121, 121], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99755:If_L120_C2", "vector": [8, 2, 0.4368, 0.0036, 2, 0.61, 0.0, 771, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "error", "arg_names": [], "import_names": [], "rhs_call_name": "error", "annotation": ""}, "snippet": " logging.error(results[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99755:Return_L122_C2", "label": "return", "type": "return", "loc": [122, 122], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99755:FunctionDef_L106_C0", "vector": [13, 1, 0.4404, 0.0036, 1, 0.98, 1.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return process.returncode"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99755:FunctionDef_L125_C0", "label": "SetupAce", "type": "function", "loc": [125, 138], "level": 0, "parent": null, "vector": [2, 0, 0.4747, 0.0505, 0, 0.66, 0.8462, 254, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "SetupAce", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def SetupAce():\n \"\"\"Setup the Ace library.\n\n Checkout the Ace library using git.\n\n Raises:\n ClosureError: If the setup fails.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99755:Expr_L126_C2", "label": "expression", "type": "expression", "loc": [126, 132], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99755:FunctionDef_L125_C0", "vector": [8, 1, 0.4657, 0.0253, 1, 0.24, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Setup the Ace library.\n\n Checkout the Ace library using git.\n\n Raises:\n ClosureError: If the setup fails.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99755:If_L134_C2", "label": "if", "type": "if", "loc": [134, 138], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99755:FunctionDef_L125_C0", "vector": [4, 1, 0.491, 0.0181, 1, 0.24, 1.0, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not os.path.exists('ace'):\n ExecuteCommand(CHECKOUT_ACE_COMMAND)\n if not os.path.exists('ace'):\n logging.error('Could not checkout ACE from github.')\n raise ClosureError('Could not set up ACE.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99755:Expr_L135_C4", "label": "ExecuteCommand()", "type": "expression", "loc": [135, 135], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99755:If_L134_C2", "vector": [8, 2, 0.4874, 0.0036, 2, 0.37, 0.0, 789, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "ExecuteCommand", "arg_names": [], "import_names": [], "rhs_call_name": "ExecuteCommand", "annotation": ""}, "snippet": " ExecuteCommand(CHECKOUT_ACE_COMMAND)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99755:If_L136_C4", "label": "if", "type": "if", "loc": [136, 138], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99755:If_L134_C2", "vector": [4, 2, 0.4946, 0.0108, 2, 0.37, 1.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not os.path.exists('ace'):\n logging.error('Could not checkout ACE from github.')\n raise ClosureError('Could not set up ACE.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99755:Expr_L137_C6", "label": "error()", "type": "expression", "loc": [137, 137], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99755:If_L136_C4", "vector": [8, 3, 0.4946, 0.0036, 3, 0.46, 0.0, 771, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "error", "arg_names": [], "import_names": [], "rhs_call_name": "error", "annotation": ""}, "snippet": " logging.error('Could not checkout ACE from github.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99755:FunctionDef_L141_C0", "label": "SetupClosure", "type": "function", "loc": [141, 186], "level": 0, "parent": null, "vector": [2, 0, 0.5903, 0.1661, 0, 0.66, 0.8846, 844, 0, 0, 0, 0, 0, 0, 27], "semantic": {"name": "SetupClosure", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def SetupClosure():\n \"\"\"Setup the closure library and compiler.\n\n Checkout the closure library using svn if it doesn't exist. Also, download\n the closure compiler.\n\n Raises:\n ClosureError: If the setup fails."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99755:Expr_L142_C2", "label": "expression", "type": "expression", "loc": [142, 149], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99755:FunctionDef_L141_C0", "vector": [8, 1, 0.5253, 0.0289, 1, 0.44, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Setup the closure library and compiler.\n\n Checkout the closure library using svn if it doesn't exist. Also, download\n the closure compiler.\n\n Raises:\n ClosureError: If the setup fails.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99755:If_L151_C2", "label": "if", "type": "if", "loc": [151, 157], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99755:FunctionDef_L141_C0", "vector": [4, 1, 0.556, 0.0253, 1, 0.44, 0.25, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not os.path.exists('closure-library'):\n ExecuteCommand(CHECKOUT_CLOSURE_COMMAND)\n if not os.path.exists('closure-library'):\n logging.error(('Could not check out the closure library from svn. '\n 'Please check out the closure library to the '\n '\"closure-library\" directory.'))\n raise ClosureError('Could not set up the closure library.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99755:Expr_L152_C4", "label": "ExecuteCommand()", "type": "expression", "loc": [152, 152], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99755:If_L151_C2", "vector": [8, 2, 0.5487, 0.0036, 2, 0.87, 0.0, 789, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "ExecuteCommand", "arg_names": [], "import_names": [], "rhs_call_name": "ExecuteCommand", "annotation": ""}, "snippet": " ExecuteCommand(CHECKOUT_CLOSURE_COMMAND)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99755:If_L153_C4", "label": "if", "type": "if", "loc": [153, 157], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99755:If_L151_C2", "vector": [4, 2, 0.5596, 0.0181, 2, 0.87, 1.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not os.path.exists('closure-library'):\n logging.error(('Could not check out the closure library from svn. '\n 'Please check out the closure library to the '\n '\"closure-library\" directory.'))\n raise ClosureError('Could not set up the closure library.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99755:Expr_L154_C6", "label": "error()", "type": "expression", "loc": [154, 156], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99755:If_L153_C4", "vector": [8, 3, 0.5596, 0.0108, 3, 0.29, 0.0, 771, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "error", "arg_names": [], "import_names": [], "rhs_call_name": "error", "annotation": ""}, "snippet": " logging.error(('Could not check out the closure library from svn. '\n 'Please check out the closure library to the '\n '\"closure-library\" directory.'))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99755:If_L160_C2", "label": "if", "type": "if", "loc": [160, 166], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99755:FunctionDef_L141_C0", "vector": [4, 1, 0.5884, 0.0253, 1, 0.44, 0.5, 0, 0, 0, 0, 0, 0, 0, 7], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not os.path.exists('compiler.jar'):\n (compiler_zip, _) = urllib.urlretrieve(CLOSURE_COMPILER_URL)\n compiler_zipfile = zipfile.ZipFile(compiler_zip)\n compiler_zipfile.extract('compiler.jar')\n if not os.path.exists('compiler.jar'):\n logging.error('Could not download the closure compiler jar.')\n raise ClosureError('Could not find the closure compiler.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99755:Assign_L161_C4", "label": "compiler_zip, _ = urlretrieve()", "type": "assigned_variable", "loc": [161, 161], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99755:If_L160_C2", "vector": [14, 2, 0.5812, 0.0036, 2, 0.85, 0.0, 761, 3, 1, 0, 0, 329, 10, 1], "semantic": {"name": "compiler_zip, _", "arg_names": [], "import_names": [], "rhs_call_name": "urlretrieve", "annotation": ""}, "snippet": " (compiler_zip, _) = urllib.urlretrieve(CLOSURE_COMPILER_URL)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99755:Assign_L162_C4", "label": "compiler_zipfile = ZipFile()", "type": "assigned_variable", "loc": [162, 162], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99755:If_L160_C2", "vector": [14, 2, 0.5848, 0.0036, 2, 0.85, 0.3333, 337, 3, 1, 0, 0, 299, 10, 1], "semantic": {"name": "compiler_zipfile", "arg_names": [], "import_names": [], "rhs_call_name": "ZipFile", "annotation": ""}, "snippet": " compiler_zipfile = zipfile.ZipFile(compiler_zip)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99755:Expr_L163_C4", "label": "extract()", "type": "expression", "loc": [163, 163], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99755:If_L160_C2", "vector": [8, 2, 0.5884, 0.0036, 2, 0.85, 0.6667, 450, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "extract", "arg_names": [], "import_names": [], "rhs_call_name": "extract", "annotation": ""}, "snippet": " compiler_zipfile.extract('compiler.jar')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99755:If_L164_C4", "label": "if", "type": "if", "loc": [164, 166], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99755:If_L160_C2", "vector": [4, 2, 0.5957, 0.0108, 2, 0.85, 1.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not os.path.exists('compiler.jar'):\n logging.error('Could not download the closure compiler jar.')\n raise ClosureError('Could not find the closure compiler.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99755:Expr_L165_C6", "label": "error()", "type": "expression", "loc": [165, 165], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99755:If_L164_C4", "vector": [8, 3, 0.5957, 0.0036, 3, 0.13, 0.0, 771, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "error", "arg_names": [], "import_names": [], "rhs_call_name": "error", "annotation": ""}, "snippet": " logging.error('Could not download the closure compiler jar.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99755:If_L169_C2", "label": "if", "type": "if", "loc": [169, 178], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99755:FunctionDef_L141_C0", "vector": [4, 1, 0.6264, 0.0361, 1, 0.44, 0.75, 0, 0, 0, 0, 0, 0, 0, 10], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if (not os.path.exists('SoyToJsSrcCompiler.jar') or\n not os.path.exists('build_gen/soyutils_usegoog.js')):\n (soy_compiler_zip, _) = urllib.urlretrieve(SOY_COMPILER_URL)\n soy_compiler_zipfile = zipfile.ZipFile(soy_compiler_zip)\n soy_compiler_zipfile.extract('SoyToJsSrcCompiler.jar')\n soy_compiler_zipfile.extract('soyutils_usegoog.js', 'build_gen')\n if (not os.path.exists('SoyToJsSrcCompiler.jar') or\n not os.path.exists('build_gen/soyutils_usegoog.js')):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99755:Assign_L171_C4", "label": "soy_compiler_zip, _ = urlretrieve()", "type": "assigned_variable", "loc": [171, 171], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99755:If_L169_C2", "vector": [14, 2, 0.6173, 0.0036, 2, 0.18, 0.0, 508, 3, 1, 0, 0, 329, 10, 1], "semantic": {"name": "soy_compiler_zip, _", "arg_names": [], "import_names": [], "rhs_call_name": "urlretrieve", "annotation": ""}, "snippet": " (soy_compiler_zip, _) = urllib.urlretrieve(SOY_COMPILER_URL)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99755:Assign_L172_C4", "label": "soy_compiler_zipfile = ZipFile()", "type": "assigned_variable", "loc": [172, 172], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99755:If_L169_C2", "vector": [14, 2, 0.6209, 0.0036, 2, 0.18, 0.25, 110, 3, 1, 0, 0, 299, 10, 1], "semantic": {"name": "soy_compiler_zipfile", "arg_names": [], "import_names": [], "rhs_call_name": "ZipFile", "annotation": ""}, "snippet": " soy_compiler_zipfile = zipfile.ZipFile(soy_compiler_zip)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99755:Expr_L173_C4", "label": "extract()", "type": "expression", "loc": [173, 173], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99755:If_L169_C2", "vector": [8, 2, 0.6245, 0.0036, 2, 0.18, 0.5, 450, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "extract", "arg_names": [], "import_names": [], "rhs_call_name": "extract", "annotation": ""}, "snippet": " soy_compiler_zipfile.extract('SoyToJsSrcCompiler.jar')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99755:Expr_L174_C4", "label": "extract()", "type": "expression", "loc": [174, 174], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99755:If_L169_C2", "vector": [8, 2, 0.6282, 0.0036, 2, 0.18, 0.75, 450, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "extract", "arg_names": [], "import_names": [], "rhs_call_name": "extract", "annotation": ""}, "snippet": " soy_compiler_zipfile.extract('soyutils_usegoog.js', 'build_gen')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99755:If_L175_C4", "label": "if", "type": "if", "loc": [175, 178], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99755:If_L169_C2", "vector": [4, 2, 0.6372, 0.0144, 2, 0.18, 1.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if (not os.path.exists('SoyToJsSrcCompiler.jar') or\n not os.path.exists('build_gen/soyutils_usegoog.js')):\n logging.error('Could not download the soy compiler jar.')\n raise ClosureError('Could not find the soy compiler.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99755:Expr_L177_C6", "label": "error()", "type": "expression", "loc": [177, 177], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99755:If_L175_C4", "vector": [8, 3, 0.639, 0.0036, 3, 0.58, 0.0, 771, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "error", "arg_names": [], "import_names": [], "rhs_call_name": "error", "annotation": ""}, "snippet": " logging.error('Could not download the soy compiler jar.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99755:If_L182_C2", "label": "if", "type": "if", "loc": [182, 186], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99755:FunctionDef_L141_C0", "vector": [4, 1, 0.6643, 0.0181, 1, 0.44, 1.0, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not os.path.exists('build_gen/soydata.js'):\n urllib.urlretrieve(SOYDATA_URL, 'build_gen/soydata.js')\n if not os.path.exists('build_gen/soydata.js'):\n logging.error('Could not download soydata.js.')\n raise ClosureError('Could not fine soydata.js')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99755:Expr_L183_C4", "label": "urlretrieve()", "type": "expression", "loc": [183, 183], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99755:If_L182_C2", "vector": [8, 2, 0.6606, 0.0036, 2, 0.86, 0.0, 329, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "urlretrieve", "arg_names": [], "import_names": [], "rhs_call_name": "urlretrieve", "annotation": ""}, "snippet": " urllib.urlretrieve(SOYDATA_URL, 'build_gen/soydata.js')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99755:If_L184_C4", "label": "if", "type": "if", "loc": [184, 186], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99755:If_L182_C2", "vector": [4, 2, 0.6679, 0.0108, 2, 0.86, 1.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not os.path.exists('build_gen/soydata.js'):\n logging.error('Could not download soydata.js.')\n raise ClosureError('Could not fine soydata.js')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99755:Expr_L185_C6", "label": "error()", "type": "expression", "loc": [185, 185], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99755:If_L184_C4", "vector": [8, 3, 0.6679, 0.0036, 3, 0.81, 0.0, 771, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "error", "arg_names": [], "import_names": [], "rhs_call_name": "error", "annotation": ""}, "snippet": " logging.error('Could not download soydata.js.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99755:FunctionDef_L189_C0", "label": "SetupSelenium", "type": "function", "loc": [189, 202], "level": 0, "parent": null, "vector": [2, 0, 0.7058, 0.0505, 0, 0.66, 0.9231, 313, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "SetupSelenium", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def SetupSelenium():\n \"\"\"Setup the selenium library.\n\n Checkout necessary files from the selenium library using svn, if they\n don't exist.\n\n Raises:\n ClosureError: If the setup fails."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99755:Expr_L190_C2", "label": "expression", "type": "expression", "loc": [190, 197], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99755:FunctionDef_L189_C0", "vector": [8, 1, 0.6986, 0.0289, 1, 0.34, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Setup the selenium library.\n\n Checkout necessary files from the selenium library using svn, if they\n don't exist.\n\n Raises:\n ClosureError: If the setup fails.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99755:If_L198_C2", "label": "if", "type": "if", "loc": [198, 202], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99755:FunctionDef_L189_C0", "vector": [4, 1, 0.722, 0.0181, 1, 0.34, 1.0, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not os.path.exists('selenium-atoms-lib/bot.js'):\n ExecuteCommand(CHECKOUT_SELENIUM_COMMAND)\n if not os.path.exists('selenium-atoms-lib/bot.js'):\n logging.error('Could not download the selenium library.')\n raise ClosureError('Could not find the selenium library.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99755:Expr_L199_C4", "label": "ExecuteCommand()", "type": "expression", "loc": [199, 199], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99755:If_L198_C2", "vector": [8, 2, 0.7184, 0.0036, 2, 0.23, 0.0, 789, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "ExecuteCommand", "arg_names": [], "import_names": [], "rhs_call_name": "ExecuteCommand", "annotation": ""}, "snippet": " ExecuteCommand(CHECKOUT_SELENIUM_COMMAND)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99755:If_L200_C4", "label": "if", "type": "if", "loc": [200, 202], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99755:If_L198_C2", "vector": [4, 2, 0.7256, 0.0108, 2, 0.23, 1.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not os.path.exists('selenium-atoms-lib/bot.js'):\n logging.error('Could not download the selenium library.')\n raise ClosureError('Could not find the selenium library.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99755:Expr_L201_C6", "label": "error()", "type": "expression", "loc": [201, 201], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99755:If_L200_C4", "vector": [8, 3, 0.7256, 0.0036, 3, 0.76, 0.0, 771, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "error", "arg_names": [], "import_names": [], "rhs_call_name": "error", "annotation": ""}, "snippet": " logging.error('Could not download the selenium library.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99755:FunctionDef_L205_C0", "label": "main", "type": "function", "loc": [205, 272], "level": 0, "parent": null, "vector": [2, 0, 0.861, 0.2455, 0, 0.66, 0.9615, 624, 0, 0, 0, 0, 0, 0, 29], "semantic": {"name": "main", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def main():\n usage = 'usage: %prog [options]'\n parser = optparse.OptionParser(usage)\n parser.add_option('--clean', dest='build_clean',\n action='store_true', default=False,\n help='Clean the build directories.')\n (options, _) = parser.parse_args()\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99755:Assign_L206_C2", "label": "usage =", "type": "assigned_variable", "loc": [206, 206], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99755:FunctionDef_L205_C0", "vector": [14, 1, 0.7437, 0.0036, 1, 0.71, 0.0, 129, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "usage", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " usage = 'usage: %prog [options]'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99755:Assign_L207_C2", "label": "parser = OptionParser()", "type": "assigned_variable", "loc": [207, 207], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99755:FunctionDef_L205_C0", "vector": [14, 1, 0.7473, 0.0036, 1, 0.71, 0.0455, 968, 3, 1, 0, 0, 894, 10, 1], "semantic": {"name": "parser", "arg_names": [], "import_names": [], "rhs_call_name": "OptionParser", "annotation": ""}, "snippet": " parser = optparse.OptionParser(usage)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99755:Expr_L208_C2", "label": "add_option()", "type": "expression", "loc": [208, 210], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99755:FunctionDef_L205_C0", "vector": [8, 1, 0.7545, 0.0108, 1, 0.71, 0.0909, 176, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "add_option", "arg_names": [], "import_names": [], "rhs_call_name": "add_option", "annotation": ""}, "snippet": " parser.add_option('--clean', dest='build_clean',\n action='store_true', default=False,\n help='Clean the build directories.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99755:Assign_L211_C2", "label": "options, _ = parse_args()", "type": "assigned_variable", "loc": [211, 211], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99755:FunctionDef_L205_C0", "vector": [14, 1, 0.7617, 0.0036, 1, 0.71, 0.1364, 735, 3, 0, 0, 0, 187, 10, 1], "semantic": {"name": "options, _", "arg_names": [], "import_names": [], "rhs_call_name": "parse_args", "annotation": ""}, "snippet": " (options, _) = parser.parse_args()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99755:If_L213_C2", "label": "if", "type": "if", "loc": [213, 215], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99755:FunctionDef_L205_C0", "vector": [4, 1, 0.7726, 0.0108, 1, 0.71, 0.1818, 0, 7, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if options.build_clean:\n Clean()\n exit()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99755:Expr_L214_C4", "label": "Clean()", "type": "expression", "loc": [214, 214], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99755:If_L213_C2", "vector": [8, 2, 0.7726, 0.0036, 2, 0.1, 0.0, 416, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "Clean", "arg_names": [], "import_names": [], "rhs_call_name": "Clean", "annotation": ""}, "snippet": " Clean()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99755:Expr_L215_C4", "label": "exit()", "type": "expression", "loc": [215, 215], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99755:If_L213_C2", "vector": [8, 2, 0.7762, 0.0036, 2, 0.1, 1.0, 436, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "exit", "arg_names": [], "import_names": [], "rhs_call_name": "exit", "annotation": ""}, "snippet": " exit()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99755:If_L218_C2", "label": "if", "type": "if", "loc": [218, 219], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99755:FunctionDef_L205_C0", "vector": [4, 1, 0.7888, 0.0072, 1, 0.71, 0.2273, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not os.path.exists('build'):\n os.mkdir('build')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99755:Expr_L219_C4", "label": "mkdir()", "type": "expression", "loc": [219, 219], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99755:If_L218_C2", "vector": [8, 2, 0.7906, 0.0036, 2, 0.12, 0.0, 853, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "mkdir", "arg_names": [], "import_names": [], "rhs_call_name": "mkdir", "annotation": ""}, "snippet": " os.mkdir('build')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99755:If_L220_C2", "label": "if", "type": "if", "loc": [220, 221], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99755:FunctionDef_L205_C0", "vector": [4, 1, 0.796, 0.0072, 1, 0.71, 0.2727, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not os.path.exists('build/options'):\n os.mkdir('build/options')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99755:Expr_L221_C4", "label": "mkdir()", "type": "expression", "loc": [221, 221], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99755:If_L220_C2", "vector": [8, 2, 0.7978, 0.0036, 2, 0.09, 0.0, 853, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "mkdir", "arg_names": [], "import_names": [], "rhs_call_name": "mkdir", "annotation": ""}, "snippet": " os.mkdir('build/options')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99755:If_L222_C2", "label": "if", "type": "if", "loc": [222, 223], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99755:FunctionDef_L205_C0", "vector": [4, 1, 0.8032, 0.0072, 1, 0.71, 0.3182, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not os.path.exists('build_gen'):\n os.mkdir('build_gen')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99755:Expr_L223_C4", "label": "mkdir()", "type": "expression", "loc": [223, 223], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99755:If_L222_C2", "vector": [8, 2, 0.8051, 0.0036, 2, 0.81, 0.0, 853, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "mkdir", "arg_names": [], "import_names": [], "rhs_call_name": "mkdir", "annotation": ""}, "snippet": " os.mkdir('build_gen')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99755:Expr_L226_C2", "label": "SetupClosure()", "type": "expression", "loc": [226, 226], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99755:FunctionDef_L205_C0", "vector": [8, 1, 0.8159, 0.0036, 1, 0.71, 0.3636, 844, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "SetupClosure", "arg_names": [], "import_names": [], "rhs_call_name": "SetupClosure", "annotation": ""}, "snippet": " SetupClosure()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99755:Expr_L227_C2", "label": "SetupSelenium()", "type": "expression", "loc": [227, 227], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99755:FunctionDef_L205_C0", "vector": [8, 1, 0.8195, 0.0036, 1, 0.71, 0.4091, 313, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "SetupSelenium", "arg_names": [], "import_names": [], "rhs_call_name": "SetupSelenium", "annotation": ""}, "snippet": " SetupSelenium()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99755:Expr_L228_C2", "label": "SetupAce()", "type": "expression", "loc": [228, 228], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99755:FunctionDef_L205_C0", "vector": [8, 1, 0.8231, 0.0036, 1, 0.71, 0.4545, 254, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "SetupAce", "arg_names": [], "import_names": [], "rhs_call_name": "SetupAce", "annotation": ""}, "snippet": " SetupAce()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99755:Assign_L231_C2", "label": "soy_files =", "type": "assigned_variable", "loc": [231, 237], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99755:FunctionDef_L205_C0", "vector": [14, 1, 0.8448, 0.0253, 1, 0.71, 0.5, 888, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "soy_files", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " soy_files = ['consoles.soy',\n 'rpfconsole.soy',\n 'rpf_dialogs.soy',\n 'locatorsupdater.soy',\n 'newbug_console.soy',\n 'newbug_type_selector.soy',\n 'popup.soy']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99755:For_L239_C2", "label": "for soy_filename", "type": "for", "loc": [239, 240], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99755:FunctionDef_L205_C0", "vector": [6, 1, 0.8646, 0.0072, 1, 0.71, 0.5455, 459, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "soy_filename", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for soy_filename in soy_files:\n BuildSoyJs(os.path.join('src', soy_filename))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99755:Expr_L240_C4", "label": "BuildSoyJs()", "type": "expression", "loc": [240, 240], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99755:For_L239_C2", "vector": [8, 2, 0.8664, 0.0036, 2, 0.7, 0.0, 853, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "BuildSoyJs", "arg_names": [], "import_names": [], "rhs_call_name": "BuildSoyJs", "annotation": ""}, "snippet": " BuildSoyJs(os.path.join('src', soy_filename))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99755:Assign_L242_C2", "label": "js_targets =", "type": "assigned_variable", "loc": [242, 248], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99755:FunctionDef_L205_C0", "vector": [14, 1, 0.8845, 0.0253, 1, 0.71, 0.5909, 208, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "js_targets", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " js_targets = {'background.js': 'background_script.js',\n 'content.js': 'content_script.js',\n 'getactioninfo.js': 'getactioninfo_script.js',\n 'console.js': 'console_script.js',\n 'elementhelper.js': 'elementhelper_script.js',\n 'popup.js': 'popup_script.js',\n 'options/page.js': 'options_script.js'}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99755:For_L250_C2", "label": "for target", "type": "for", "loc": [250, 252], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99755:FunctionDef_L205_C0", "vector": [6, 1, 0.9061, 0.0108, 1, 0.71, 0.6364, 766, 2, 0, 0, 0, 0, 0, 3], "semantic": {"name": "target", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for target in js_targets:\n BuildClosureScript(os.path.join('src', target),\n os.path.join('build', js_targets[target]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99755:Expr_L251_C4", "label": "BuildClosureScript()", "type": "expression", "loc": [251, 252], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99755:For_L250_C2", "vector": [8, 2, 0.9079, 0.0072, 2, 0.08, 0.0, 257, 3, 2, 0, 0, 0, 0, 3], "semantic": {"name": "BuildClosureScript", "arg_names": [], "import_names": [], "rhs_call_name": "BuildClosureScript", "annotation": ""}, "snippet": " BuildClosureScript(os.path.join('src', target),\n os.path.join('build', js_targets[target]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99755:If_L255_C2", "label": "if", "type": "if", "loc": [255, 256], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99755:FunctionDef_L205_C0", "vector": [4, 1, 0.9224, 0.0072, 1, 0.71, 0.6818, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if os.path.exists('build/styles'):\n shutil.rmtree('build/styles')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99755:Expr_L256_C4", "label": "rmtree()", "type": "expression", "loc": [256, 256], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99755:If_L255_C2", "vector": [8, 2, 0.9242, 0.0036, 2, 0.56, 0.0, 317, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "rmtree", "arg_names": [], "import_names": [], "rhs_call_name": "rmtree", "annotation": ""}, "snippet": " shutil.rmtree('build/styles')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99755:Expr_L257_C2", "label": "copytree()", "type": "expression", "loc": [257, 257], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99755:FunctionDef_L205_C0", "vector": [8, 1, 0.9278, 0.0036, 1, 0.71, 0.7273, 739, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "copytree", "arg_names": [], "import_names": [], "rhs_call_name": "copytree", "annotation": ""}, "snippet": " shutil.copytree('src/styles', 'build/styles')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99755:If_L258_C2", "label": "if", "type": "if", "loc": [258, 259], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99755:FunctionDef_L205_C0", "vector": [4, 1, 0.9332, 0.0072, 1, 0.71, 0.7727, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if os.path.exists('build/imgs'):\n shutil.rmtree('build/imgs')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99755:Expr_L259_C4", "label": "rmtree()", "type": "expression", "loc": [259, 259], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99755:If_L258_C2", "vector": [8, 2, 0.935, 0.0036, 2, 0.82, 0.0, 317, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "rmtree", "arg_names": [], "import_names": [], "rhs_call_name": "rmtree", "annotation": ""}, "snippet": " shutil.rmtree('build/imgs')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99755:Expr_L260_C2", "label": "copytree()", "type": "expression", "loc": [260, 260], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99755:FunctionDef_L205_C0", "vector": [8, 1, 0.9386, 0.0036, 1, 0.71, 0.8182, 739, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "copytree", "arg_names": [], "import_names": [], "rhs_call_name": "copytree", "annotation": ""}, "snippet": " shutil.copytree('src/imgs', 'build/imgs')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99755:Assign_L261_C2", "label": "static_files =", "type": "assigned_variable", "loc": [261, 265], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99755:FunctionDef_L205_C0", "vector": [14, 1, 0.9495, 0.0181, 1, 0.71, 0.8636, 748, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "static_files", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " static_files = ['src/background.html',\n 'src/console.html',\n 'src/options/options.html',\n 'src/popup.html',\n 'manifest.json']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99755:For_L266_C2", "label": "for static_file", "type": "for", "loc": [266, 267], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99755:FunctionDef_L205_C0", "vector": [6, 1, 0.9621, 0.0072, 1, 0.71, 0.9091, 76, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "static_file", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for static_file in static_files:\n shutil.copy(static_file, 'build')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99755:Expr_L267_C4", "label": "copy()", "type": "expression", "loc": [267, 267], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99755:For_L266_C2", "vector": [8, 2, 0.9639, 0.0036, 2, 0.24, 0.0, 739, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "copy", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " shutil.copy(static_file, 'build')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99755:If_L270_C2", "label": "if", "type": "if", "loc": [270, 271], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99755:FunctionDef_L205_C0", "vector": [4, 1, 0.9765, 0.0072, 1, 0.71, 0.9545, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if os.path.exists('build/ace'):\n shutil.rmtree('build/ace')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99755:Expr_L271_C4", "label": "rmtree()", "type": "expression", "loc": [271, 271], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99755:If_L270_C2", "vector": [8, 2, 0.9783, 0.0036, 2, 0.86, 0.0, 317, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "rmtree", "arg_names": [], "import_names": [], "rhs_call_name": "rmtree", "annotation": ""}, "snippet": " shutil.rmtree('build/ace')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99755:Expr_L272_C2", "label": "copytree()", "type": "expression", "loc": [272, 272], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99755:FunctionDef_L205_C0", "vector": [8, 1, 0.9819, 0.0036, 1, 0.71, 1.0, 739, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "copytree", "arg_names": [], "import_names": [], "rhs_call_name": "copytree", "annotation": ""}, "snippet": " shutil.copytree('ace/build/src', 'build/ace')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99755:If_L275_C0", "label": "if", "type": "if", "loc": [275, 276], "level": 0, "parent": null, "vector": [4, 0, 0.9946, 0.0072, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == '__main__':\n main()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99755:Expr_L276_C2", "label": "main()", "type": "expression", "loc": [276, 276], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99755:If_L275_C0", "vector": [8, 1, 0.9964, 0.0036, 1, 0.53, 0.0, 624, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "main", "arg_names": [], "import_names": [], "rhs_call_name": "main", "annotation": ""}, "snippet": " main()"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99755:FunctionDef_L60_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99755:Expr_L61_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99755:FunctionDef_L60_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99755:Assign_L71_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99755:FunctionDef_L60_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99755:If_L76_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99755:FunctionDef_L80_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99755:Expr_L81_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99755:FunctionDef_L80_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99755:Assign_L90_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99755:FunctionDef_L80_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99755:Assign_L91_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99755:FunctionDef_L80_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99755:If_L95_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99755:FunctionDef_L99_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99755:If_L100_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99755:If_L100_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99755:Expr_L101_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99755:FunctionDef_L99_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99755:If_L102_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99755:If_L102_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99755:Expr_L103_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99755:FunctionDef_L106_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99755:Expr_L107_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99755:FunctionDef_L106_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99755:Expr_L115_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99755:FunctionDef_L106_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99755:Assign_L116_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99755:FunctionDef_L106_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99755:Assign_L119_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99755:FunctionDef_L106_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99755:If_L120_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99755:If_L120_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99755:Expr_L121_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99755:FunctionDef_L106_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99755:Return_L122_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99755:FunctionDef_L125_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99755:Expr_L126_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99755:FunctionDef_L125_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99755:If_L134_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99755:If_L134_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99755:Expr_L135_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99755:If_L134_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99755:If_L136_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99755:If_L136_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99755:Expr_L137_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99755:FunctionDef_L141_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99755:Expr_L142_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99755:FunctionDef_L141_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99755:If_L151_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99755:If_L151_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99755:Expr_L152_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99755:If_L151_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99755:If_L153_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99755:If_L153_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99755:Expr_L154_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99755:FunctionDef_L141_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99755:If_L160_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99755:If_L160_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99755:Assign_L161_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99755:If_L160_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99755:Assign_L162_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99755:If_L160_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99755:Expr_L163_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99755:If_L160_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99755:If_L164_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99755:If_L164_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99755:Expr_L165_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99755:FunctionDef_L141_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99755:If_L169_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99755:If_L169_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99755:Assign_L171_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99755:If_L169_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99755:Assign_L172_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99755:If_L169_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99755:Expr_L173_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99755:If_L169_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99755:Expr_L174_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99755:If_L169_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99755:If_L175_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99755:If_L175_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99755:Expr_L177_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99755:FunctionDef_L141_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99755:If_L182_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99755:If_L182_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99755:Expr_L183_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99755:If_L182_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99755:If_L184_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99755:If_L184_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99755:Expr_L185_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99755:FunctionDef_L189_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99755:Expr_L190_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99755:FunctionDef_L189_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99755:If_L198_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99755:If_L198_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99755:Expr_L199_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99755:If_L198_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99755:If_L200_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99755:If_L200_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99755:Expr_L201_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99755:FunctionDef_L205_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99755:Assign_L206_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99755:FunctionDef_L205_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99755:Assign_L207_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99755:FunctionDef_L205_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99755:Expr_L208_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99755:FunctionDef_L205_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99755:Assign_L211_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99755:FunctionDef_L205_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99755:If_L213_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99755:If_L213_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99755:Expr_L214_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99755:If_L213_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99755:Expr_L215_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99755:FunctionDef_L205_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99755:If_L218_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99755:If_L218_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99755:Expr_L219_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99755:FunctionDef_L205_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99755:If_L220_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99755:If_L220_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99755:Expr_L221_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99755:FunctionDef_L205_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99755:If_L222_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99755:If_L222_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99755:Expr_L223_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99755:FunctionDef_L205_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99755:Expr_L226_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99755:FunctionDef_L205_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99755:Expr_L227_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99755:FunctionDef_L205_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99755:Expr_L228_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99755:FunctionDef_L205_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99755:Assign_L231_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99755:FunctionDef_L205_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99755:For_L239_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99755:For_L239_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99755:Expr_L240_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99755:FunctionDef_L205_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99755:Assign_L242_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99755:FunctionDef_L205_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99755:For_L250_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99755:For_L250_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99755:Expr_L251_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99755:FunctionDef_L205_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99755:If_L255_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99755:If_L255_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99755:Expr_L256_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99755:FunctionDef_L205_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99755:Expr_L257_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99755:FunctionDef_L205_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99755:If_L258_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99755:If_L258_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99755:Expr_L259_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99755:FunctionDef_L205_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99755:Expr_L260_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99755:FunctionDef_L205_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99755:Assign_L261_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99755:FunctionDef_L205_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99755:For_L266_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99755:For_L266_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99755:Expr_L267_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99755:FunctionDef_L205_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99755:If_L270_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99755:If_L270_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99755:Expr_L271_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99755:FunctionDef_L205_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99755:Expr_L272_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99755:If_L275_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99755:Expr_L276_C2"}] |
#====================================================================
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
# ====================================================================
#
# This software consists of voluntary contributions made by many
# individuals on behalf of the Apache Software Foundation. For more
# information on the Apache Software Foundation, please see
# <http://www.apache.org/>.
#
import os
import re
import tempfile
import shutil
ignore_pattern = re.compile('^(.svn|target|bin|classes)')
java_pattern = re.compile('^.*\.java')
annot_pattern = re.compile('import org\.apache\.http\.annotation\.')
def process_dir(dir):
files = os.listdir(dir)
for file in files:
f = os.path.join(dir, file)
if os.path.isdir(f):
if not ignore_pattern.match(file):
process_dir(f)
else:
if java_pattern.match(file):
process_source(f)
def process_source(filename):
tmp = tempfile.mkstemp()
tmpfd = tmp[0]
tmpfile = tmp[1]
try:
changed = False
dst = os.fdopen(tmpfd, 'w')
try:
src = open(filename)
try:
for line in src:
if annot_pattern.match(line):
changed = True
line = line.replace('import org.apache.http.annotation.', 'import net.jcip.annotations.')
dst.write(line)
finally:
src.close()
finally:
dst.close();
if changed:
shutil.move(tmpfile, filename)
else:
os.remove(tmpfile)
except:
os.remove(tmpfile)
process_dir('.')
| ajibawa-2023/Python-Code-Large/train/row_99756 | 38 | 74 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99756:Import_L26_C0", "label": "os import os", "type": "import", "loc": [26, 26], "level": 0, "parent": null, "vector": [1, 0, 0.3514, 0.0135, 0, 0.66, 0.0, 688, 0, 1, 0, 0, 688, 0, 0], "semantic": {"name": "os", "arg_names": [], "import_names": ["os"], "rhs_call_name": "", "annotation": ""}, "snippet": "import os"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99756:Import_L27_C0", "label": "re import re", "type": "import", "loc": [27, 27], "level": 0, "parent": null, "vector": [1, 0, 0.3649, 0.0135, 0, 0.66, 0.1111, 540, 0, 1, 0, 0, 540, 0, 0], "semantic": {"name": "re", "arg_names": [], "import_names": ["re"], "rhs_call_name": "", "annotation": ""}, "snippet": "import re"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99756:Import_L28_C0", "label": "tempfile import tempfile", "type": "import", "loc": [28, 28], "level": 0, "parent": null, "vector": [1, 0, 0.3784, 0.0135, 0, 0.66, 0.2222, 516, 0, 1, 0, 0, 516, 0, 0], "semantic": {"name": "tempfile", "arg_names": [], "import_names": ["tempfile"], "rhs_call_name": "", "annotation": ""}, "snippet": "import tempfile"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99756:Import_L29_C0", "label": "shutil import shutil", "type": "import", "loc": [29, 29], "level": 0, "parent": null, "vector": [1, 0, 0.3919, 0.0135, 0, 0.66, 0.3333, 614, 0, 1, 0, 0, 614, 0, 0], "semantic": {"name": "shutil", "arg_names": [], "import_names": ["shutil"], "rhs_call_name": "", "annotation": ""}, "snippet": "import shutil"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99756:Assign_L31_C0", "label": "ignore_pattern = compile()", "type": "assigned_variable", "loc": [31, 31], "level": 0, "parent": null, "vector": [14, 0, 0.4189, 0.0135, 0, 0.66, 0.4444, 989, 3, 1, 0, 0, 821, 10, 1], "semantic": {"name": "ignore_pattern", "arg_names": [], "import_names": [], "rhs_call_name": "compile", "annotation": ""}, "snippet": "ignore_pattern = re.compile('^(.svn|target|bin|classes)')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99756:Assign_L32_C0", "label": "java_pattern = compile()", "type": "assigned_variable", "loc": [32, 32], "level": 0, "parent": null, "vector": [14, 0, 0.4324, 0.0135, 0, 0.66, 0.5556, 579, 3, 1, 0, 0, 821, 10, 1], "semantic": {"name": "java_pattern", "arg_names": [], "import_names": [], "rhs_call_name": "compile", "annotation": ""}, "snippet": "java_pattern = re.compile('^.*\\.java')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99756:Assign_L33_C0", "label": "annot_pattern = compile()", "type": "assigned_variable", "loc": [33, 33], "level": 0, "parent": null, "vector": [14, 0, 0.4459, 0.0135, 0, 0.66, 0.6667, 164, 3, 1, 0, 0, 821, 10, 1], "semantic": {"name": "annot_pattern", "arg_names": [], "import_names": [], "rhs_call_name": "compile", "annotation": ""}, "snippet": "annot_pattern = re.compile('import org\\.apache\\.http\\.annotation\\.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99756:FunctionDef_L35_C0", "label": "process_dir", "type": "function", "loc": [35, 44], "level": 0, "parent": null, "vector": [2, 0, 0.5338, 0.1351, 0, 0.66, 0.7778, 660, 0, 1, 0, 0, 0, 0, 7], "semantic": {"name": "process_dir", "arg_names": ["dir"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def process_dir(dir):\n files = os.listdir(dir)\n for file in files:\n f = os.path.join(dir, file)\n if os.path.isdir(f):\n if not ignore_pattern.match(file):\n process_dir(f)\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99756:Assign_L36_C4", "label": "files = listdir()", "type": "assigned_variable", "loc": [36, 36], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99756:FunctionDef_L35_C0", "vector": [14, 1, 0.4865, 0.0135, 1, 0.29, 0.0, 598, 3, 1, 0, 0, 551, 10, 1], "semantic": {"name": "files", "arg_names": [], "import_names": [], "rhs_call_name": "listdir", "annotation": ""}, "snippet": " files = os.listdir(dir)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99756:For_L37_C4", "label": "for file", "type": "for", "loc": [37, 44], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99756:FunctionDef_L35_C0", "vector": [6, 1, 0.5473, 0.1081, 1, 0.29, 1.0, 107, 2, 0, 0, 0, 0, 0, 6], "semantic": {"name": "file", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for file in files:\n f = os.path.join(dir, file)\n if os.path.isdir(f):\n if not ignore_pattern.match(file):\n process_dir(f)\n else:\n if java_pattern.match(file):\n process_source(f)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99756:Assign_L38_C8", "label": "f = join()", "type": "assigned_variable", "loc": [38, 38], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99756:For_L37_C4", "vector": [14, 2, 0.5135, 0.0135, 2, 0.37, 0.0, 899, 3, 2, 0, 0, 933, 10, 1], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": " f = os.path.join(dir, file)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99756:If_L39_C8", "label": "if", "type": "if", "loc": [39, 44], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99756:For_L37_C4", "vector": [4, 2, 0.5608, 0.0811, 2, 0.37, 1.0, 0, 3, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if os.path.isdir(f):\n if not ignore_pattern.match(file):\n process_dir(f)\n else:\n if java_pattern.match(file):\n process_source(f)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99756:If_L40_C12", "label": "if", "type": "if", "loc": [40, 41], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99756:If_L39_C8", "vector": [4, 3, 0.5473, 0.027, 3, 0.36, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not ignore_pattern.match(file):\n process_dir(f)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99756:Expr_L41_C16", "label": "process_dir()", "type": "expression", "loc": [41, 41], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99756:If_L40_C12", "vector": [8, 4, 0.5541, 0.0135, 4, 0.93, 0.0, 660, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "process_dir", "arg_names": [], "import_names": [], "rhs_call_name": "process_dir", "annotation": ""}, "snippet": " process_dir(f)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99756:If_L43_C12", "label": "if", "type": "if", "loc": [43, 44], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99756:If_L39_C8", "vector": [4, 3, 0.5878, 0.027, 3, 0.36, 1.0, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if java_pattern.match(file):\n process_source(f)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99756:Expr_L44_C16", "label": "process_source()", "type": "expression", "loc": [44, 44], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99756:If_L43_C12", "vector": [8, 4, 0.5946, 0.0135, 4, 0.42, 0.0, 173, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "process_source", "arg_names": [], "import_names": [], "rhs_call_name": "process_source", "annotation": ""}, "snippet": " process_source(f)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99756:FunctionDef_L46_C0", "label": "process_source", "type": "function", "loc": [46, 72], "level": 0, "parent": null, "vector": [2, 0, 0.7973, 0.3649, 0, 0.66, 0.8889, 173, 0, 1, 0, 0, 0, 0, 11], "semantic": {"name": "process_source", "arg_names": ["filename"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def process_source(filename):\n tmp = tempfile.mkstemp()\n tmpfd = tmp[0]\n tmpfile = tmp[1]\n try:\n changed = False\n dst = os.fdopen(tmpfd, 'w')\n try:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99756:Assign_L47_C4", "label": "tmp = mkstemp()", "type": "assigned_variable", "loc": [47, 47], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99756:FunctionDef_L46_C0", "vector": [14, 1, 0.6351, 0.0135, 1, 0.8, 0.0, 517, 3, 0, 0, 0, 708, 10, 1], "semantic": {"name": "tmp", "arg_names": [], "import_names": [], "rhs_call_name": "mkstemp", "annotation": ""}, "snippet": " tmp = tempfile.mkstemp()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99756:Assign_L48_C4", "label": "tmpfd =", "type": "assigned_variable", "loc": [48, 48], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99756:FunctionDef_L46_C0", "vector": [14, 1, 0.6486, 0.0135, 1, 0.8, 0.3333, 608, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "tmpfd", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tmpfd = tmp[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99756:Assign_L49_C4", "label": "tmpfile =", "type": "assigned_variable", "loc": [49, 49], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99756:FunctionDef_L46_C0", "vector": [14, 1, 0.6622, 0.0135, 1, 0.8, 0.6667, 719, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "tmpfile", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tmpfile = tmp[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99756:Try_L50_C4", "label": "try", "type": "try", "loc": [50, 72], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99756:FunctionDef_L46_C0", "vector": [7, 1, 0.8243, 0.3108, 1, 0.8, 1.0, 0, 0, 1, 0, 0, 0, 0, 10], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n changed = False\n dst = os.fdopen(tmpfd, 'w')\n try:\n src = open(filename)\n try:\n for line in src:\n if annot_pattern.match(line):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99756:Assign_L51_C8", "label": "changed =", "type": "assigned_variable", "loc": [51, 51], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99756:Try_L50_C4", "vector": [14, 2, 0.6892, 0.0135, 2, 0.84, 0.0, 404, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "changed", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " changed = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99756:Assign_L52_C8", "label": "dst = fdopen()", "type": "assigned_variable", "loc": [52, 52], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99756:Try_L50_C4", "vector": [14, 2, 0.7027, 0.0135, 2, 0.84, 0.3333, 856, 3, 2, 0, 0, 783, 10, 1], "semantic": {"name": "dst", "arg_names": [], "import_names": [], "rhs_call_name": "fdopen", "annotation": ""}, "snippet": " dst = os.fdopen(tmpfd, 'w')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99756:Try_L53_C8", "label": "try", "type": "try", "loc": [53, 64], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99756:Try_L50_C4", "vector": [7, 2, 0.7905, 0.1622, 2, 0.84, 0.6667, 0, 0, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n src = open(filename)\n try:\n for line in src:\n if annot_pattern.match(line):\n changed = True\n line = line.replace('import org.apache.http.annotation.', 'import net.jcip.annotations.')\n dst.write(line)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99756:Assign_L54_C12", "label": "src = open()", "type": "assigned_variable", "loc": [54, 54], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99756:Try_L53_C8", "vector": [14, 3, 0.7297, 0.0135, 3, 0.7, 0.0, 345, 3, 1, 0, 0, 693, 10, 1], "semantic": {"name": "src", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": " src = open(filename)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99756:Try_L55_C12", "label": "try", "type": "try", "loc": [55, 62], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99756:Try_L53_C8", "vector": [7, 3, 0.7905, 0.1081, 3, 0.7, 0.5, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n for line in src:\n if annot_pattern.match(line):\n changed = True\n line = line.replace('import org.apache.http.annotation.', 'import net.jcip.annotations.')\n dst.write(line)\n finally:\n src.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99756:For_L56_C16", "label": "for line", "type": "for", "loc": [56, 60], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99756:Try_L55_C12", "vector": [6, 4, 0.7838, 0.0676, 4, 0.65, 0.0, 373, 2, 0, 0, 0, 0, 0, 3], "semantic": {"name": "line", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for line in src:\n if annot_pattern.match(line):\n changed = True\n line = line.replace('import org.apache.http.annotation.', 'import net.jcip.annotations.')\n dst.write(line)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99756:If_L57_C20", "label": "if", "type": "if", "loc": [57, 59], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99756:For_L56_C16", "vector": [4, 5, 0.7838, 0.0405, 5, 0.59, 0.0, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if annot_pattern.match(line):\n changed = True\n line = line.replace('import org.apache.http.annotation.', 'import net.jcip.annotations.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99756:Assign_L58_C24", "label": "changed =", "type": "assigned_variable", "loc": [58, 58], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99756:If_L57_C20", "vector": [14, 6, 0.7838, 0.0135, 6, 0.7, 0.0, 404, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "changed", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " changed = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99756:Assign_L59_C24", "label": "line = replace()", "type": "assigned_variable", "loc": [59, 59], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99756:If_L57_C20", "vector": [14, 6, 0.7973, 0.0135, 6, 0.7, 1.0, 373, 3, 2, 0, 0, 293, 10, 1], "semantic": {"name": "line", "arg_names": [], "import_names": [], "rhs_call_name": "replace", "annotation": ""}, "snippet": " line = line.replace('import org.apache.http.annotation.', 'import net.jcip.annotations.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99756:Expr_L60_C20", "label": "write()", "type": "expression", "loc": [60, 60], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99756:For_L56_C16", "vector": [8, 5, 0.8108, 0.0135, 5, 0.59, 1.0, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " dst.write(line)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99756:Expr_L62_C15", "label": "close()", "type": "expression", "loc": [62, 62], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99756:Try_L55_C12", "vector": [8, 4, 0.8378, 0.0135, 4, 0.65, 1.0, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": " src.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99756:Expr_L64_C12", "label": "close()", "type": "expression", "loc": [64, 64], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99756:Try_L53_C8", "vector": [8, 3, 0.8649, 0.0135, 3, 0.7, 1.0, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": " dst.close();"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99756:If_L66_C8", "label": "if", "type": "if", "loc": [66, 69], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99756:Try_L50_C4", "vector": [4, 2, 0.9122, 0.0541, 2, 0.84, 1.0, 0, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if changed:\n shutil.move(tmpfile, filename)\n else:\n os.remove(tmpfile)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99756:Expr_L67_C12", "label": "move()", "type": "expression", "loc": [67, 67], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99756:If_L66_C8", "vector": [8, 3, 0.9054, 0.0135, 3, 0.22, 0.0, 856, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "move", "arg_names": [], "import_names": [], "rhs_call_name": "move", "annotation": ""}, "snippet": " shutil.move(tmpfile, filename)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99756:Expr_L69_C12", "label": "remove()", "type": "expression", "loc": [69, 69], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99756:If_L66_C8", "vector": [8, 3, 0.9324, 0.0135, 3, 0.22, 1.0, 185, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "remove", "arg_names": [], "import_names": [], "rhs_call_name": "remove", "annotation": ""}, "snippet": " os.remove(tmpfile)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99756:Expr_L72_C8", "label": "remove()", "type": "expression", "loc": [72, 72], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99756:Try_L50_C4", "vector": [8, 2, 0.973, 0.0135, 2, 0.84, 0.0, 185, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "remove", "arg_names": [], "import_names": [], "rhs_call_name": "remove", "annotation": ""}, "snippet": " os.remove(tmpfile)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99756:Expr_L74_C0", "label": "process_dir()", "type": "expression", "loc": [74, 74], "level": 0, "parent": null, "vector": [8, 0, 1.0, 0.0135, 0, 0.66, 1.0, 660, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "process_dir", "arg_names": [], "import_names": [], "rhs_call_name": "process_dir", "annotation": ""}, "snippet": "process_dir('.')"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99756:FunctionDef_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99756:Assign_L36_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99756:FunctionDef_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99756:For_L37_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99756:For_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99756:Assign_L38_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99756:For_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99756:If_L39_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99756:If_L39_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99756:If_L40_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99756:If_L40_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99756:Expr_L41_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99756:If_L39_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99756:If_L43_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99756:If_L43_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99756:Expr_L44_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99756:FunctionDef_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99756:Assign_L47_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99756:FunctionDef_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99756:Assign_L48_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99756:FunctionDef_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99756:Assign_L49_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99756:FunctionDef_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99756:Try_L50_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99756:Try_L50_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99756:Assign_L51_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99756:Try_L50_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99756:Assign_L52_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99756:Try_L50_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99756:Try_L53_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99756:Try_L53_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99756:Assign_L54_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99756:Try_L53_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99756:Try_L55_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99756:Try_L55_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99756:For_L56_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99756:For_L56_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99756:If_L57_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99756:If_L57_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99756:Assign_L58_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99756:If_L57_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99756:Assign_L59_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99756:For_L56_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99756:Expr_L60_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99756:Try_L55_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99756:Expr_L62_C15"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99756:Try_L53_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99756:Expr_L64_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99756:Try_L50_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99756:If_L66_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99756:If_L66_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99756:Expr_L67_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99756:If_L66_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99756:Expr_L69_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99756:Try_L50_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99756:Expr_L72_C8"}] |
#!/usr/bin/python2.6
#
# Copyright 2011 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Build the BITE Extension."""
__author__ = 'ralphj@google.com (Julie Ralph)'
import logging
import optparse
import os
import shutil
import subprocess
import urllib
import zipfile
CHECKOUT_ACE_COMMAND = ('git clone git://github.com/ajaxorg/ace.git')
CHECKOUT_CLOSURE_COMMAND = ('svn checkout http://closure-library.googlecode.com'
'/svn/trunk/ closure-library')
CHECKOUT_SELENIUM_COMMAND = ('svn checkout http://selenium.googlecode.com'
'/svn/trunk/javascript/atoms selenium-atoms-lib')
CLOSURE_COMPILER_URL = ('http://closure-compiler.googlecode.com/files/'
'compiler-latest.zip')
SOY_COMPILER_URL = ('http://closure-templates.googlecode.com/files/'
'closure-templates-for-javascript-latest.zip')
SOYDATA_URL = ('http://closure-templates.googlecode.com/svn/trunk/javascript/'
'soydata.js')
COMPILE_CLOSURE_COMMAND = ('closure-library/closure/bin/build/closurebuilder.py'
' --root=src'
' --root=closure-library'
' --root=build_gen'
' --root=selenium-atoms-lib'
' --input=%(input)s'
' --output_mode=compiled'
' --output_file=%(output)s'
' --compiler_jar=compiler.jar')
SOY_COMPILER_COMMAND = ('java -jar SoyToJsSrcCompiler.jar'
' --shouldProvideRequireSoyNamespaces'
' --outputPathFormat %(output)s'
' %(file)s')
class ClosureError(Exception):
pass
def BuildClosureScript(input_filename, output_filename):
"""Build a compiled closure script based on the given input file.
Args:
input_filename: A string representing the name of the input script to
compile
output_filename: A string representing the name of the output script.
Raises:
ClosureError: If closure fails to compile the given input file.
"""
result = ExecuteCommand(
COMPILE_CLOSURE_COMMAND % {
'input': input_filename,
'output': output_filename})
if result or not os.path.exists(output_filename):
raise ClosureError('Failed while compiling %s.' % input_filename)
def BuildSoyJs(input_file):
"""Builds a javascript file from a soy file.
Args:
input_file: A path to the soy file to compile into JavaScript. The js file
will be stored in build_gen/{FILENAME}.soy.js
Raises:
ClosureError: If the soy compiler fails to compile.
"""
output_name = os.path.join('build_gen', '%s.js' % input_file)
result = ExecuteCommand(
SOY_COMPILER_COMMAND % {
'file': input_file,
'output': output_name})
if result or not os.path.exists(output_name):
raise ClosureError('Failed while compiling the soy file %s.' % input_file)
def Clean():
if os.path.exists('clean'):
shutil.rmtree('build')
if os.path.exists('build_gen'):
shutil.rmtree('build_gen')
def ExecuteCommand(command):
"""Execute the given command and return the output.
Args:
command: A string representing the command to execute.
Returns:
The return code of the process.
"""
print 'Running command: %s' % command
process = subprocess.Popen(command.split(' '),
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
results = process.communicate()
if process.returncode:
logging.error(results[1])
return process.returncode
def SetupAce():
"""Setup the Ace library.
Checkout the Ace library using git.
Raises:
ClosureError: If the setup fails.
"""
if not os.path.exists('ace'):
ExecuteCommand(CHECKOUT_ACE_COMMAND)
if not os.path.exists('ace'):
logging.error('Could not checkout ACE from github.')
raise ClosureError('Could not set up ACE.')
def SetupClosure():
"""Setup the closure library and compiler.
Checkout the closure library using svn if it doesn't exist. Also, download
the closure compiler.
Raises:
ClosureError: If the setup fails.
"""
# Set up the svn repo for closure if it doesn't exist.
if not os.path.exists('closure-library'):
ExecuteCommand(CHECKOUT_CLOSURE_COMMAND)
if not os.path.exists('closure-library'):
logging.error(('Could not check out the closure library from svn. '
'Please check out the closure library to the '
'"closure-library" directory.'))
raise ClosureError('Could not set up the closure library.')
# Download the compiler jar if it doesn't exist.
if not os.path.exists('compiler.jar'):
(compiler_zip, _) = urllib.urlretrieve(CLOSURE_COMPILER_URL)
compiler_zipfile = zipfile.ZipFile(compiler_zip)
compiler_zipfile.extract('compiler.jar')
if not os.path.exists('compiler.jar'):
logging.error('Could not download the closure compiler jar.')
raise ClosureError('Could not find the closure compiler.')
# Download the soy compiler jar if it doesn't exist.
if (not os.path.exists('SoyToJsSrcCompiler.jar') or
not os.path.exists('build_gen/soyutils_usegoog.js')):
(soy_compiler_zip, _) = urllib.urlretrieve(SOY_COMPILER_URL)
soy_compiler_zipfile = zipfile.ZipFile(soy_compiler_zip)
soy_compiler_zipfile.extract('SoyToJsSrcCompiler.jar')
soy_compiler_zipfile.extract('soyutils_usegoog.js', 'build_gen')
if (not os.path.exists('SoyToJsSrcCompiler.jar') or
not os.path.exists('build_gen/soyutils_usegoog.js')):
logging.error('Could not download the soy compiler jar.')
raise ClosureError('Could not find the soy compiler.')
# Download required soydata file, which is required for soyutils_usegoog.js
# to work.
if not os.path.exists('build_gen/soydata.js'):
urllib.urlretrieve(SOYDATA_URL, 'build_gen/soydata.js')
if not os.path.exists('build_gen/soydata.js'):
logging.error('Could not download soydata.js.')
raise ClosureError('Could not fine soydata.js')
def SetupSelenium():
"""Setup the selenium library.
Checkout necessary files from the selenium library using svn, if they
don't exist.
Raises:
ClosureError: If the setup fails.
"""
if not os.path.exists('selenium-atoms-lib/bot.js'):
ExecuteCommand(CHECKOUT_SELENIUM_COMMAND)
if not os.path.exists('selenium-atoms-lib/bot.js'):
logging.error('Could not download the selenium library.')
raise ClosureError('Could not find the selenium library.')
def main():
usage = 'usage: %prog [options]'
parser = optparse.OptionParser(usage)
parser.add_option('--clean', dest='build_clean',
action='store_true', default=False,
help='Clean the build directories.')
(options, _) = parser.parse_args()
if options.build_clean:
Clean()
exit()
# Set up the directories that will be built into.
if not os.path.exists('build'):
os.mkdir('build')
if not os.path.exists('build/options'):
os.mkdir('build/options')
if not os.path.exists('build_gen'):
os.mkdir('build_gen')
# Get external resources.
SetupClosure()
SetupSelenium()
SetupAce()
# Compile the closure scripts.
soy_files = ['consoles.soy',
'rpfconsole.soy',
'rpf_dialogs.soy',
'locatorsupdater.soy',
'newbug_console.soy',
'newbug_type_selector.soy',
'popup.soy']
for soy_filename in soy_files:
BuildSoyJs(os.path.join('src', soy_filename))
js_targets = {'background.js': 'background_script.js',
'content.js': 'content_script.js',
'getactioninfo.js': 'getactioninfo_script.js',
'console.js': 'console_script.js',
'elementhelper.js': 'elementhelper_script.js',
'popup.js': 'popup_script.js',
'options/page.js': 'options_script.js'}
for target in js_targets:
BuildClosureScript(os.path.join('src', target),
os.path.join('build', js_targets[target]))
# Copy over the static resources
if os.path.exists('build/styles'):
shutil.rmtree('build/styles')
shutil.copytree('src/styles', 'build/styles')
if os.path.exists('build/imgs'):
shutil.rmtree('build/imgs')
shutil.copytree('src/imgs', 'build/imgs')
static_files = ['src/background.html',
'src/console.html',
'src/options/options.html',
'src/popup.html',
'manifest.json']
for static_file in static_files:
shutil.copy(static_file, 'build')
# Copy the required ACE files.
if os.path.exists('build/ace'):
shutil.rmtree('build/ace')
shutil.copytree('ace/build/src', 'build/ace')
if __name__ == '__main__':
main()
| ajibawa-2023/Python-Code-Large/train/row_99757 | 112 | 277 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99757:Expr_L18_C0", "label": "expression", "type": "expression", "loc": [18, 18], "level": 0, "parent": null, "vector": [8, 0, 0.065, 0.0036, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\"\"\"Build the BITE Extension.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99757:Assign_L20_C0", "label": "__author__ =", "type": "assigned_variable", "loc": [20, 20], "level": 0, "parent": null, "vector": [14, 0, 0.0722, 0.0036, 0, 0.66, 0.0385, 777, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__author__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "__author__ = 'ralphj@google.com (Julie Ralph)'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99757:Import_L22_C0", "label": "logging import logging", "type": "import", "loc": [22, 22], "level": 0, "parent": null, "vector": [1, 0, 0.0794, 0.0036, 0, 0.66, 0.0769, 715, 0, 1, 0, 0, 715, 0, 0], "semantic": {"name": "logging", "arg_names": [], "import_names": ["logging"], "rhs_call_name": "", "annotation": ""}, "snippet": "import logging"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99757:Import_L23_C0", "label": "optparse import optparse", "type": "import", "loc": [23, 23], "level": 0, "parent": null, "vector": [1, 0, 0.083, 0.0036, 0, 0.66, 0.1154, 323, 0, 1, 0, 0, 323, 0, 0], "semantic": {"name": "optparse", "arg_names": [], "import_names": ["optparse"], "rhs_call_name": "", "annotation": ""}, "snippet": "import optparse"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99757:Import_L24_C0", "label": "os import os", "type": "import", "loc": [24, 24], "level": 0, "parent": null, "vector": [1, 0, 0.0866, 0.0036, 0, 0.66, 0.1538, 688, 0, 1, 0, 0, 688, 0, 0], "semantic": {"name": "os", "arg_names": [], "import_names": ["os"], "rhs_call_name": "", "annotation": ""}, "snippet": "import os"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99757:Import_L25_C0", "label": "shutil import shutil", "type": "import", "loc": [25, 25], "level": 0, "parent": null, "vector": [1, 0, 0.0903, 0.0036, 0, 0.66, 0.1923, 614, 0, 1, 0, 0, 614, 0, 0], "semantic": {"name": "shutil", "arg_names": [], "import_names": ["shutil"], "rhs_call_name": "", "annotation": ""}, "snippet": "import shutil"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99757:Import_L26_C0", "label": "subprocess import subprocess", "type": "import", "loc": [26, 26], "level": 0, "parent": null, "vector": [1, 0, 0.0939, 0.0036, 0, 0.66, 0.2308, 394, 0, 1, 0, 0, 394, 0, 0], "semantic": {"name": "subprocess", "arg_names": [], "import_names": ["subprocess"], "rhs_call_name": "", "annotation": ""}, "snippet": "import subprocess"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99757:Import_L27_C0", "label": "urllib import urllib", "type": "import", "loc": [27, 27], "level": 0, "parent": null, "vector": [1, 0, 0.0975, 0.0036, 0, 0.66, 0.2692, 614, 0, 1, 0, 0, 614, 0, 0], "semantic": {"name": "urllib", "arg_names": [], "import_names": ["urllib"], "rhs_call_name": "", "annotation": ""}, "snippet": "import urllib"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99757:Import_L28_C0", "label": "zipfile import zipfile", "type": "import", "loc": [28, 28], "level": 0, "parent": null, "vector": [1, 0, 0.1011, 0.0036, 0, 0.66, 0.3077, 93, 0, 1, 0, 0, 93, 0, 0], "semantic": {"name": "zipfile", "arg_names": [], "import_names": ["zipfile"], "rhs_call_name": "", "annotation": ""}, "snippet": "import zipfile"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99757:Assign_L30_C0", "label": "CHECKOUT_ACE_COMMAND =", "type": "assigned_variable", "loc": [30, 30], "level": 0, "parent": null, "vector": [14, 0, 0.1083, 0.0036, 0, 0.66, 0.3462, 268, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "CHECKOUT_ACE_COMMAND", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "CHECKOUT_ACE_COMMAND = ('git clone git://github.com/ajaxorg/ace.git')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99757:Assign_L31_C0", "label": "CHECKOUT_CLOSURE_COMMAND =", "type": "assigned_variable", "loc": [31, 32], "level": 0, "parent": null, "vector": [14, 0, 0.1137, 0.0072, 0, 0.66, 0.3846, 505, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "CHECKOUT_CLOSURE_COMMAND", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "CHECKOUT_CLOSURE_COMMAND = ('svn checkout http://closure-library.googlecode.com'\n '/svn/trunk/ closure-library')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99757:Assign_L33_C0", "label": "CHECKOUT_SELENIUM_COMMAND =", "type": "assigned_variable", "loc": [33, 34], "level": 0, "parent": null, "vector": [14, 0, 0.1209, 0.0072, 0, 0.66, 0.4231, 873, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "CHECKOUT_SELENIUM_COMMAND", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "CHECKOUT_SELENIUM_COMMAND = ('svn checkout http://selenium.googlecode.com'\n '/svn/trunk/javascript/atoms selenium-atoms-lib')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99757:Assign_L35_C0", "label": "CLOSURE_COMPILER_URL =", "type": "assigned_variable", "loc": [35, 36], "level": 0, "parent": null, "vector": [14, 0, 0.1282, 0.0072, 0, 0.66, 0.4615, 345, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "CLOSURE_COMPILER_URL", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "CLOSURE_COMPILER_URL = ('http://closure-compiler.googlecode.com/files/'\n 'compiler-latest.zip')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99757:Assign_L37_C0", "label": "SOY_COMPILER_URL =", "type": "assigned_variable", "loc": [37, 38], "level": 0, "parent": null, "vector": [14, 0, 0.1354, 0.0072, 0, 0.66, 0.5, 98, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "SOY_COMPILER_URL", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "SOY_COMPILER_URL = ('http://closure-templates.googlecode.com/files/'\n 'closure-templates-for-javascript-latest.zip')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99757:Assign_L39_C0", "label": "SOYDATA_URL =", "type": "assigned_variable", "loc": [39, 40], "level": 0, "parent": null, "vector": [14, 0, 0.1426, 0.0072, 0, 0.66, 0.5385, 107, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "SOYDATA_URL", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "SOYDATA_URL = ('http://closure-templates.googlecode.com/svn/trunk/javascript/'\n 'soydata.js')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99757:Assign_L41_C0", "label": "COMPILE_CLOSURE_COMMAND =", "type": "assigned_variable", "loc": [41, 49], "level": 0, "parent": null, "vector": [14, 0, 0.1625, 0.0325, 0, 0.66, 0.5769, 644, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "COMPILE_CLOSURE_COMMAND", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "COMPILE_CLOSURE_COMMAND = ('closure-library/closure/bin/build/closurebuilder.py'\n ' --root=src'\n ' --root=closure-library'\n ' --root=build_gen'\n ' --root=selenium-atoms-lib'\n ' --input=%(input)s'\n ' --output_mode=compiled'\n ' --output_file=%(output)s'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99757:Assign_L50_C0", "label": "SOY_COMPILER_COMMAND =", "type": "assigned_variable", "loc": [50, 53], "level": 0, "parent": null, "vector": [14, 0, 0.1859, 0.0144, 0, 0.66, 0.6154, 590, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "SOY_COMPILER_COMMAND", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "SOY_COMPILER_COMMAND = ('java -jar SoyToJsSrcCompiler.jar'\n ' --shouldProvideRequireSoyNamespaces'\n ' --outputPathFormat %(output)s'\n ' %(file)s')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99757:ClassDef_L56_C0", "label": "ClosureError", "type": "class", "loc": [56, 57], "level": 0, "parent": null, "vector": [3, 0, 0.204, 0.0072, 0, 0.66, 0.6538, 106, 0, 0, 0, 0, 645, 0, 0], "semantic": {"name": "ClosureError", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class ClosureError(Exception):\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99757:FunctionDef_L60_C0", "label": "BuildClosureScript", "type": "function", "loc": [60, 77], "level": 0, "parent": null, "vector": [2, 0, 0.2473, 0.065, 0, 0.66, 0.6923, 257, 0, 2, 0, 0, 0, 0, 3], "semantic": {"name": "BuildClosureScript", "arg_names": ["input_filename", "output_filename"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def BuildClosureScript(input_filename, output_filename):\n \"\"\"Build a compiled closure script based on the given input file.\n\n Args:\n input_filename: A string representing the name of the input script to\n compile\n output_filename: A string representing the name of the output script.\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99757:Expr_L61_C2", "label": "expression", "type": "expression", "loc": [61, 70], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99757:FunctionDef_L60_C0", "vector": [8, 1, 0.2365, 0.0361, 1, 0.08, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Build a compiled closure script based on the given input file.\n\n Args:\n input_filename: A string representing the name of the input script to\n compile\n output_filename: A string representing the name of the output script.\n\n Raises:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99757:Assign_L71_C2", "label": "result = ExecuteCommand()", "type": "assigned_variable", "loc": [71, 74], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99757:FunctionDef_L60_C0", "vector": [14, 1, 0.2617, 0.0144, 1, 0.08, 0.5, 51, 3, 1, 0, 0, 789, 10, 1], "semantic": {"name": "result", "arg_names": [], "import_names": [], "rhs_call_name": "ExecuteCommand", "annotation": ""}, "snippet": " result = ExecuteCommand(\n COMPILE_CLOSURE_COMMAND % {\n 'input': input_filename,\n 'output': output_filename})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99757:If_L76_C2", "label": "if", "type": "if", "loc": [76, 77], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99757:FunctionDef_L60_C0", "vector": [4, 1, 0.2762, 0.0072, 1, 0.08, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if result or not os.path.exists(output_filename):\n raise ClosureError('Failed while compiling %s.' % input_filename)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99757:FunctionDef_L80_C0", "label": "BuildSoyJs", "type": "function", "loc": [80, 96], "level": 0, "parent": null, "vector": [2, 0, 0.3177, 0.0614, 0, 0.66, 0.7308, 853, 0, 1, 0, 0, 0, 0, 4], "semantic": {"name": "BuildSoyJs", "arg_names": ["input_file"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def BuildSoyJs(input_file):\n \"\"\"Builds a javascript file from a soy file.\n\n Args:\n input_file: A path to the soy file to compile into JavaScript. The js file\n will be stored in build_gen/{FILENAME}.soy.js\n\n Raises:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99757:Expr_L81_C2", "label": "expression", "type": "expression", "loc": [81, 89], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99757:FunctionDef_L80_C0", "vector": [8, 1, 0.3069, 0.0325, 1, 0.08, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Builds a javascript file from a soy file.\n\n Args:\n input_file: A path to the soy file to compile into JavaScript. The js file\n will be stored in build_gen/{FILENAME}.soy.js\n\n Raises:\n ClosureError: If the soy compiler fails to compile."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99757:Assign_L90_C2", "label": "output_name = join()", "type": "assigned_variable", "loc": [90, 90], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99757:FunctionDef_L80_C0", "vector": [14, 1, 0.3249, 0.0036, 1, 0.08, 0.3333, 992, 3, 2, 0, 0, 933, 10, 1], "semantic": {"name": "output_name", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": " output_name = os.path.join('build_gen', '%s.js' % input_file)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99757:Assign_L91_C2", "label": "result = ExecuteCommand()", "type": "assigned_variable", "loc": [91, 94], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99757:FunctionDef_L80_C0", "vector": [14, 1, 0.3339, 0.0144, 1, 0.08, 0.6667, 51, 3, 1, 0, 0, 789, 10, 1], "semantic": {"name": "result", "arg_names": [], "import_names": [], "rhs_call_name": "ExecuteCommand", "annotation": ""}, "snippet": " result = ExecuteCommand(\n SOY_COMPILER_COMMAND % {\n 'file': input_file,\n 'output': output_name})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99757:If_L95_C2", "label": "if", "type": "if", "loc": [95, 96], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99757:FunctionDef_L80_C0", "vector": [4, 1, 0.3448, 0.0072, 1, 0.08, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if result or not os.path.exists(output_name):\n raise ClosureError('Failed while compiling the soy file %s.' % input_file)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99757:FunctionDef_L99_C0", "label": "Clean", "type": "function", "loc": [99, 103], "level": 0, "parent": null, "vector": [2, 0, 0.3646, 0.0181, 0, 0.66, 0.7692, 416, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "Clean", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def Clean():\n if os.path.exists('clean'):\n shutil.rmtree('build')\n if os.path.exists('build_gen'):\n shutil.rmtree('build_gen')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99757:If_L100_C2", "label": "if", "type": "if", "loc": [100, 101], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99757:FunctionDef_L99_C0", "vector": [4, 1, 0.3628, 0.0072, 1, 0.06, 0.0, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if os.path.exists('clean'):\n shutil.rmtree('build')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99757:Expr_L101_C4", "label": "rmtree()", "type": "expression", "loc": [101, 101], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99757:If_L100_C2", "vector": [8, 2, 0.3646, 0.0036, 2, 0.73, 0.0, 317, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "rmtree", "arg_names": [], "import_names": [], "rhs_call_name": "rmtree", "annotation": ""}, "snippet": " shutil.rmtree('build')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99757:If_L102_C2", "label": "if", "type": "if", "loc": [102, 103], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99757:FunctionDef_L99_C0", "vector": [4, 1, 0.37, 0.0072, 1, 0.06, 1.0, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if os.path.exists('build_gen'):\n shutil.rmtree('build_gen')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99757:Expr_L103_C4", "label": "rmtree()", "type": "expression", "loc": [103, 103], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99757:If_L102_C2", "vector": [8, 2, 0.3718, 0.0036, 2, 0.74, 0.0, 317, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "rmtree", "arg_names": [], "import_names": [], "rhs_call_name": "rmtree", "annotation": ""}, "snippet": " shutil.rmtree('build_gen')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99757:FunctionDef_L106_C0", "label": "ExecuteCommand", "type": "function", "loc": [106, 122], "level": 0, "parent": null, "vector": [2, 0, 0.4116, 0.0614, 0, 0.66, 0.8077, 789, 0, 1, 1, 0, 0, 0, 5], "semantic": {"name": "ExecuteCommand", "arg_names": ["command"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def ExecuteCommand(command):\n \"\"\"Execute the given command and return the output.\n\n Args:\n command: A string representing the command to execute.\n\n Returns:\n The return code of the process."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99757:Expr_L107_C2", "label": "expression", "type": "expression", "loc": [107, 114], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99757:FunctionDef_L106_C0", "vector": [8, 1, 0.3989, 0.0289, 1, 0.53, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Execute the given command and return the output.\n\n Args:\n command: A string representing the command to execute.\n\n Returns:\n The return code of the process.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99757:Expr_L115_C2", "label": "print()", "type": "expression", "loc": [115, 115], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99757:FunctionDef_L106_C0", "vector": [8, 1, 0.4152, 0.0036, 1, 0.53, 0.2, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Running command: %s' % command)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99757:Assign_L116_C2", "label": "process = Popen()", "type": "assigned_variable", "loc": [116, 118], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99757:FunctionDef_L106_C0", "vector": [14, 1, 0.4224, 0.0108, 1, 0.53, 0.4, 712, 3, 3, 0, 0, 568, 10, 2], "semantic": {"name": "process", "arg_names": [], "import_names": [], "rhs_call_name": "Popen", "annotation": ""}, "snippet": " process = subprocess.Popen(command.split(' '),\n stdout=subprocess.PIPE,\n stderr=subprocess.PIPE)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99757:Assign_L119_C2", "label": "results = communicate()", "type": "assigned_variable", "loc": [119, 119], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99757:FunctionDef_L106_C0", "vector": [14, 1, 0.4296, 0.0036, 1, 0.53, 0.6, 143, 3, 0, 0, 0, 768, 10, 1], "semantic": {"name": "results", "arg_names": [], "import_names": [], "rhs_call_name": "communicate", "annotation": ""}, "snippet": " results = process.communicate()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99757:If_L120_C2", "label": "if", "type": "if", "loc": [120, 121], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99757:FunctionDef_L106_C0", "vector": [4, 1, 0.435, 0.0072, 1, 0.53, 0.8, 0, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if process.returncode:\n logging.error(results[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99757:Expr_L121_C4", "label": "error()", "type": "expression", "loc": [121, 121], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99757:If_L120_C2", "vector": [8, 2, 0.4368, 0.0036, 2, 0.91, 0.0, 771, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "error", "arg_names": [], "import_names": [], "rhs_call_name": "error", "annotation": ""}, "snippet": " logging.error(results[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99757:Return_L122_C2", "label": "return", "type": "return", "loc": [122, 122], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99757:FunctionDef_L106_C0", "vector": [13, 1, 0.4404, 0.0036, 1, 0.53, 1.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return process.returncode"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99757:FunctionDef_L125_C0", "label": "SetupAce", "type": "function", "loc": [125, 138], "level": 0, "parent": null, "vector": [2, 0, 0.4747, 0.0505, 0, 0.66, 0.8462, 254, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "SetupAce", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def SetupAce():\n \"\"\"Setup the Ace library.\n\n Checkout the Ace library using git.\n\n Raises:\n ClosureError: If the setup fails.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99757:Expr_L126_C2", "label": "expression", "type": "expression", "loc": [126, 132], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99757:FunctionDef_L125_C0", "vector": [8, 1, 0.4657, 0.0253, 1, 0.55, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Setup the Ace library.\n\n Checkout the Ace library using git.\n\n Raises:\n ClosureError: If the setup fails.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99757:If_L134_C2", "label": "if", "type": "if", "loc": [134, 138], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99757:FunctionDef_L125_C0", "vector": [4, 1, 0.491, 0.0181, 1, 0.55, 1.0, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not os.path.exists('ace'):\n ExecuteCommand(CHECKOUT_ACE_COMMAND)\n if not os.path.exists('ace'):\n logging.error('Could not checkout ACE from github.')\n raise ClosureError('Could not set up ACE.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99757:Expr_L135_C4", "label": "ExecuteCommand()", "type": "expression", "loc": [135, 135], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99757:If_L134_C2", "vector": [8, 2, 0.4874, 0.0036, 2, 0.15, 0.0, 789, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "ExecuteCommand", "arg_names": [], "import_names": [], "rhs_call_name": "ExecuteCommand", "annotation": ""}, "snippet": " ExecuteCommand(CHECKOUT_ACE_COMMAND)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99757:If_L136_C4", "label": "if", "type": "if", "loc": [136, 138], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99757:If_L134_C2", "vector": [4, 2, 0.4946, 0.0108, 2, 0.15, 1.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not os.path.exists('ace'):\n logging.error('Could not checkout ACE from github.')\n raise ClosureError('Could not set up ACE.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99757:Expr_L137_C6", "label": "error()", "type": "expression", "loc": [137, 137], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99757:If_L136_C4", "vector": [8, 3, 0.4946, 0.0036, 3, 0.45, 0.0, 771, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "error", "arg_names": [], "import_names": [], "rhs_call_name": "error", "annotation": ""}, "snippet": " logging.error('Could not checkout ACE from github.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99757:FunctionDef_L141_C0", "label": "SetupClosure", "type": "function", "loc": [141, 186], "level": 0, "parent": null, "vector": [2, 0, 0.5903, 0.1661, 0, 0.66, 0.8846, 844, 0, 0, 0, 0, 0, 0, 27], "semantic": {"name": "SetupClosure", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def SetupClosure():\n \"\"\"Setup the closure library and compiler.\n\n Checkout the closure library using svn if it doesn't exist. Also, download\n the closure compiler.\n\n Raises:\n ClosureError: If the setup fails."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99757:Expr_L142_C2", "label": "expression", "type": "expression", "loc": [142, 149], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99757:FunctionDef_L141_C0", "vector": [8, 1, 0.5253, 0.0289, 1, 0.28, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Setup the closure library and compiler.\n\n Checkout the closure library using svn if it doesn't exist. Also, download\n the closure compiler.\n\n Raises:\n ClosureError: If the setup fails.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99757:If_L151_C2", "label": "if", "type": "if", "loc": [151, 157], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99757:FunctionDef_L141_C0", "vector": [4, 1, 0.556, 0.0253, 1, 0.28, 0.25, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not os.path.exists('closure-library'):\n ExecuteCommand(CHECKOUT_CLOSURE_COMMAND)\n if not os.path.exists('closure-library'):\n logging.error(('Could not check out the closure library from svn. '\n 'Please check out the closure library to the '\n '\"closure-library\" directory.'))\n raise ClosureError('Could not set up the closure library.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99757:Expr_L152_C4", "label": "ExecuteCommand()", "type": "expression", "loc": [152, 152], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99757:If_L151_C2", "vector": [8, 2, 0.5487, 0.0036, 2, 0.42, 0.0, 789, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "ExecuteCommand", "arg_names": [], "import_names": [], "rhs_call_name": "ExecuteCommand", "annotation": ""}, "snippet": " ExecuteCommand(CHECKOUT_CLOSURE_COMMAND)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99757:If_L153_C4", "label": "if", "type": "if", "loc": [153, 157], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99757:If_L151_C2", "vector": [4, 2, 0.5596, 0.0181, 2, 0.42, 1.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not os.path.exists('closure-library'):\n logging.error(('Could not check out the closure library from svn. '\n 'Please check out the closure library to the '\n '\"closure-library\" directory.'))\n raise ClosureError('Could not set up the closure library.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99757:Expr_L154_C6", "label": "error()", "type": "expression", "loc": [154, 156], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99757:If_L153_C4", "vector": [8, 3, 0.5596, 0.0108, 3, 0.59, 0.0, 771, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "error", "arg_names": [], "import_names": [], "rhs_call_name": "error", "annotation": ""}, "snippet": " logging.error(('Could not check out the closure library from svn. '\n 'Please check out the closure library to the '\n '\"closure-library\" directory.'))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99757:If_L160_C2", "label": "if", "type": "if", "loc": [160, 166], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99757:FunctionDef_L141_C0", "vector": [4, 1, 0.5884, 0.0253, 1, 0.28, 0.5, 0, 0, 0, 0, 0, 0, 0, 7], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not os.path.exists('compiler.jar'):\n (compiler_zip, _) = urllib.urlretrieve(CLOSURE_COMPILER_URL)\n compiler_zipfile = zipfile.ZipFile(compiler_zip)\n compiler_zipfile.extract('compiler.jar')\n if not os.path.exists('compiler.jar'):\n logging.error('Could not download the closure compiler jar.')\n raise ClosureError('Could not find the closure compiler.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99757:Assign_L161_C4", "label": "compiler_zip, _ = urlretrieve()", "type": "assigned_variable", "loc": [161, 161], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99757:If_L160_C2", "vector": [14, 2, 0.5812, 0.0036, 2, 0.21, 0.0, 761, 3, 1, 0, 0, 329, 10, 1], "semantic": {"name": "compiler_zip, _", "arg_names": [], "import_names": [], "rhs_call_name": "urlretrieve", "annotation": ""}, "snippet": " (compiler_zip, _) = urllib.urlretrieve(CLOSURE_COMPILER_URL)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99757:Assign_L162_C4", "label": "compiler_zipfile = ZipFile()", "type": "assigned_variable", "loc": [162, 162], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99757:If_L160_C2", "vector": [14, 2, 0.5848, 0.0036, 2, 0.21, 0.3333, 337, 3, 1, 0, 0, 299, 10, 1], "semantic": {"name": "compiler_zipfile", "arg_names": [], "import_names": [], "rhs_call_name": "ZipFile", "annotation": ""}, "snippet": " compiler_zipfile = zipfile.ZipFile(compiler_zip)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99757:Expr_L163_C4", "label": "extract()", "type": "expression", "loc": [163, 163], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99757:If_L160_C2", "vector": [8, 2, 0.5884, 0.0036, 2, 0.21, 0.6667, 450, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "extract", "arg_names": [], "import_names": [], "rhs_call_name": "extract", "annotation": ""}, "snippet": " compiler_zipfile.extract('compiler.jar')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99757:If_L164_C4", "label": "if", "type": "if", "loc": [164, 166], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99757:If_L160_C2", "vector": [4, 2, 0.5957, 0.0108, 2, 0.21, 1.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not os.path.exists('compiler.jar'):\n logging.error('Could not download the closure compiler jar.')\n raise ClosureError('Could not find the closure compiler.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99757:Expr_L165_C6", "label": "error()", "type": "expression", "loc": [165, 165], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99757:If_L164_C4", "vector": [8, 3, 0.5957, 0.0036, 3, 0.42, 0.0, 771, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "error", "arg_names": [], "import_names": [], "rhs_call_name": "error", "annotation": ""}, "snippet": " logging.error('Could not download the closure compiler jar.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99757:If_L169_C2", "label": "if", "type": "if", "loc": [169, 178], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99757:FunctionDef_L141_C0", "vector": [4, 1, 0.6264, 0.0361, 1, 0.28, 0.75, 0, 0, 0, 0, 0, 0, 0, 10], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if (not os.path.exists('SoyToJsSrcCompiler.jar') or\n not os.path.exists('build_gen/soyutils_usegoog.js')):\n (soy_compiler_zip, _) = urllib.urlretrieve(SOY_COMPILER_URL)\n soy_compiler_zipfile = zipfile.ZipFile(soy_compiler_zip)\n soy_compiler_zipfile.extract('SoyToJsSrcCompiler.jar')\n soy_compiler_zipfile.extract('soyutils_usegoog.js', 'build_gen')\n if (not os.path.exists('SoyToJsSrcCompiler.jar') or\n not os.path.exists('build_gen/soyutils_usegoog.js')):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99757:Assign_L171_C4", "label": "soy_compiler_zip, _ = urlretrieve()", "type": "assigned_variable", "loc": [171, 171], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99757:If_L169_C2", "vector": [14, 2, 0.6173, 0.0036, 2, 0.61, 0.0, 508, 3, 1, 0, 0, 329, 10, 1], "semantic": {"name": "soy_compiler_zip, _", "arg_names": [], "import_names": [], "rhs_call_name": "urlretrieve", "annotation": ""}, "snippet": " (soy_compiler_zip, _) = urllib.urlretrieve(SOY_COMPILER_URL)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99757:Assign_L172_C4", "label": "soy_compiler_zipfile = ZipFile()", "type": "assigned_variable", "loc": [172, 172], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99757:If_L169_C2", "vector": [14, 2, 0.6209, 0.0036, 2, 0.61, 0.25, 110, 3, 1, 0, 0, 299, 10, 1], "semantic": {"name": "soy_compiler_zipfile", "arg_names": [], "import_names": [], "rhs_call_name": "ZipFile", "annotation": ""}, "snippet": " soy_compiler_zipfile = zipfile.ZipFile(soy_compiler_zip)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99757:Expr_L173_C4", "label": "extract()", "type": "expression", "loc": [173, 173], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99757:If_L169_C2", "vector": [8, 2, 0.6245, 0.0036, 2, 0.61, 0.5, 450, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "extract", "arg_names": [], "import_names": [], "rhs_call_name": "extract", "annotation": ""}, "snippet": " soy_compiler_zipfile.extract('SoyToJsSrcCompiler.jar')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99757:Expr_L174_C4", "label": "extract()", "type": "expression", "loc": [174, 174], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99757:If_L169_C2", "vector": [8, 2, 0.6282, 0.0036, 2, 0.61, 0.75, 450, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "extract", "arg_names": [], "import_names": [], "rhs_call_name": "extract", "annotation": ""}, "snippet": " soy_compiler_zipfile.extract('soyutils_usegoog.js', 'build_gen')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99757:If_L175_C4", "label": "if", "type": "if", "loc": [175, 178], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99757:If_L169_C2", "vector": [4, 2, 0.6372, 0.0144, 2, 0.61, 1.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if (not os.path.exists('SoyToJsSrcCompiler.jar') or\n not os.path.exists('build_gen/soyutils_usegoog.js')):\n logging.error('Could not download the soy compiler jar.')\n raise ClosureError('Could not find the soy compiler.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99757:Expr_L177_C6", "label": "error()", "type": "expression", "loc": [177, 177], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99757:If_L175_C4", "vector": [8, 3, 0.639, 0.0036, 3, 0.21, 0.0, 771, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "error", "arg_names": [], "import_names": [], "rhs_call_name": "error", "annotation": ""}, "snippet": " logging.error('Could not download the soy compiler jar.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99757:If_L182_C2", "label": "if", "type": "if", "loc": [182, 186], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99757:FunctionDef_L141_C0", "vector": [4, 1, 0.6643, 0.0181, 1, 0.28, 1.0, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not os.path.exists('build_gen/soydata.js'):\n urllib.urlretrieve(SOYDATA_URL, 'build_gen/soydata.js')\n if not os.path.exists('build_gen/soydata.js'):\n logging.error('Could not download soydata.js.')\n raise ClosureError('Could not fine soydata.js')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99757:Expr_L183_C4", "label": "urlretrieve()", "type": "expression", "loc": [183, 183], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99757:If_L182_C2", "vector": [8, 2, 0.6606, 0.0036, 2, 0.95, 0.0, 329, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "urlretrieve", "arg_names": [], "import_names": [], "rhs_call_name": "urlretrieve", "annotation": ""}, "snippet": " urllib.urlretrieve(SOYDATA_URL, 'build_gen/soydata.js')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99757:If_L184_C4", "label": "if", "type": "if", "loc": [184, 186], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99757:If_L182_C2", "vector": [4, 2, 0.6679, 0.0108, 2, 0.95, 1.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not os.path.exists('build_gen/soydata.js'):\n logging.error('Could not download soydata.js.')\n raise ClosureError('Could not fine soydata.js')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99757:Expr_L185_C6", "label": "error()", "type": "expression", "loc": [185, 185], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99757:If_L184_C4", "vector": [8, 3, 0.6679, 0.0036, 3, 0.92, 0.0, 771, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "error", "arg_names": [], "import_names": [], "rhs_call_name": "error", "annotation": ""}, "snippet": " logging.error('Could not download soydata.js.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99757:FunctionDef_L189_C0", "label": "SetupSelenium", "type": "function", "loc": [189, 202], "level": 0, "parent": null, "vector": [2, 0, 0.7058, 0.0505, 0, 0.66, 0.9231, 313, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "SetupSelenium", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def SetupSelenium():\n \"\"\"Setup the selenium library.\n\n Checkout necessary files from the selenium library using svn, if they\n don't exist.\n\n Raises:\n ClosureError: If the setup fails."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99757:Expr_L190_C2", "label": "expression", "type": "expression", "loc": [190, 197], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99757:FunctionDef_L189_C0", "vector": [8, 1, 0.6986, 0.0289, 1, 0.24, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Setup the selenium library.\n\n Checkout necessary files from the selenium library using svn, if they\n don't exist.\n\n Raises:\n ClosureError: If the setup fails.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99757:If_L198_C2", "label": "if", "type": "if", "loc": [198, 202], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99757:FunctionDef_L189_C0", "vector": [4, 1, 0.722, 0.0181, 1, 0.24, 1.0, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not os.path.exists('selenium-atoms-lib/bot.js'):\n ExecuteCommand(CHECKOUT_SELENIUM_COMMAND)\n if not os.path.exists('selenium-atoms-lib/bot.js'):\n logging.error('Could not download the selenium library.')\n raise ClosureError('Could not find the selenium library.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99757:Expr_L199_C4", "label": "ExecuteCommand()", "type": "expression", "loc": [199, 199], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99757:If_L198_C2", "vector": [8, 2, 0.7184, 0.0036, 2, 0.26, 0.0, 789, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "ExecuteCommand", "arg_names": [], "import_names": [], "rhs_call_name": "ExecuteCommand", "annotation": ""}, "snippet": " ExecuteCommand(CHECKOUT_SELENIUM_COMMAND)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99757:If_L200_C4", "label": "if", "type": "if", "loc": [200, 202], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99757:If_L198_C2", "vector": [4, 2, 0.7256, 0.0108, 2, 0.26, 1.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not os.path.exists('selenium-atoms-lib/bot.js'):\n logging.error('Could not download the selenium library.')\n raise ClosureError('Could not find the selenium library.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99757:Expr_L201_C6", "label": "error()", "type": "expression", "loc": [201, 201], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99757:If_L200_C4", "vector": [8, 3, 0.7256, 0.0036, 3, 0.51, 0.0, 771, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "error", "arg_names": [], "import_names": [], "rhs_call_name": "error", "annotation": ""}, "snippet": " logging.error('Could not download the selenium library.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99757:FunctionDef_L205_C0", "label": "main", "type": "function", "loc": [205, 272], "level": 0, "parent": null, "vector": [2, 0, 0.861, 0.2455, 0, 0.66, 0.9615, 624, 0, 0, 0, 0, 0, 0, 29], "semantic": {"name": "main", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def main():\n usage = 'usage: %prog [options]'\n parser = optparse.OptionParser(usage)\n parser.add_option('--clean', dest='build_clean',\n action='store_true', default=False,\n help='Clean the build directories.')\n (options, _) = parser.parse_args()\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99757:Assign_L206_C2", "label": "usage =", "type": "assigned_variable", "loc": [206, 206], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99757:FunctionDef_L205_C0", "vector": [14, 1, 0.7437, 0.0036, 1, 0.85, 0.0, 129, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "usage", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " usage = 'usage: %prog [options]'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99757:Assign_L207_C2", "label": "parser = OptionParser()", "type": "assigned_variable", "loc": [207, 207], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99757:FunctionDef_L205_C0", "vector": [14, 1, 0.7473, 0.0036, 1, 0.85, 0.0455, 968, 3, 1, 0, 0, 894, 10, 1], "semantic": {"name": "parser", "arg_names": [], "import_names": [], "rhs_call_name": "OptionParser", "annotation": ""}, "snippet": " parser = optparse.OptionParser(usage)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99757:Expr_L208_C2", "label": "add_option()", "type": "expression", "loc": [208, 210], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99757:FunctionDef_L205_C0", "vector": [8, 1, 0.7545, 0.0108, 1, 0.85, 0.0909, 176, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "add_option", "arg_names": [], "import_names": [], "rhs_call_name": "add_option", "annotation": ""}, "snippet": " parser.add_option('--clean', dest='build_clean',\n action='store_true', default=False,\n help='Clean the build directories.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99757:Assign_L211_C2", "label": "options, _ = parse_args()", "type": "assigned_variable", "loc": [211, 211], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99757:FunctionDef_L205_C0", "vector": [14, 1, 0.7617, 0.0036, 1, 0.85, 0.1364, 735, 3, 0, 0, 0, 187, 10, 1], "semantic": {"name": "options, _", "arg_names": [], "import_names": [], "rhs_call_name": "parse_args", "annotation": ""}, "snippet": " (options, _) = parser.parse_args()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99757:If_L213_C2", "label": "if", "type": "if", "loc": [213, 215], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99757:FunctionDef_L205_C0", "vector": [4, 1, 0.7726, 0.0108, 1, 0.85, 0.1818, 0, 7, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if options.build_clean:\n Clean()\n exit()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99757:Expr_L214_C4", "label": "Clean()", "type": "expression", "loc": [214, 214], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99757:If_L213_C2", "vector": [8, 2, 0.7726, 0.0036, 2, 0.15, 0.0, 416, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "Clean", "arg_names": [], "import_names": [], "rhs_call_name": "Clean", "annotation": ""}, "snippet": " Clean()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99757:Expr_L215_C4", "label": "exit()", "type": "expression", "loc": [215, 215], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99757:If_L213_C2", "vector": [8, 2, 0.7762, 0.0036, 2, 0.15, 1.0, 436, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "exit", "arg_names": [], "import_names": [], "rhs_call_name": "exit", "annotation": ""}, "snippet": " exit()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99757:If_L218_C2", "label": "if", "type": "if", "loc": [218, 219], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99757:FunctionDef_L205_C0", "vector": [4, 1, 0.7888, 0.0072, 1, 0.85, 0.2273, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not os.path.exists('build'):\n os.mkdir('build')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99757:Expr_L219_C4", "label": "mkdir()", "type": "expression", "loc": [219, 219], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99757:If_L218_C2", "vector": [8, 2, 0.7906, 0.0036, 2, 0.23, 0.0, 853, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "mkdir", "arg_names": [], "import_names": [], "rhs_call_name": "mkdir", "annotation": ""}, "snippet": " os.mkdir('build')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99757:If_L220_C2", "label": "if", "type": "if", "loc": [220, 221], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99757:FunctionDef_L205_C0", "vector": [4, 1, 0.796, 0.0072, 1, 0.85, 0.2727, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not os.path.exists('build/options'):\n os.mkdir('build/options')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99757:Expr_L221_C4", "label": "mkdir()", "type": "expression", "loc": [221, 221], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99757:If_L220_C2", "vector": [8, 2, 0.7978, 0.0036, 2, 0.67, 0.0, 853, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "mkdir", "arg_names": [], "import_names": [], "rhs_call_name": "mkdir", "annotation": ""}, "snippet": " os.mkdir('build/options')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99757:If_L222_C2", "label": "if", "type": "if", "loc": [222, 223], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99757:FunctionDef_L205_C0", "vector": [4, 1, 0.8032, 0.0072, 1, 0.85, 0.3182, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not os.path.exists('build_gen'):\n os.mkdir('build_gen')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99757:Expr_L223_C4", "label": "mkdir()", "type": "expression", "loc": [223, 223], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99757:If_L222_C2", "vector": [8, 2, 0.8051, 0.0036, 2, 0.7, 0.0, 853, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "mkdir", "arg_names": [], "import_names": [], "rhs_call_name": "mkdir", "annotation": ""}, "snippet": " os.mkdir('build_gen')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99757:Expr_L226_C2", "label": "SetupClosure()", "type": "expression", "loc": [226, 226], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99757:FunctionDef_L205_C0", "vector": [8, 1, 0.8159, 0.0036, 1, 0.85, 0.3636, 844, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "SetupClosure", "arg_names": [], "import_names": [], "rhs_call_name": "SetupClosure", "annotation": ""}, "snippet": " SetupClosure()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99757:Expr_L227_C2", "label": "SetupSelenium()", "type": "expression", "loc": [227, 227], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99757:FunctionDef_L205_C0", "vector": [8, 1, 0.8195, 0.0036, 1, 0.85, 0.4091, 313, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "SetupSelenium", "arg_names": [], "import_names": [], "rhs_call_name": "SetupSelenium", "annotation": ""}, "snippet": " SetupSelenium()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99757:Expr_L228_C2", "label": "SetupAce()", "type": "expression", "loc": [228, 228], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99757:FunctionDef_L205_C0", "vector": [8, 1, 0.8231, 0.0036, 1, 0.85, 0.4545, 254, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "SetupAce", "arg_names": [], "import_names": [], "rhs_call_name": "SetupAce", "annotation": ""}, "snippet": " SetupAce()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99757:Assign_L231_C2", "label": "soy_files =", "type": "assigned_variable", "loc": [231, 237], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99757:FunctionDef_L205_C0", "vector": [14, 1, 0.8448, 0.0253, 1, 0.85, 0.5, 888, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "soy_files", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " soy_files = ['consoles.soy',\n 'rpfconsole.soy',\n 'rpf_dialogs.soy',\n 'locatorsupdater.soy',\n 'newbug_console.soy',\n 'newbug_type_selector.soy',\n 'popup.soy']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99757:For_L239_C2", "label": "for soy_filename", "type": "for", "loc": [239, 240], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99757:FunctionDef_L205_C0", "vector": [6, 1, 0.8646, 0.0072, 1, 0.85, 0.5455, 459, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "soy_filename", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for soy_filename in soy_files:\n BuildSoyJs(os.path.join('src', soy_filename))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99757:Expr_L240_C4", "label": "BuildSoyJs()", "type": "expression", "loc": [240, 240], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99757:For_L239_C2", "vector": [8, 2, 0.8664, 0.0036, 2, 0.24, 0.0, 853, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "BuildSoyJs", "arg_names": [], "import_names": [], "rhs_call_name": "BuildSoyJs", "annotation": ""}, "snippet": " BuildSoyJs(os.path.join('src', soy_filename))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99757:Assign_L242_C2", "label": "js_targets =", "type": "assigned_variable", "loc": [242, 248], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99757:FunctionDef_L205_C0", "vector": [14, 1, 0.8845, 0.0253, 1, 0.85, 0.5909, 208, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "js_targets", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " js_targets = {'background.js': 'background_script.js',\n 'content.js': 'content_script.js',\n 'getactioninfo.js': 'getactioninfo_script.js',\n 'console.js': 'console_script.js',\n 'elementhelper.js': 'elementhelper_script.js',\n 'popup.js': 'popup_script.js',\n 'options/page.js': 'options_script.js'}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99757:For_L250_C2", "label": "for target", "type": "for", "loc": [250, 252], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99757:FunctionDef_L205_C0", "vector": [6, 1, 0.9061, 0.0108, 1, 0.85, 0.6364, 766, 2, 0, 0, 0, 0, 0, 3], "semantic": {"name": "target", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for target in js_targets:\n BuildClosureScript(os.path.join('src', target),\n os.path.join('build', js_targets[target]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99757:Expr_L251_C4", "label": "BuildClosureScript()", "type": "expression", "loc": [251, 252], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99757:For_L250_C2", "vector": [8, 2, 0.9079, 0.0072, 2, 0.15, 0.0, 257, 3, 2, 0, 0, 0, 0, 3], "semantic": {"name": "BuildClosureScript", "arg_names": [], "import_names": [], "rhs_call_name": "BuildClosureScript", "annotation": ""}, "snippet": " BuildClosureScript(os.path.join('src', target),\n os.path.join('build', js_targets[target]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99757:If_L255_C2", "label": "if", "type": "if", "loc": [255, 256], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99757:FunctionDef_L205_C0", "vector": [4, 1, 0.9224, 0.0072, 1, 0.85, 0.6818, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if os.path.exists('build/styles'):\n shutil.rmtree('build/styles')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99757:Expr_L256_C4", "label": "rmtree()", "type": "expression", "loc": [256, 256], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99757:If_L255_C2", "vector": [8, 2, 0.9242, 0.0036, 2, 0.24, 0.0, 317, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "rmtree", "arg_names": [], "import_names": [], "rhs_call_name": "rmtree", "annotation": ""}, "snippet": " shutil.rmtree('build/styles')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99757:Expr_L257_C2", "label": "copytree()", "type": "expression", "loc": [257, 257], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99757:FunctionDef_L205_C0", "vector": [8, 1, 0.9278, 0.0036, 1, 0.85, 0.7273, 739, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "copytree", "arg_names": [], "import_names": [], "rhs_call_name": "copytree", "annotation": ""}, "snippet": " shutil.copytree('src/styles', 'build/styles')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99757:If_L258_C2", "label": "if", "type": "if", "loc": [258, 259], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99757:FunctionDef_L205_C0", "vector": [4, 1, 0.9332, 0.0072, 1, 0.85, 0.7727, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if os.path.exists('build/imgs'):\n shutil.rmtree('build/imgs')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99757:Expr_L259_C4", "label": "rmtree()", "type": "expression", "loc": [259, 259], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99757:If_L258_C2", "vector": [8, 2, 0.935, 0.0036, 2, 0.61, 0.0, 317, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "rmtree", "arg_names": [], "import_names": [], "rhs_call_name": "rmtree", "annotation": ""}, "snippet": " shutil.rmtree('build/imgs')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99757:Expr_L260_C2", "label": "copytree()", "type": "expression", "loc": [260, 260], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99757:FunctionDef_L205_C0", "vector": [8, 1, 0.9386, 0.0036, 1, 0.85, 0.8182, 739, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "copytree", "arg_names": [], "import_names": [], "rhs_call_name": "copytree", "annotation": ""}, "snippet": " shutil.copytree('src/imgs', 'build/imgs')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99757:Assign_L261_C2", "label": "static_files =", "type": "assigned_variable", "loc": [261, 265], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99757:FunctionDef_L205_C0", "vector": [14, 1, 0.9495, 0.0181, 1, 0.85, 0.8636, 748, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "static_files", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " static_files = ['src/background.html',\n 'src/console.html',\n 'src/options/options.html',\n 'src/popup.html',\n 'manifest.json']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99757:For_L266_C2", "label": "for static_file", "type": "for", "loc": [266, 267], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99757:FunctionDef_L205_C0", "vector": [6, 1, 0.9621, 0.0072, 1, 0.85, 0.9091, 76, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "static_file", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for static_file in static_files:\n shutil.copy(static_file, 'build')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99757:Expr_L267_C4", "label": "copy()", "type": "expression", "loc": [267, 267], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99757:For_L266_C2", "vector": [8, 2, 0.9639, 0.0036, 2, 0.18, 0.0, 739, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "copy", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " shutil.copy(static_file, 'build')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99757:If_L270_C2", "label": "if", "type": "if", "loc": [270, 271], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99757:FunctionDef_L205_C0", "vector": [4, 1, 0.9765, 0.0072, 1, 0.85, 0.9545, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if os.path.exists('build/ace'):\n shutil.rmtree('build/ace')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99757:Expr_L271_C4", "label": "rmtree()", "type": "expression", "loc": [271, 271], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99757:If_L270_C2", "vector": [8, 2, 0.9783, 0.0036, 2, 0.58, 0.0, 317, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "rmtree", "arg_names": [], "import_names": [], "rhs_call_name": "rmtree", "annotation": ""}, "snippet": " shutil.rmtree('build/ace')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99757:Expr_L272_C2", "label": "copytree()", "type": "expression", "loc": [272, 272], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99757:FunctionDef_L205_C0", "vector": [8, 1, 0.9819, 0.0036, 1, 0.85, 1.0, 739, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "copytree", "arg_names": [], "import_names": [], "rhs_call_name": "copytree", "annotation": ""}, "snippet": " shutil.copytree('ace/build/src', 'build/ace')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99757:If_L275_C0", "label": "if", "type": "if", "loc": [275, 276], "level": 0, "parent": null, "vector": [4, 0, 0.9946, 0.0072, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == '__main__':\n main()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99757:Expr_L276_C2", "label": "main()", "type": "expression", "loc": [276, 276], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99757:If_L275_C0", "vector": [8, 1, 0.9964, 0.0036, 1, 0.62, 0.0, 624, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "main", "arg_names": [], "import_names": [], "rhs_call_name": "main", "annotation": ""}, "snippet": " main()"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99757:FunctionDef_L60_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99757:Expr_L61_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99757:FunctionDef_L60_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99757:Assign_L71_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99757:FunctionDef_L60_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99757:If_L76_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99757:FunctionDef_L80_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99757:Expr_L81_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99757:FunctionDef_L80_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99757:Assign_L90_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99757:FunctionDef_L80_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99757:Assign_L91_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99757:FunctionDef_L80_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99757:If_L95_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99757:FunctionDef_L99_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99757:If_L100_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99757:If_L100_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99757:Expr_L101_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99757:FunctionDef_L99_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99757:If_L102_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99757:If_L102_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99757:Expr_L103_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99757:FunctionDef_L106_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99757:Expr_L107_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99757:FunctionDef_L106_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99757:Expr_L115_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99757:FunctionDef_L106_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99757:Assign_L116_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99757:FunctionDef_L106_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99757:Assign_L119_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99757:FunctionDef_L106_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99757:If_L120_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99757:If_L120_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99757:Expr_L121_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99757:FunctionDef_L106_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99757:Return_L122_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99757:FunctionDef_L125_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99757:Expr_L126_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99757:FunctionDef_L125_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99757:If_L134_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99757:If_L134_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99757:Expr_L135_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99757:If_L134_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99757:If_L136_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99757:If_L136_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99757:Expr_L137_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99757:FunctionDef_L141_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99757:Expr_L142_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99757:FunctionDef_L141_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99757:If_L151_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99757:If_L151_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99757:Expr_L152_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99757:If_L151_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99757:If_L153_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99757:If_L153_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99757:Expr_L154_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99757:FunctionDef_L141_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99757:If_L160_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99757:If_L160_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99757:Assign_L161_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99757:If_L160_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99757:Assign_L162_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99757:If_L160_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99757:Expr_L163_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99757:If_L160_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99757:If_L164_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99757:If_L164_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99757:Expr_L165_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99757:FunctionDef_L141_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99757:If_L169_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99757:If_L169_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99757:Assign_L171_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99757:If_L169_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99757:Assign_L172_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99757:If_L169_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99757:Expr_L173_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99757:If_L169_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99757:Expr_L174_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99757:If_L169_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99757:If_L175_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99757:If_L175_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99757:Expr_L177_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99757:FunctionDef_L141_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99757:If_L182_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99757:If_L182_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99757:Expr_L183_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99757:If_L182_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99757:If_L184_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99757:If_L184_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99757:Expr_L185_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99757:FunctionDef_L189_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99757:Expr_L190_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99757:FunctionDef_L189_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99757:If_L198_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99757:If_L198_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99757:Expr_L199_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99757:If_L198_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99757:If_L200_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99757:If_L200_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99757:Expr_L201_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99757:FunctionDef_L205_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99757:Assign_L206_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99757:FunctionDef_L205_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99757:Assign_L207_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99757:FunctionDef_L205_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99757:Expr_L208_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99757:FunctionDef_L205_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99757:Assign_L211_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99757:FunctionDef_L205_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99757:If_L213_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99757:If_L213_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99757:Expr_L214_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99757:If_L213_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99757:Expr_L215_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99757:FunctionDef_L205_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99757:If_L218_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99757:If_L218_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99757:Expr_L219_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99757:FunctionDef_L205_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99757:If_L220_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99757:If_L220_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99757:Expr_L221_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99757:FunctionDef_L205_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99757:If_L222_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99757:If_L222_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99757:Expr_L223_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99757:FunctionDef_L205_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99757:Expr_L226_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99757:FunctionDef_L205_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99757:Expr_L227_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99757:FunctionDef_L205_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99757:Expr_L228_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99757:FunctionDef_L205_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99757:Assign_L231_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99757:FunctionDef_L205_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99757:For_L239_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99757:For_L239_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99757:Expr_L240_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99757:FunctionDef_L205_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99757:Assign_L242_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99757:FunctionDef_L205_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99757:For_L250_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99757:For_L250_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99757:Expr_L251_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99757:FunctionDef_L205_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99757:If_L255_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99757:If_L255_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99757:Expr_L256_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99757:FunctionDef_L205_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99757:Expr_L257_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99757:FunctionDef_L205_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99757:If_L258_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99757:If_L258_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99757:Expr_L259_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99757:FunctionDef_L205_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99757:Expr_L260_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99757:FunctionDef_L205_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99757:Assign_L261_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99757:FunctionDef_L205_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99757:For_L266_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99757:For_L266_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99757:Expr_L267_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99757:FunctionDef_L205_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99757:If_L270_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99757:If_L270_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99757:Expr_L271_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99757:FunctionDef_L205_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99757:Expr_L272_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99757:If_L275_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99757:Expr_L276_C2"}] |
import os
THIS_PATH = os.path.dirname(__file__)
GOLDEN_OUTPUT = os.path.join(THIS_PATH, 'golden_suite', 'output.xml')
GOLDEN_OUTPUT2 = os.path.join(THIS_PATH, 'golden_suite', 'output2.xml')
GOLDEN_JS = os.path.join(THIS_PATH, 'golden_suite', 'expected.js')
| ajibawa-2023/Python-Code-Large/train/row_99760 | 5 | 7 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99760:Import_L1_C0", "label": "os import os", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.1429, 0.1429, 0, 0.66, 0.0, 688, 0, 1, 0, 0, 688, 0, 0], "semantic": {"name": "os", "arg_names": [], "import_names": ["os"], "rhs_call_name": "", "annotation": ""}, "snippet": "import os"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99760:Assign_L3_C0", "label": "THIS_PATH = dirname()", "type": "assigned_variable", "loc": [3, 3], "level": 0, "parent": null, "vector": [14, 0, 0.4286, 0.1429, 0, 0.66, 0.25, 832, 3, 1, 0, 0, 959, 10, 1], "semantic": {"name": "THIS_PATH", "arg_names": [], "import_names": [], "rhs_call_name": "dirname", "annotation": ""}, "snippet": "THIS_PATH = os.path.dirname(__file__)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99760:Assign_L4_C0", "label": "GOLDEN_OUTPUT = join()", "type": "assigned_variable", "loc": [4, 4], "level": 0, "parent": null, "vector": [14, 0, 0.5714, 0.1429, 0, 0.66, 0.5, 85, 3, 3, 0, 0, 933, 10, 1], "semantic": {"name": "GOLDEN_OUTPUT", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": "GOLDEN_OUTPUT = os.path.join(THIS_PATH, 'golden_suite', 'output.xml')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99760:Assign_L5_C0", "label": "GOLDEN_OUTPUT2 = join()", "type": "assigned_variable", "loc": [5, 5], "level": 0, "parent": null, "vector": [14, 0, 0.7143, 0.1429, 0, 0.66, 0.75, 205, 3, 3, 0, 0, 933, 10, 1], "semantic": {"name": "GOLDEN_OUTPUT2", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": "GOLDEN_OUTPUT2 = os.path.join(THIS_PATH, 'golden_suite', 'output2.xml')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99760:Assign_L6_C0", "label": "GOLDEN_JS = join()", "type": "assigned_variable", "loc": [6, 6], "level": 0, "parent": null, "vector": [14, 0, 0.8571, 0.1429, 0, 0.66, 1.0, 856, 3, 3, 0, 0, 933, 10, 1], "semantic": {"name": "GOLDEN_JS", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": "GOLDEN_JS = os.path.join(THIS_PATH, 'golden_suite', 'expected.js')"}] | [] |
#!/usr/bin/env python
import fileinput
import os
import sys
import robot
from robot.result.jsparser import create_datamodel_from
BASEDIR = os.path.dirname(__file__)
def run_robot(outputdirectory, testdata, loglevel='INFO'):
robot.run(testdata, log='NONE', report='NONE',
tagstatlink=['force:http://google.com:<kuukkeli>',
'i*:http://%1/:Title of i%1'],
tagdoc=['test:this_is_*my_bold*_test',
'IX:*Combined* & escaped << tag doc'],
tagstatcombine=['fooANDi*:zap', 'i?:IX'],
critical=[], noncritical=[], outputdir=outputdirectory, loglevel=loglevel)
def create_jsdata(output_xml_file, target):
model = create_datamodel_from(output_xml_file)
model.set_settings({'logURL': 'log.html',
'reportURL': 'report.html',
'background': {'fail': 'DeepPink'}})
with open(target, 'w') as output:
model.write_to(output)
def replace_all(file,searchExp,replaceExp):
for line in fileinput.input(file, inplace=1):
if searchExp in line:
line = line.replace(searchExp,replaceExp)
sys.stdout.write(line)
def create(input, target, targetName, loglevel='INFO'):
run_robot(BASEDIR, input, loglevel)
create_jsdata('output.xml', target)
replace_all(target, 'window.output', 'window.' + targetName)
if __name__ == '__main__':
create('Suite.txt', 'Suite.js', 'suiteOutput')
create('SetupsAndTeardowns.txt', 'SetupsAndTeardowns.js', 'setupsAndTeardownsOutput')
create('Messages.txt', 'Messages.js', 'messagesOutput')
create('teardownFailure', 'TeardownFailure.js', 'teardownFailureOutput')
create(os.path.join('teardownFailure', 'PassingFailing.txt'), 'PassingFailing.js', 'passingFailingOutput')
create('TestsAndKeywords.txt', 'TestsAndKeywords.js', 'testsAndKeywordsOutput')
create('.', 'allData.js', 'allDataOutput')
| ajibawa-2023/Python-Code-Large/train/row_99761 | 29 | 49 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99761:Import_L3_C0", "label": "fileinput import fileinput", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0612, 0.0204, 0, 0.66, 0.0, 286, 0, 1, 0, 0, 286, 0, 0], "semantic": {"name": "fileinput", "arg_names": [], "import_names": ["fileinput"], "rhs_call_name": "", "annotation": ""}, "snippet": "import fileinput"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99761:Import_L4_C0", "label": "os import os", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0816, 0.0204, 0, 0.66, 0.1, 688, 0, 1, 0, 0, 688, 0, 0], "semantic": {"name": "os", "arg_names": [], "import_names": ["os"], "rhs_call_name": "", "annotation": ""}, "snippet": "import os"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99761:Import_L5_C0", "label": "sys import sys", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.102, 0.0204, 0, 0.66, 0.2, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sys"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99761:Import_L6_C0", "label": "robot import robot", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.1224, 0.0204, 0, 0.66, 0.3, 735, 0, 1, 0, 0, 735, 0, 0], "semantic": {"name": "robot", "arg_names": [], "import_names": ["robot"], "rhs_call_name": "", "annotation": ""}, "snippet": "import robot"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99761:ImportFrom_L7_C0", "label": "from robot.result.jsparser import create_datamodel_from", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.1429, 0.0204, 0, 0.66, 0.4, 93, 0, 1, 0, 0, 93, 0, 0], "semantic": {"name": "robot.result.jsparser", "arg_names": [], "import_names": ["create_datamodel_from"], "rhs_call_name": "", "annotation": ""}, "snippet": "from robot.result.jsparser import create_datamodel_from"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99761:Assign_L9_C0", "label": "BASEDIR = dirname()", "type": "assigned_variable", "loc": [9, 9], "level": 0, "parent": null, "vector": [14, 0, 0.1837, 0.0204, 0, 0.66, 0.5, 914, 3, 1, 0, 0, 959, 10, 1], "semantic": {"name": "BASEDIR", "arg_names": [], "import_names": [], "rhs_call_name": "dirname", "annotation": ""}, "snippet": "BASEDIR = os.path.dirname(__file__)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99761:FunctionDef_L11_C0", "label": "run_robot", "type": "function", "loc": [11, 18], "level": 0, "parent": null, "vector": [2, 0, 0.2959, 0.1633, 0, 0.66, 0.6, 627, 0, 3, 0, 0, 0, 0, 1], "semantic": {"name": "run_robot", "arg_names": ["outputdirectory", "testdata", "loglevel"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def run_robot(outputdirectory, testdata, loglevel='INFO'):\n robot.run(testdata, log='NONE', report='NONE',\n tagstatlink=['force:http://google.com:<kuukkeli>',\n 'i*:http://%1/:Title of i%1'],\n tagdoc=['test:this_is_*my_bold*_test',\n 'IX:*Combined* & escaped << tag doc'],\n tagstatcombine=['fooANDi*:zap', 'i?:IX'],\n critical=[], noncritical=[], outputdir=outputdirectory, loglevel=loglevel)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99761:Expr_L12_C4", "label": "run()", "type": "expression", "loc": [12, 18], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99761:FunctionDef_L11_C0", "vector": [8, 1, 0.3061, 0.1429, 1, 0.55, 0.0, 679, 3, 10, 0, 0, 0, 0, 1], "semantic": {"name": "run", "arg_names": [], "import_names": [], "rhs_call_name": "run", "annotation": ""}, "snippet": " robot.run(testdata, log='NONE', report='NONE',\n tagstatlink=['force:http://google.com:<kuukkeli>',\n 'i*:http://%1/:Title of i%1'],\n tagdoc=['test:this_is_*my_bold*_test',\n 'IX:*Combined* & escaped << tag doc'],\n tagstatcombine=['fooANDi*:zap', 'i?:IX'],\n critical=[], noncritical=[], outputdir=outputdirectory, loglevel=loglevel)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99761:FunctionDef_L21_C0", "label": "create_jsdata", "type": "function", "loc": [21, 27], "level": 0, "parent": null, "vector": [2, 0, 0.4898, 0.1429, 0, 0.66, 0.7, 987, 0, 2, 0, 0, 0, 0, 4], "semantic": {"name": "create_jsdata", "arg_names": ["output_xml_file", "target"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def create_jsdata(output_xml_file, target):\n model = create_datamodel_from(output_xml_file)\n model.set_settings({'logURL': 'log.html',\n 'reportURL': 'report.html',\n 'background': {'fail': 'DeepPink'}})\n with open(target, 'w') as output:\n model.write_to(output)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99761:Assign_L22_C4", "label": "model = create_datamodel_from()", "type": "assigned_variable", "loc": [22, 22], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99761:FunctionDef_L21_C0", "vector": [14, 1, 0.449, 0.0204, 1, 0.87, 0.0, 722, 3, 1, 0, 0, 209, 10, 1], "semantic": {"name": "model", "arg_names": [], "import_names": [], "rhs_call_name": "create_datamodel_from", "annotation": ""}, "snippet": " model = create_datamodel_from(output_xml_file)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99761:Expr_L23_C4", "label": "set_settings()", "type": "expression", "loc": [23, 25], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99761:FunctionDef_L21_C0", "vector": [8, 1, 0.4898, 0.0612, 1, 0.87, 1.0, 759, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_settings", "arg_names": [], "import_names": [], "rhs_call_name": "set_settings", "annotation": ""}, "snippet": " model.set_settings({'logURL': 'log.html',\n 'reportURL': 'report.html',\n 'background': {'fail': 'DeepPink'}})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99761:Expr_L27_C8", "label": "write_to()", "type": "expression", "loc": [27, 27], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99761:FunctionDef_L21_C0", "vector": [8, 1, 0.551, 0.0204, 1, 0.87, 0.0, 739, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write_to", "arg_names": [], "import_names": [], "rhs_call_name": "write_to", "annotation": ""}, "snippet": " model.write_to(output)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99761:FunctionDef_L29_C0", "label": "replace_all", "type": "function", "loc": [29, 33], "level": 0, "parent": null, "vector": [2, 0, 0.6327, 0.102, 0, 0.66, 0.8, 977, 0, 3, 0, 0, 0, 0, 3], "semantic": {"name": "replace_all", "arg_names": ["file", "searchExp", "replaceExp"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def replace_all(file,searchExp,replaceExp):\n for line in fileinput.input(file, inplace=1):\n if searchExp in line:\n line = line.replace(searchExp,replaceExp)\n sys.stdout.write(line)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99761:For_L30_C4", "label": "for line", "type": "for", "loc": [30, 33], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99761:FunctionDef_L29_C0", "vector": [6, 1, 0.6429, 0.0816, 1, 0.77, 0.0, 373, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "line", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for line in fileinput.input(file, inplace=1):\n if searchExp in line:\n line = line.replace(searchExp,replaceExp)\n sys.stdout.write(line)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99761:If_L31_C8", "label": "if", "type": "if", "loc": [31, 32], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99761:For_L30_C4", "vector": [4, 2, 0.6429, 0.0408, 2, 0.92, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if searchExp in line:\n line = line.replace(searchExp,replaceExp)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99761:Assign_L32_C12", "label": "line = replace()", "type": "assigned_variable", "loc": [32, 32], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99761:If_L31_C8", "vector": [14, 3, 0.6531, 0.0204, 3, 0.23, 0.0, 373, 3, 2, 0, 0, 293, 10, 1], "semantic": {"name": "line", "arg_names": [], "import_names": [], "rhs_call_name": "replace", "annotation": ""}, "snippet": " line = line.replace(searchExp,replaceExp)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99761:Expr_L33_C8", "label": "write()", "type": "expression", "loc": [33, 33], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99761:For_L30_C4", "vector": [8, 2, 0.6735, 0.0204, 2, 0.92, 1.0, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " sys.stdout.write(line)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99761:FunctionDef_L36_C0", "label": "create", "type": "function", "loc": [36, 39], "level": 0, "parent": null, "vector": [2, 0, 0.7653, 0.0816, 0, 0.66, 0.9, 316, 0, 4, 0, 0, 0, 0, 3], "semantic": {"name": "create", "arg_names": ["input", "target", "targetName", "loglevel"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def create(input, target, targetName, loglevel='INFO'):\n run_robot(BASEDIR, input, loglevel)\n create_jsdata('output.xml', target)\n replace_all(target, 'window.output', 'window.' + targetName)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99761:Expr_L37_C4", "label": "run_robot()", "type": "expression", "loc": [37, 37], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99761:FunctionDef_L36_C0", "vector": [8, 1, 0.7551, 0.0204, 1, 0.58, 0.0, 627, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "run_robot", "arg_names": [], "import_names": [], "rhs_call_name": "run_robot", "annotation": ""}, "snippet": " run_robot(BASEDIR, input, loglevel)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99761:Expr_L38_C4", "label": "create_jsdata()", "type": "expression", "loc": [38, 38], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99761:FunctionDef_L36_C0", "vector": [8, 1, 0.7755, 0.0204, 1, 0.58, 0.5, 987, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "create_jsdata", "arg_names": [], "import_names": [], "rhs_call_name": "create_jsdata", "annotation": ""}, "snippet": " create_jsdata('output.xml', target)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99761:Expr_L39_C4", "label": "replace_all()", "type": "expression", "loc": [39, 39], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99761:FunctionDef_L36_C0", "vector": [8, 1, 0.7959, 0.0204, 1, 0.58, 1.0, 977, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "replace_all", "arg_names": [], "import_names": [], "rhs_call_name": "replace_all", "annotation": ""}, "snippet": " replace_all(target, 'window.output', 'window.' + targetName)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99761:If_L41_C0", "label": "if", "type": "if", "loc": [41, 48], "level": 0, "parent": null, "vector": [4, 0, 0.9082, 0.1633, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 8], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == '__main__':\n create('Suite.txt', 'Suite.js', 'suiteOutput')\n create('SetupsAndTeardowns.txt', 'SetupsAndTeardowns.js', 'setupsAndTeardownsOutput')\n create('Messages.txt', 'Messages.js', 'messagesOutput')\n create('teardownFailure', 'TeardownFailure.js', 'teardownFailureOutput')\n create(os.path.join('teardownFailure', 'PassingFailing.txt'), 'PassingFailing.js', 'passingFailingOutput')\n create('TestsAndKeywords.txt', 'TestsAndKeywords.js', 'testsAndKeywordsOutput')\n create('.', 'allData.js', 'allDataOutput')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99761:Expr_L42_C4", "label": "create()", "type": "expression", "loc": [42, 42], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99761:If_L41_C0", "vector": [8, 1, 0.8571, 0.0204, 1, 0.79, 0.0, 316, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "create", "arg_names": [], "import_names": [], "rhs_call_name": "create", "annotation": ""}, "snippet": " create('Suite.txt', 'Suite.js', 'suiteOutput')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99761:Expr_L43_C4", "label": "create()", "type": "expression", "loc": [43, 43], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99761:If_L41_C0", "vector": [8, 1, 0.8776, 0.0204, 1, 0.79, 0.1667, 316, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "create", "arg_names": [], "import_names": [], "rhs_call_name": "create", "annotation": ""}, "snippet": " create('SetupsAndTeardowns.txt', 'SetupsAndTeardowns.js', 'setupsAndTeardownsOutput')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99761:Expr_L44_C4", "label": "create()", "type": "expression", "loc": [44, 44], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99761:If_L41_C0", "vector": [8, 1, 0.898, 0.0204, 1, 0.79, 0.3333, 316, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "create", "arg_names": [], "import_names": [], "rhs_call_name": "create", "annotation": ""}, "snippet": " create('Messages.txt', 'Messages.js', 'messagesOutput')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99761:Expr_L45_C4", "label": "create()", "type": "expression", "loc": [45, 45], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99761:If_L41_C0", "vector": [8, 1, 0.9184, 0.0204, 1, 0.79, 0.5, 316, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "create", "arg_names": [], "import_names": [], "rhs_call_name": "create", "annotation": ""}, "snippet": " create('teardownFailure', 'TeardownFailure.js', 'teardownFailureOutput')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99761:Expr_L46_C4", "label": "create()", "type": "expression", "loc": [46, 46], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99761:If_L41_C0", "vector": [8, 1, 0.9388, 0.0204, 1, 0.79, 0.6667, 316, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "create", "arg_names": [], "import_names": [], "rhs_call_name": "create", "annotation": ""}, "snippet": " create(os.path.join('teardownFailure', 'PassingFailing.txt'), 'PassingFailing.js', 'passingFailingOutput')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99761:Expr_L47_C4", "label": "create()", "type": "expression", "loc": [47, 47], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99761:If_L41_C0", "vector": [8, 1, 0.9592, 0.0204, 1, 0.79, 0.8333, 316, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "create", "arg_names": [], "import_names": [], "rhs_call_name": "create", "annotation": ""}, "snippet": " create('TestsAndKeywords.txt', 'TestsAndKeywords.js', 'testsAndKeywordsOutput')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99761:Expr_L48_C4", "label": "create()", "type": "expression", "loc": [48, 48], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99761:If_L41_C0", "vector": [8, 1, 0.9796, 0.0204, 1, 0.79, 1.0, 316, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "create", "arg_names": [], "import_names": [], "rhs_call_name": "create", "annotation": ""}, "snippet": " create('.', 'allData.js', 'allDataOutput')"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99761:FunctionDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99761:Expr_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99761:FunctionDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99761:Assign_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99761:FunctionDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99761:Expr_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99761:FunctionDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99761:Expr_L27_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99761:FunctionDef_L29_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99761:For_L30_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99761:For_L30_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99761:If_L31_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99761:If_L31_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99761:Assign_L32_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99761:For_L30_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99761:Expr_L33_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99761:FunctionDef_L36_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99761:Expr_L37_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99761:FunctionDef_L36_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99761:Expr_L38_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99761:FunctionDef_L36_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99761:Expr_L39_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99761:If_L41_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99761:Expr_L42_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99761:If_L41_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99761:Expr_L43_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99761:If_L41_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99761:Expr_L44_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99761:If_L41_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99761:Expr_L45_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99761:If_L41_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99761:Expr_L46_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99761:If_L41_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99761:Expr_L47_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99761:If_L41_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99761:Expr_L48_C4"}] |
#!/usr/bin/env python
import sys
import os
from distutils.core import setup
import robot_postinstall
execfile(os.path.join(os.path.dirname(__file__),'src','robot','version.py'))
# Maximum width in Windows installer seems to be 70 characters -------|
DESCRIPTION = """
Robot Framework is a generic test automation framework for acceptance
testing and acceptance test-driven development (ATDD). It has
easy-to-use tabular test data syntax and utilizes the keyword-driven
testing approach. Its testing capabilities can be extended by test
libraries implemented either with Python or Java, and users can create
new keywords from existing ones using the same syntax that is used for
creating test cases.
"""[1:-1]
CLASSIFIERS = """
Development Status :: 5 - Production/Stable
License :: OSI Approved :: Apache Software License
Operating System :: OS Independent
Programming Language :: Python
Topic :: Software Development :: Testing
"""[1:-1]
PACKAGES = ['robot', 'robot.api', 'robot.common', 'robot.conf',
'robot.libraries', 'robot.output', 'robot.parsing',
'robot.result', 'robot.running', 'robot.utils',
'robot.variables']
SCRIPT_NAMES = ['pybot', 'jybot', 'rebot']
if os.name == 'java':
SCRIPT_NAMES.remove('pybot')
def main():
inst_scripts = [ os.path.join('src','bin',name) for name in SCRIPT_NAMES ]
if 'bdist_wininst' in sys.argv:
inst_scripts = [ script+'.bat' for script in inst_scripts ]
inst_scripts.append('robot_postinstall.py')
elif os.sep == '\\':
inst_scripts = [ script+'.bat' for script in inst_scripts ]
if 'bdist_egg' in sys.argv:
package_path = os.path.dirname(sys.argv[0])
robot_postinstall.egg_preinstall(package_path, inst_scripts)
# Let distutils take care of most of the setup
dist = setup(
name = 'robotframework',
version = get_version(sep='-'),
author = 'Robot Framework Developers',
author_email = 'robotframework-devel@googlegroups.com',
url = 'http://robotframework.org',
license = 'Apache License 2.0',
description = 'A generic test automation framework',
long_description = DESCRIPTION,
keywords = 'robotframework testing testautomation atdd',
platforms = 'any',
classifiers = CLASSIFIERS.splitlines(),
package_dir = {'': 'src'},
package_data = {'robot': ['webcontent/*.html', 'webcontent/*.css', 'webcontent/*js', 'webcontent/lib/*.js']},
packages = PACKAGES,
scripts = inst_scripts,
)
if 'install' in sys.argv:
absnorm = lambda path: os.path.abspath(os.path.normpath(path))
script_dir = absnorm(dist.command_obj['install_scripts'].install_dir)
module_dir = absnorm(dist.command_obj['install_lib'].install_dir)
robot_dir = os.path.join(module_dir, 'robot')
script_names = [ os.path.basename(name) for name in inst_scripts ]
robot_postinstall.generic_install(script_names, script_dir, robot_dir)
if __name__ == "__main__":
main()
| ajibawa-2023/Python-Code-Large/train/row_99763 | 31 | 78 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99763:Import_L3_C0", "label": "sys import sys", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0385, 0.0128, 0, 0.66, 0.0, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sys"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99763:Import_L4_C0", "label": "os import os", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0513, 0.0128, 0, 0.66, 0.0909, 688, 0, 1, 0, 0, 688, 0, 0], "semantic": {"name": "os", "arg_names": [], "import_names": ["os"], "rhs_call_name": "", "annotation": ""}, "snippet": "import os"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99763:ImportFrom_L5_C0", "label": "from distutils.core import setup", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0641, 0.0128, 0, 0.66, 0.1818, 152, 0, 1, 0, 0, 152, 0, 0], "semantic": {"name": "distutils.core", "arg_names": [], "import_names": ["setup"], "rhs_call_name": "", "annotation": ""}, "snippet": "from distutils.core import setup"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99763:Import_L7_C0", "label": "robot_postinstall import robot_postinstall", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.0897, 0.0128, 0, 0.66, 0.2727, 809, 0, 1, 0, 0, 809, 0, 0], "semantic": {"name": "robot_postinstall", "arg_names": [], "import_names": ["robot_postinstall"], "rhs_call_name": "", "annotation": ""}, "snippet": "import robot_postinstall"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99763:Expr_L8_C0", "label": "execfile()", "type": "expression", "loc": [8, 8], "level": 0, "parent": null, "vector": [8, 0, 0.1026, 0.0128, 0, 0.66, 0.3636, 750, 3, 1, 0, 0, 0, 0, 3], "semantic": {"name": "execfile", "arg_names": [], "import_names": [], "rhs_call_name": "execfile", "annotation": ""}, "snippet": "execfile(os.path.join(os.path.dirname(__file__),'src','robot','version.py'))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99763:Assign_L12_C0", "label": "DESCRIPTION =", "type": "assigned_variable", "loc": [12, 20], "level": 0, "parent": null, "vector": [14, 0, 0.2051, 0.1154, 0, 0.66, 0.4545, 740, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "DESCRIPTION", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DESCRIPTION = \"\"\"\nRobot Framework is a generic test automation framework for acceptance\ntesting and acceptance test-driven development (ATDD). It has\neasy-to-use tabular test data syntax and utilizes the keyword-driven\ntesting approach. Its testing capabilities can be extended by test\nlibraries implemented either with Python or Java, and users can create\nnew keywords from existing ones using the same syntax that is used for\ncreating test cases."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99763:Assign_L21_C0", "label": "CLASSIFIERS =", "type": "assigned_variable", "loc": [21, 27], "level": 0, "parent": null, "vector": [14, 0, 0.3077, 0.0897, 0, 0.66, 0.5455, 104, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "CLASSIFIERS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "CLASSIFIERS = \"\"\"\nDevelopment Status :: 5 - Production/Stable\nLicense :: OSI Approved :: Apache Software License\nOperating System :: OS Independent\nProgramming Language :: Python\nTopic :: Software Development :: Testing\n\"\"\"[1:-1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99763:Assign_L28_C0", "label": "PACKAGES =", "type": "assigned_variable", "loc": [28, 31], "level": 0, "parent": null, "vector": [14, 0, 0.3782, 0.0513, 0, 0.66, 0.6364, 260, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "PACKAGES", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "PACKAGES = ['robot', 'robot.api', 'robot.common', 'robot.conf',\n 'robot.libraries', 'robot.output', 'robot.parsing',\n 'robot.result', 'robot.running', 'robot.utils',\n 'robot.variables']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99763:Assign_L32_C0", "label": "SCRIPT_NAMES =", "type": "assigned_variable", "loc": [32, 32], "level": 0, "parent": null, "vector": [14, 0, 0.4103, 0.0128, 0, 0.66, 0.7273, 107, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "SCRIPT_NAMES", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "SCRIPT_NAMES = ['pybot', 'jybot', 'rebot']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99763:If_L33_C0", "label": "if", "type": "if", "loc": [33, 34], "level": 0, "parent": null, "vector": [4, 0, 0.4295, 0.0256, 0, 0.66, 0.8182, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if os.name == 'java':\n SCRIPT_NAMES.remove('pybot')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99763:Expr_L34_C4", "label": "remove()", "type": "expression", "loc": [34, 34], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99763:If_L33_C0", "vector": [8, 1, 0.4359, 0.0128, 1, 0.46, 0.0, 185, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "remove", "arg_names": [], "import_names": [], "rhs_call_name": "remove", "annotation": ""}, "snippet": " SCRIPT_NAMES.remove('pybot')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99763:FunctionDef_L37_C0", "label": "main", "type": "function", "loc": [37, 74], "level": 0, "parent": null, "vector": [2, 0, 0.7115, 0.4872, 0, 0.66, 0.9091, 624, 0, 0, 0, 0, 0, 0, 14], "semantic": {"name": "main", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def main():\n inst_scripts = [ os.path.join('src','bin',name) for name in SCRIPT_NAMES ]\n if 'bdist_wininst' in sys.argv:\n inst_scripts = [ script+'.bat' for script in inst_scripts ]\n inst_scripts.append('robot_postinstall.py')\n elif os.sep == '\\\\':\n inst_scripts = [ script+'.bat' for script in inst_scripts ]\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99763:Assign_L38_C4", "label": "inst_scripts =", "type": "assigned_variable", "loc": [38, 38], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99763:FunctionDef_L37_C0", "vector": [14, 1, 0.4872, 0.0128, 1, 0.22, 0.0, 570, 5, 0, 0, 0, 0, 0, 1], "semantic": {"name": "inst_scripts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " inst_scripts = [ os.path.join('src','bin',name) for name in SCRIPT_NAMES ]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99763:If_L39_C4", "label": "if", "type": "if", "loc": [39, 43], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99763:FunctionDef_L37_C0", "vector": [4, 1, 0.5256, 0.0641, 1, 0.22, 0.25, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if 'bdist_wininst' in sys.argv:\n inst_scripts = [ script+'.bat' for script in inst_scripts ]\n inst_scripts.append('robot_postinstall.py')\n elif os.sep == '\\\\':\n inst_scripts = [ script+'.bat' for script in inst_scripts ]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99763:Assign_L40_C8", "label": "inst_scripts =", "type": "assigned_variable", "loc": [40, 40], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99763:If_L39_C4", "vector": [14, 2, 0.5128, 0.0128, 2, 0.3, 0.0, 570, 5, 0, 0, 0, 0, 0, 0], "semantic": {"name": "inst_scripts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " inst_scripts = [ script+'.bat' for script in inst_scripts ]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99763:Expr_L41_C8", "label": "append()", "type": "expression", "loc": [41, 41], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99763:If_L39_C4", "vector": [8, 2, 0.5256, 0.0128, 2, 0.3, 0.5, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " inst_scripts.append('robot_postinstall.py')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99763:If_L42_C4", "label": "if", "type": "if", "loc": [42, 43], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99763:If_L39_C4", "vector": [4, 2, 0.5449, 0.0256, 2, 0.3, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif os.sep == '\\\\':\n inst_scripts = [ script+'.bat' for script in inst_scripts ]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99763:Assign_L43_C8", "label": "inst_scripts =", "type": "assigned_variable", "loc": [43, 43], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99763:If_L42_C4", "vector": [14, 3, 0.5513, 0.0128, 3, 0.27, 0.0, 570, 5, 0, 0, 0, 0, 0, 0], "semantic": {"name": "inst_scripts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " inst_scripts = [ script+'.bat' for script in inst_scripts ]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99763:If_L45_C4", "label": "if", "type": "if", "loc": [45, 47], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99763:FunctionDef_L37_C0", "vector": [4, 1, 0.5897, 0.0385, 1, 0.22, 0.5, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if 'bdist_egg' in sys.argv:\n package_path = os.path.dirname(sys.argv[0])\n robot_postinstall.egg_preinstall(package_path, inst_scripts)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99763:Assign_L46_C8", "label": "package_path = dirname()", "type": "assigned_variable", "loc": [46, 46], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99763:If_L45_C4", "vector": [14, 2, 0.5897, 0.0128, 2, 0.53, 0.0, 927, 3, 1, 0, 0, 959, 10, 1], "semantic": {"name": "package_path", "arg_names": [], "import_names": [], "rhs_call_name": "dirname", "annotation": ""}, "snippet": " package_path = os.path.dirname(sys.argv[0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99763:Expr_L47_C8", "label": "egg_preinstall()", "type": "expression", "loc": [47, 47], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99763:If_L45_C4", "vector": [8, 2, 0.6026, 0.0128, 2, 0.53, 1.0, 744, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "egg_preinstall", "arg_names": [], "import_names": [], "rhs_call_name": "egg_preinstall", "annotation": ""}, "snippet": " robot_postinstall.egg_preinstall(package_path, inst_scripts)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99763:Assign_L50_C4", "label": "dist = setup()", "type": "assigned_variable", "loc": [50, 66], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99763:FunctionDef_L37_C0", "vector": [14, 1, 0.7436, 0.2179, 1, 0.22, 0.75, 673, 3, 15, 0, 0, 234, 10, 3], "semantic": {"name": "dist", "arg_names": [], "import_names": [], "rhs_call_name": "setup", "annotation": ""}, "snippet": " dist = setup(\n name = 'robotframework',\n version = get_version(sep='-'),\n author = 'Robot Framework Developers',\n author_email = 'robotframework-devel@googlegroups.com',\n url = 'http://robotframework.org',\n license = 'Apache License 2.0',\n description = 'A generic test automation framework',"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99763:If_L68_C4", "label": "if", "type": "if", "loc": [68, 74], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99763:FunctionDef_L37_C0", "vector": [4, 1, 0.9103, 0.0897, 1, 0.22, 1.0, 0, 0, 0, 0, 0, 0, 0, 7], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if 'install' in sys.argv:\n absnorm = lambda path: os.path.abspath(os.path.normpath(path))\n script_dir = absnorm(dist.command_obj['install_scripts'].install_dir)\n module_dir = absnorm(dist.command_obj['install_lib'].install_dir)\n robot_dir = os.path.join(module_dir, 'robot')\n script_names = [ os.path.basename(name) for name in inst_scripts ]\n robot_postinstall.generic_install(script_names, script_dir, robot_dir)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99763:Assign_L69_C8", "label": "absnorm =", "type": "assigned_variable", "loc": [69, 69], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99763:If_L68_C4", "vector": [14, 2, 0.8846, 0.0128, 2, 0.84, 0.0, 510, 9, 0, 0, 0, 0, 0, 2], "semantic": {"name": "absnorm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " absnorm = lambda path: os.path.abspath(os.path.normpath(path))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99763:Assign_L70_C8", "label": "script_dir = absnorm()", "type": "assigned_variable", "loc": [70, 70], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99763:If_L68_C4", "vector": [14, 2, 0.8974, 0.0128, 2, 0.84, 0.2, 902, 3, 1, 0, 0, 510, 10, 1], "semantic": {"name": "script_dir", "arg_names": [], "import_names": [], "rhs_call_name": "absnorm", "annotation": ""}, "snippet": " script_dir = absnorm(dist.command_obj['install_scripts'].install_dir)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99763:Assign_L71_C8", "label": "module_dir = absnorm()", "type": "assigned_variable", "loc": [71, 71], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99763:If_L68_C4", "vector": [14, 2, 0.9103, 0.0128, 2, 0.84, 0.4, 646, 3, 1, 0, 0, 510, 10, 1], "semantic": {"name": "module_dir", "arg_names": [], "import_names": [], "rhs_call_name": "absnorm", "annotation": ""}, "snippet": " module_dir = absnorm(dist.command_obj['install_lib'].install_dir)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99763:Assign_L72_C8", "label": "robot_dir = join()", "type": "assigned_variable", "loc": [72, 72], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99763:If_L68_C4", "vector": [14, 2, 0.9231, 0.0128, 2, 0.84, 0.6, 756, 3, 2, 0, 0, 933, 10, 1], "semantic": {"name": "robot_dir", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": " robot_dir = os.path.join(module_dir, 'robot')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99763:Assign_L73_C8", "label": "script_names =", "type": "assigned_variable", "loc": [73, 73], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99763:If_L68_C4", "vector": [14, 2, 0.9359, 0.0128, 2, 0.84, 0.8, 372, 5, 0, 0, 0, 0, 0, 1], "semantic": {"name": "script_names", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " script_names = [ os.path.basename(name) for name in inst_scripts ]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99763:Expr_L74_C8", "label": "generic_install()", "type": "expression", "loc": [74, 74], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99763:If_L68_C4", "vector": [8, 2, 0.9487, 0.0128, 2, 0.84, 1.0, 114, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "generic_install", "arg_names": [], "import_names": [], "rhs_call_name": "generic_install", "annotation": ""}, "snippet": " robot_postinstall.generic_install(script_names, script_dir, robot_dir)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99763:If_L77_C0", "label": "if", "type": "if", "loc": [77, 78], "level": 0, "parent": null, "vector": [4, 0, 0.9936, 0.0256, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == \"__main__\":\n main()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99763:Expr_L78_C4", "label": "main()", "type": "expression", "loc": [78, 78], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99763:If_L77_C0", "vector": [8, 1, 1.0, 0.0128, 1, 0.43, 0.0, 624, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "main", "arg_names": [], "import_names": [], "rhs_call_name": "main", "annotation": ""}, "snippet": " main()"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99763:If_L33_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99763:Expr_L34_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99763:FunctionDef_L37_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99763:Assign_L38_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99763:FunctionDef_L37_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99763:If_L39_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99763:If_L39_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99763:Assign_L40_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99763:If_L39_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99763:Expr_L41_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99763:If_L39_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99763:If_L42_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99763:If_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99763:Assign_L43_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99763:FunctionDef_L37_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99763:If_L45_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99763:If_L45_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99763:Assign_L46_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99763:If_L45_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99763:Expr_L47_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99763:FunctionDef_L37_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99763:Assign_L50_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99763:FunctionDef_L37_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99763:If_L68_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99763:If_L68_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99763:Assign_L69_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99763:If_L68_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99763:Assign_L70_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99763:If_L68_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99763:Assign_L71_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99763:If_L68_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99763:Assign_L72_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99763:If_L68_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99763:Assign_L73_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99763:If_L68_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99763:Expr_L74_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99763:If_L77_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99763:Expr_L78_C4"}] |
#!/usr/bin/env python
"""A script for running Robot Framework's acceptance tests.
Usage: run_atests.py interpreter [options] datasource(s)
Data sources are paths to directories or files under `robot` folder.
Available options are the same that can be used with Robot Framework.
See its help (e.g. `pybot --help`) for more information.
The specified interpreter is used by acceptance tests under `robot` to
run test cases under `testdata`. It can be simply `python` or `jython`
(if they are in PATH) or to a path a selected interpreter (e.g.
`/usr/bin/python26`). Note that this script itself must always be
executed with Python.
Examples:
$ atest/run_atests.py python --test example atest/robot
$ atest/run_atests.py /usr/bin/jython25 atest/robot/tags/tag_doc.txt
"""
import signal
import subprocess
import os.path
import shutil
import glob
import sys
from zipfile import ZipFile, ZIP_DEFLATED
CURDIR = os.path.dirname(os.path.abspath(__file__))
RESULTDIR = os.path.join(CURDIR, 'results')
sys.path.insert(0, os.path.join(CURDIR, '..', 'src'))
import robot
ARGUMENTS = ' '.join('''
--doc RobotSPFrameworkSPacceptanceSPtests
--reporttitle RobotSPFrameworkSPTestSPReport
--logtitle RobotSPFrameworkSPTestSPLog
--metadata Interpreter:%(INTERPRETER)s
--metadata Platform:%(PLATFORM)s
--variable INTERPRETER:%(INTERPRETER)s
--variable STANDALONE_JYTHON:NO
--pythonpath %(PYTHONPATH)s
--include %(RUNNER)s
--outputdir %(OUTPUTDIR)s
--output output.xml
--report report.html
--log log.html
--splitlog
--escape space:SP
--escape star:STAR
--escape paren1:PAR1
--escape paren2:PAR2
--critical regression
--noncritical to_be_clarified
--noncritical static_html_checks
--SuiteStatLevel 3
--TagStatCombine jybotNOTpybot
--TagStatCombine pybotNOTjybot
--TagStatExclude pybot
--TagStatExclude jybot
'''.strip().splitlines())
def atests(interpreter, *params):
if os.path.isdir(RESULTDIR):
shutil.rmtree(RESULTDIR)
runner = ('jython' in os.path.basename(interpreter) and 'jybot'
or 'pybot')
args = ARGUMENTS % {
'PYTHONPATH' : os.path.join(CURDIR, 'resources'),
'OUTPUTDIR' : RESULTDIR,
'INTERPRETER': interpreter,
'PLATFORM': sys.platform,
'RUNNER': runner
}
if os.name == 'nt':
args += ' --exclude nonwindows'
if sys.platform == 'darwin' and runner == 'pybot':
args += ' --exclude nonmacpython'
runner = os.path.join(os.path.dirname(robot.__file__), 'runner.py')
command = '%s %s %s %s' % (sys.executable, runner, args, ' '.join(params))
print 'Running command\n%s\n' % command
sys.stdout.flush()
signal.signal(signal.SIGINT, signal.SIG_IGN)
return subprocess.call(command.split())
def buildbot(interpreter, *params):
params = '--log NONE --report NONE --SplitOutputs 1'.split() + list(params)
rc = atests(interpreter, *params)
zippath = os.path.join(RESULTDIR, 'outputs.zip')
zipfile = ZipFile(zippath, 'w', compression=ZIP_DEFLATED)
for output in glob.glob(os.path.join(RESULTDIR, '*.xml')):
zipfile.write(output, os.path.basename(output))
zipfile.close()
print 'Archive:', zippath
return rc
if __name__ == '__main__':
if len(sys.argv) == 1 or '--help' in sys.argv:
print __doc__
rc = 251
elif sys.argv[1] == 'buildbot':
rc = buildbot(*sys.argv[2:])
else:
rc = atests(*sys.argv[1:])
sys.exit(rc)
| ajibawa-2023/Python-Code-Large/train/row_99764 | 44 | 113 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99764:Expr_L3_C0", "label": "expression", "type": "expression", "loc": [3, 21], "level": 0, "parent": null, "vector": [8, 0, 0.1062, 0.1681, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\"\"\"A script for running Robot Framework's acceptance tests.\n\nUsage: run_atests.py interpreter [options] datasource(s)\n\nData sources are paths to directories or files under `robot` folder.\n\nAvailable options are the same that can be used with Robot Framework.\nSee its help (e.g. `pybot --help`) for more information."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99764:Import_L23_C0", "label": "signal import signal", "type": "import", "loc": [23, 23], "level": 0, "parent": null, "vector": [1, 0, 0.2035, 0.0088, 0, 0.66, 0.0667, 621, 0, 1, 0, 0, 621, 0, 0], "semantic": {"name": "signal", "arg_names": [], "import_names": ["signal"], "rhs_call_name": "", "annotation": ""}, "snippet": "import signal"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99764:Import_L24_C0", "label": "subprocess import subprocess", "type": "import", "loc": [24, 24], "level": 0, "parent": null, "vector": [1, 0, 0.2124, 0.0088, 0, 0.66, 0.1333, 394, 0, 1, 0, 0, 394, 0, 0], "semantic": {"name": "subprocess", "arg_names": [], "import_names": ["subprocess"], "rhs_call_name": "", "annotation": ""}, "snippet": "import subprocess"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99764:Import_L25_C0", "label": "os.path import os.path", "type": "import", "loc": [25, 25], "level": 0, "parent": null, "vector": [1, 0, 0.2212, 0.0088, 0, 0.66, 0.2, 79, 0, 1, 0, 0, 79, 0, 0], "semantic": {"name": "os.path", "arg_names": [], "import_names": ["os.path"], "rhs_call_name": "", "annotation": ""}, "snippet": "import os.path"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99764:Import_L26_C0", "label": "shutil import shutil", "type": "import", "loc": [26, 26], "level": 0, "parent": null, "vector": [1, 0, 0.2301, 0.0088, 0, 0.66, 0.2667, 614, 0, 1, 0, 0, 614, 0, 0], "semantic": {"name": "shutil", "arg_names": [], "import_names": ["shutil"], "rhs_call_name": "", "annotation": ""}, "snippet": "import shutil"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99764:Import_L27_C0", "label": "glob import glob", "type": "import", "loc": [27, 27], "level": 0, "parent": null, "vector": [1, 0, 0.2389, 0.0088, 0, 0.66, 0.3333, 958, 0, 1, 0, 0, 958, 0, 0], "semantic": {"name": "glob", "arg_names": [], "import_names": ["glob"], "rhs_call_name": "", "annotation": ""}, "snippet": "import glob"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99764:Import_L28_C0", "label": "sys import sys", "type": "import", "loc": [28, 28], "level": 0, "parent": null, "vector": [1, 0, 0.2478, 0.0088, 0, 0.66, 0.4, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sys"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99764:ImportFrom_L29_C0", "label": "from zipfile import ZipFile, ZIP_DEFLATED", "type": "import", "loc": [29, 29], "level": 0, "parent": null, "vector": [1, 0, 0.2566, 0.0088, 0, 0.66, 0.4667, 93, 0, 2, 0, 0, 93, 0, 0], "semantic": {"name": "zipfile", "arg_names": [], "import_names": ["ZipFile", "ZIP_DEFLATED"], "rhs_call_name": "", "annotation": ""}, "snippet": "from zipfile import ZipFile, ZIP_DEFLATED"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99764:Assign_L31_C0", "label": "CURDIR = dirname()", "type": "assigned_variable", "loc": [31, 31], "level": 0, "parent": null, "vector": [14, 0, 0.2743, 0.0088, 0, 0.66, 0.5333, 44, 3, 1, 0, 0, 959, 10, 2], "semantic": {"name": "CURDIR", "arg_names": [], "import_names": [], "rhs_call_name": "dirname", "annotation": ""}, "snippet": "CURDIR = os.path.dirname(os.path.abspath(__file__))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99764:Assign_L32_C0", "label": "RESULTDIR = join()", "type": "assigned_variable", "loc": [32, 32], "level": 0, "parent": null, "vector": [14, 0, 0.2832, 0.0088, 0, 0.66, 0.6, 751, 3, 2, 0, 0, 933, 10, 1], "semantic": {"name": "RESULTDIR", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": "RESULTDIR = os.path.join(CURDIR, 'results')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99764:Expr_L34_C0", "label": "insert()", "type": "expression", "loc": [34, 34], "level": 0, "parent": null, "vector": [8, 0, 0.3009, 0.0088, 0, 0.66, 0.6667, 368, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "insert", "arg_names": [], "import_names": [], "rhs_call_name": "insert", "annotation": ""}, "snippet": "sys.path.insert(0, os.path.join(CURDIR, '..', 'src'))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99764:Import_L36_C0", "label": "robot import robot", "type": "import", "loc": [36, 36], "level": 0, "parent": null, "vector": [1, 0, 0.3186, 0.0088, 0, 0.66, 0.7333, 735, 0, 1, 0, 0, 735, 0, 0], "semantic": {"name": "robot", "arg_names": [], "import_names": ["robot"], "rhs_call_name": "", "annotation": ""}, "snippet": "import robot"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99764:Assign_L39_C0", "label": "ARGUMENTS = join()", "type": "assigned_variable", "loc": [39, 66], "level": 0, "parent": null, "vector": [14, 0, 0.4646, 0.2478, 0, 0.66, 0.8, 146, 3, 1, 0, 0, 933, 10, 3], "semantic": {"name": "ARGUMENTS", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": "ARGUMENTS = ' '.join('''\n--doc RobotSPFrameworkSPacceptanceSPtests\n--reporttitle RobotSPFrameworkSPTestSPReport\n--logtitle RobotSPFrameworkSPTestSPLog\n--metadata Interpreter:%(INTERPRETER)s\n--metadata Platform:%(PLATFORM)s\n--variable INTERPRETER:%(INTERPRETER)s\n--variable STANDALONE_JYTHON:NO"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99764:FunctionDef_L69_C0", "label": "atests", "type": "function", "loc": [69, 90], "level": 0, "parent": null, "vector": [2, 0, 0.7035, 0.1947, 0, 0.66, 0.8667, 790, 0, 2, 1, 0, 0, 0, 12], "semantic": {"name": "atests", "arg_names": ["interpreter", "params"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def atests(interpreter, *params):\n if os.path.isdir(RESULTDIR):\n shutil.rmtree(RESULTDIR)\n runner = ('jython' in os.path.basename(interpreter) and 'jybot'\n or 'pybot')\n args = ARGUMENTS % {\n 'PYTHONPATH' : os.path.join(CURDIR, 'resources'),\n 'OUTPUTDIR' : RESULTDIR,"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99764:If_L70_C4", "label": "if", "type": "if", "loc": [70, 71], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99764:FunctionDef_L69_C0", "vector": [4, 1, 0.6239, 0.0177, 1, 0.29, 0.0, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if os.path.isdir(RESULTDIR):\n shutil.rmtree(RESULTDIR)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99764:Expr_L71_C8", "label": "rmtree()", "type": "expression", "loc": [71, 71], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99764:If_L70_C4", "vector": [8, 2, 0.6283, 0.0088, 2, 0.66, 0.0, 317, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "rmtree", "arg_names": [], "import_names": [], "rhs_call_name": "rmtree", "annotation": ""}, "snippet": " shutil.rmtree(RESULTDIR)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99764:Assign_L72_C4", "label": "runner =", "type": "assigned_variable", "loc": [72, 73], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99764:FunctionDef_L69_C0", "vector": [14, 1, 0.6416, 0.0177, 1, 0.29, 0.1, 180, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "runner", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " runner = ('jython' in os.path.basename(interpreter) and 'jybot'\n or 'pybot')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99764:Assign_L74_C4", "label": "args =", "type": "assigned_variable", "loc": [74, 80], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99764:FunctionDef_L69_C0", "vector": [14, 1, 0.6814, 0.0619, 1, 0.29, 0.2, 805, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "args", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " args = ARGUMENTS % {\n 'PYTHONPATH' : os.path.join(CURDIR, 'resources'),\n 'OUTPUTDIR' : RESULTDIR,\n 'INTERPRETER': interpreter,\n 'PLATFORM': sys.platform,\n 'RUNNER': runner\n }"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99764:If_L81_C4", "label": "if", "type": "if", "loc": [81, 82], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99764:FunctionDef_L69_C0", "vector": [4, 1, 0.7212, 0.0177, 1, 0.29, 0.3, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if os.name == 'nt':\n args += ' --exclude nonwindows'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99764:If_L83_C4", "label": "if", "type": "if", "loc": [83, 84], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99764:FunctionDef_L69_C0", "vector": [4, 1, 0.7389, 0.0177, 1, 0.29, 0.4, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if sys.platform == 'darwin' and runner == 'pybot':\n args += ' --exclude nonmacpython'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99764:Assign_L85_C4", "label": "runner = join()", "type": "assigned_variable", "loc": [85, 85], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99764:FunctionDef_L69_C0", "vector": [14, 1, 0.7522, 0.0088, 1, 0.29, 0.5, 180, 3, 2, 0, 0, 933, 10, 2], "semantic": {"name": "runner", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": " runner = os.path.join(os.path.dirname(robot.__file__), 'runner.py')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99764:Assign_L86_C4", "label": "command =", "type": "assigned_variable", "loc": [86, 86], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99764:FunctionDef_L69_C0", "vector": [14, 1, 0.7611, 0.0088, 1, 0.29, 0.6, 842, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "command", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " command = '%s %s %s %s' % (sys.executable, runner, args, ' '.join(params))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99764:Expr_L87_C4", "label": "print()", "type": "expression", "loc": [87, 87], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99764:FunctionDef_L69_C0", "vector": [8, 1, 0.7699, 0.0088, 1, 0.29, 0.7, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Running command\\n%s\\n' % command)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99764:Expr_L88_C4", "label": "flush()", "type": "expression", "loc": [88, 88], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99764:FunctionDef_L69_C0", "vector": [8, 1, 0.7788, 0.0088, 1, 0.29, 0.8, 439, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "flush", "arg_names": [], "import_names": [], "rhs_call_name": "flush", "annotation": ""}, "snippet": " sys.stdout.flush()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99764:Expr_L89_C4", "label": "signal()", "type": "expression", "loc": [89, 89], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99764:FunctionDef_L69_C0", "vector": [8, 1, 0.7876, 0.0088, 1, 0.29, 0.9, 621, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "signal", "arg_names": [], "import_names": [], "rhs_call_name": "signal", "annotation": ""}, "snippet": " signal.signal(signal.SIGINT, signal.SIG_IGN)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99764:Return_L90_C4", "label": "return", "type": "return", "loc": [90, 90], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99764:FunctionDef_L69_C0", "vector": [13, 1, 0.7965, 0.0088, 1, 0.29, 1.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return subprocess.call(command.split())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99764:FunctionDef_L93_C0", "label": "buildbot", "type": "function", "loc": [93, 102], "level": 0, "parent": null, "vector": [2, 0, 0.8628, 0.0885, 0, 0.66, 0.9333, 326, 0, 2, 1, 0, 0, 0, 11], "semantic": {"name": "buildbot", "arg_names": ["interpreter", "params"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def buildbot(interpreter, *params):\n params = '--log NONE --report NONE --SplitOutputs 1'.split() + list(params)\n rc = atests(interpreter, *params)\n zippath = os.path.join(RESULTDIR, 'outputs.zip')\n zipfile = ZipFile(zippath, 'w', compression=ZIP_DEFLATED)\n for output in glob.glob(os.path.join(RESULTDIR, '*.xml')):\n zipfile.write(output, os.path.basename(output))\n zipfile.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99764:Assign_L94_C4", "label": "params =", "type": "assigned_variable", "loc": [94, 94], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99764:FunctionDef_L93_C0", "vector": [14, 1, 0.8319, 0.0088, 1, 0.82, 0.0, 206, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "params", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " params = '--log NONE --report NONE --SplitOutputs 1'.split() + list(params)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99764:Assign_L95_C4", "label": "rc = atests()", "type": "assigned_variable", "loc": [95, 95], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99764:FunctionDef_L93_C0", "vector": [14, 1, 0.8407, 0.0088, 1, 0.82, 0.1429, 401, 3, 2, 0, 0, 790, 10, 1], "semantic": {"name": "rc", "arg_names": [], "import_names": [], "rhs_call_name": "atests", "annotation": ""}, "snippet": " rc = atests(interpreter, *params)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99764:Assign_L96_C4", "label": "zippath = join()", "type": "assigned_variable", "loc": [96, 96], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99764:FunctionDef_L93_C0", "vector": [14, 1, 0.8496, 0.0088, 1, 0.82, 0.2857, 868, 3, 2, 0, 0, 933, 10, 1], "semantic": {"name": "zippath", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": " zippath = os.path.join(RESULTDIR, 'outputs.zip')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99764:Assign_L97_C4", "label": "zipfile = ZipFile()", "type": "assigned_variable", "loc": [97, 97], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99764:FunctionDef_L93_C0", "vector": [14, 1, 0.8584, 0.0088, 1, 0.82, 0.4286, 93, 3, 3, 0, 0, 299, 10, 1], "semantic": {"name": "zipfile", "arg_names": [], "import_names": [], "rhs_call_name": "ZipFile", "annotation": ""}, "snippet": " zipfile = ZipFile(zippath, 'w', compression=ZIP_DEFLATED)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99764:For_L98_C4", "label": "for output", "type": "for", "loc": [98, 99], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99764:FunctionDef_L93_C0", "vector": [6, 1, 0.8717, 0.0177, 1, 0.82, 0.5714, 886, 3, 0, 0, 0, 0, 0, 4], "semantic": {"name": "output", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for output in glob.glob(os.path.join(RESULTDIR, '*.xml')):\n zipfile.write(output, os.path.basename(output))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99764:Expr_L99_C8", "label": "write()", "type": "expression", "loc": [99, 99], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99764:For_L98_C4", "vector": [8, 2, 0.8761, 0.0088, 2, 0.27, 0.0, 837, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " zipfile.write(output, os.path.basename(output))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99764:Expr_L100_C4", "label": "close()", "type": "expression", "loc": [100, 100], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99764:FunctionDef_L93_C0", "vector": [8, 1, 0.885, 0.0088, 1, 0.82, 0.7143, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": " zipfile.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99764:Expr_L101_C4", "label": "print()", "type": "expression", "loc": [101, 101], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99764:FunctionDef_L93_C0", "vector": [8, 1, 0.8938, 0.0088, 1, 0.82, 0.8571, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Archive:', zippath)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99764:Return_L102_C4", "label": "return", "type": "return", "loc": [102, 102], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99764:FunctionDef_L93_C0", "vector": [13, 1, 0.9027, 0.0088, 1, 0.82, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return rc"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99764:If_L105_C0", "label": "if", "type": "if", "loc": [105, 113], "level": 0, "parent": null, "vector": [4, 0, 0.9646, 0.0796, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == '__main__':\n if len(sys.argv) == 1 or '--help' in sys.argv:\n print(__doc__)\n rc = 251\n elif sys.argv[1] == 'buildbot':\n rc = buildbot(*sys.argv[2:])\n else:\n rc = atests(*sys.argv[1:])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99764:If_L106_C4", "label": "if", "type": "if", "loc": [106, 112], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99764:If_L105_C0", "vector": [4, 1, 0.9646, 0.0619, 1, 0.41, 0.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(sys.argv) == 1 or '--help' in sys.argv:\n print(__doc__)\n rc = 251\n elif sys.argv[1] == 'buildbot':\n rc = buildbot(*sys.argv[2:])\n else:\n rc = atests(*sys.argv[1:])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99764:Expr_L107_C8", "label": "print()", "type": "expression", "loc": [107, 107], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99764:If_L106_C4", "vector": [8, 2, 0.9469, 0.0088, 2, 0.27, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(__doc__)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99764:Assign_L108_C8", "label": "rc =", "type": "assigned_variable", "loc": [108, 108], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99764:If_L106_C4", "vector": [14, 2, 0.9558, 0.0088, 2, 0.27, 0.5, 401, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "rc", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rc = 251"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99764:If_L109_C4", "label": "if", "type": "if", "loc": [109, 112], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99764:If_L106_C4", "vector": [4, 2, 0.9779, 0.0354, 2, 0.27, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif sys.argv[1] == 'buildbot':\n rc = buildbot(*sys.argv[2:])\n else:\n rc = atests(*sys.argv[1:])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99764:Assign_L110_C8", "label": "rc = buildbot()", "type": "assigned_variable", "loc": [110, 110], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99764:If_L109_C4", "vector": [14, 3, 0.9735, 0.0088, 3, 0.6, 0.0, 401, 3, 1, 0, 0, 326, 10, 1], "semantic": {"name": "rc", "arg_names": [], "import_names": [], "rhs_call_name": "buildbot", "annotation": ""}, "snippet": " rc = buildbot(*sys.argv[2:])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99764:Assign_L112_C8", "label": "rc = atests()", "type": "assigned_variable", "loc": [112, 112], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99764:If_L109_C4", "vector": [14, 3, 0.9912, 0.0088, 3, 0.6, 1.0, 401, 3, 1, 0, 0, 790, 10, 1], "semantic": {"name": "rc", "arg_names": [], "import_names": [], "rhs_call_name": "atests", "annotation": ""}, "snippet": " rc = atests(*sys.argv[1:])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99764:Expr_L113_C4", "label": "exit()", "type": "expression", "loc": [113, 113], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99764:If_L105_C0", "vector": [8, 1, 1.0, 0.0088, 1, 0.41, 1.0, 436, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "exit", "arg_names": [], "import_names": [], "rhs_call_name": "exit", "annotation": ""}, "snippet": " sys.exit(rc)"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99764:FunctionDef_L69_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99764:If_L70_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99764:If_L70_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99764:Expr_L71_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99764:FunctionDef_L69_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99764:Assign_L72_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99764:FunctionDef_L69_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99764:Assign_L74_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99764:FunctionDef_L69_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99764:If_L81_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99764:FunctionDef_L69_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99764:If_L83_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99764:FunctionDef_L69_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99764:Assign_L85_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99764:FunctionDef_L69_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99764:Assign_L86_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99764:FunctionDef_L69_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99764:Expr_L87_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99764:FunctionDef_L69_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99764:Expr_L88_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99764:FunctionDef_L69_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99764:Expr_L89_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99764:FunctionDef_L69_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99764:Return_L90_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99764:FunctionDef_L93_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99764:Assign_L94_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99764:FunctionDef_L93_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99764:Assign_L95_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99764:FunctionDef_L93_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99764:Assign_L96_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99764:FunctionDef_L93_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99764:Assign_L97_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99764:FunctionDef_L93_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99764:For_L98_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99764:For_L98_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99764:Expr_L99_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99764:FunctionDef_L93_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99764:Expr_L100_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99764:FunctionDef_L93_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99764:Expr_L101_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99764:FunctionDef_L93_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99764:Return_L102_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99764:If_L105_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99764:If_L106_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99764:If_L106_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99764:Expr_L107_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99764:If_L106_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99764:Assign_L108_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99764:If_L106_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99764:If_L109_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99764:If_L109_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99764:Assign_L110_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99764:If_L109_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99764:Assign_L112_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99764:If_L105_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99764:Expr_L113_C4"}] |
import subprocess
import os
import signal
import ctypes
import time
class ProcessManager(object):
def __init__(self):
self._process = None
self._stdout = ''
self._stderr = ''
def start_process(self, *args):
args = args[0].split() + list(args[1:])
self._process = subprocess.Popen(args, stderr=subprocess.PIPE,
stdout=subprocess.PIPE)
self._stdout = ''
self._stderr = ''
def send_terminate(self, signal_name):
if os.name != 'nt':
os.kill(self._process.pid, getattr(signal, signal_name))
else:
self._set_handler_to_ignore_one_sigint()
ctypes.windll.kernel32.GenerateConsoleCtrlEvent(0, 0)
def _set_handler_to_ignore_one_sigint(self):
orig_handler = signal.getsignal(signal.SIGINT)
signal.signal(signal.SIGINT, lambda signum, frame:
signal.signal(signal.SIGINT, orig_handler))
def get_stdout(self):
self.wait_until_finished()
return self._stdout
def get_stderr(self):
self.wait_until_finished()
return self._stderr
def log_stdout_and_stderr(self):
print "stdout: ", self._process.stdout.read()
print "stderr: ", self._process.stderr.read()
def wait_until_finished(self):
if self._process.returncode is None:
self._stdout, self._stderr = self._process.communicate()
def busy_sleep(self, seconds):
max_time = time.time() + int(seconds)
while time.time() < max_time:
pass
def get_jython_path(self):
jython_home = os.getenv('JYTHON_HOME')
if not jython_home:
raise RuntimeError('This test requires JYTHON_HOME environment variable to be set.')
return '%s -Dpython.home=%s -classpath %s org.python.util.jython' \
% (self._get_java(), jython_home, self._get_classpath(jython_home))
def _get_java(self):
java_home = os.getenv('JAVA_HOME')
if not java_home:
return 'java'
if java_home.startswith('"') and java_home.endswith('"'):
java_home = java_home[1:-1]
return os.path.join(java_home, 'bin', 'java')
def _get_classpath(self, jython_home):
jython_jar = os.path.join(jython_home, 'jython.jar')
return jython_jar + os.pathsep + os.getenv('CLASSPATH','')
| ajibawa-2023/Python-Code-Large/train/row_99765 | 52 | 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_99765:Import_L1_C0", "label": "subprocess import subprocess", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0137, 0.0137, 0, 0.66, 0.0, 394, 0, 1, 0, 0, 394, 0, 0], "semantic": {"name": "subprocess", "arg_names": [], "import_names": ["subprocess"], "rhs_call_name": "", "annotation": ""}, "snippet": "import subprocess"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99765:Import_L2_C0", "label": "os import os", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0274, 0.0137, 0, 0.66, 0.2, 688, 0, 1, 0, 0, 688, 0, 0], "semantic": {"name": "os", "arg_names": [], "import_names": ["os"], "rhs_call_name": "", "annotation": ""}, "snippet": "import os"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99765:Import_L3_C0", "label": "signal import signal", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0411, 0.0137, 0, 0.66, 0.4, 621, 0, 1, 0, 0, 621, 0, 0], "semantic": {"name": "signal", "arg_names": [], "import_names": ["signal"], "rhs_call_name": "", "annotation": ""}, "snippet": "import signal"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99765:Import_L4_C0", "label": "ctypes import ctypes", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0548, 0.0137, 0, 0.66, 0.6, 182, 0, 1, 0, 0, 182, 0, 0], "semantic": {"name": "ctypes", "arg_names": [], "import_names": ["ctypes"], "rhs_call_name": "", "annotation": ""}, "snippet": "import ctypes"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99765:Import_L5_C0", "label": "time import time", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0685, 0.0137, 0, 0.66, 0.8, 654, 0, 1, 0, 0, 654, 0, 0], "semantic": {"name": "time", "arg_names": [], "import_names": ["time"], "rhs_call_name": "", "annotation": ""}, "snippet": "import time"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99765:ClassDef_L8_C0", "label": "ProcessManager", "type": "class", "loc": [8, 72], "level": 0, "parent": null, "vector": [3, 0, 0.5479, 0.8904, 0, 0.66, 1.0, 897, 0, 12, 0, 0, 186, 0, 30], "semantic": {"name": "ProcessManager", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class ProcessManager(object):\n\n def __init__(self):\n self._process = None\n self._stdout = ''\n self._stderr = ''\n\n def start_process(self, *args):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99765:FunctionDef_L10_C4", "label": "__init__", "type": "function", "loc": [10, 13], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99765:ClassDef_L8_C0", "vector": [2, 1, 0.1575, 0.0548, 1, 0.41, 0.0, 555, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self):\n self._process = None\n self._stdout = ''\n self._stderr = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99765:Assign_L11_C8", "label": "self._process =", "type": "assigned_variable", "loc": [11, 11], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99765:FunctionDef_L10_C4", "vector": [14, 2, 0.1507, 0.0137, 2, 0.63, 0.0, 594, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self._process", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._process = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99765:Assign_L12_C8", "label": "self._stdout =", "type": "assigned_variable", "loc": [12, 12], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99765:FunctionDef_L10_C4", "vector": [14, 2, 0.1644, 0.0137, 2, 0.63, 0.5, 665, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "self._stdout", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._stdout = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99765:Assign_L13_C8", "label": "self._stderr =", "type": "assigned_variable", "loc": [13, 13], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99765:FunctionDef_L10_C4", "vector": [14, 2, 0.1781, 0.0137, 2, 0.63, 1.0, 425, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "self._stderr", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._stderr = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99765:FunctionDef_L15_C4", "label": "start_process", "type": "function", "loc": [15, 20], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99765:ClassDef_L8_C0", "vector": [2, 1, 0.2397, 0.0822, 1, 0.41, 0.0909, 106, 0, 2, 0, 0, 0, 0, 3], "semantic": {"name": "start_process", "arg_names": ["self", "args"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def start_process(self, *args):\n args = args[0].split() + list(args[1:])\n self._process = subprocess.Popen(args, stderr=subprocess.PIPE, \n stdout=subprocess.PIPE)\n self._stdout = ''\n self._stderr = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99765:Assign_L16_C8", "label": "args =", "type": "assigned_variable", "loc": [16, 16], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99765:FunctionDef_L15_C4", "vector": [14, 2, 0.2192, 0.0137, 2, 0.87, 0.0, 805, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "args", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " args = args[0].split() + list(args[1:])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99765:Assign_L17_C8", "label": "self._process = Popen()", "type": "assigned_variable", "loc": [17, 18], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99765:FunctionDef_L15_C4", "vector": [14, 2, 0.2397, 0.0274, 2, 0.87, 0.3333, 594, 3, 3, 0, 0, 568, 10, 1], "semantic": {"name": "self._process", "arg_names": [], "import_names": [], "rhs_call_name": "Popen", "annotation": ""}, "snippet": " self._process = subprocess.Popen(args, stderr=subprocess.PIPE, \n stdout=subprocess.PIPE)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99765:Assign_L19_C8", "label": "self._stdout =", "type": "assigned_variable", "loc": [19, 19], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99765:FunctionDef_L15_C4", "vector": [14, 2, 0.2603, 0.0137, 2, 0.87, 0.6667, 665, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "self._stdout", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._stdout = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99765:Assign_L20_C8", "label": "self._stderr =", "type": "assigned_variable", "loc": [20, 20], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99765:FunctionDef_L15_C4", "vector": [14, 2, 0.274, 0.0137, 2, 0.87, 1.0, 425, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "self._stderr", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._stderr = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99765:FunctionDef_L22_C4", "label": "send_terminate", "type": "function", "loc": [22, 27], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99765:ClassDef_L8_C0", "vector": [2, 1, 0.3356, 0.0822, 1, 0.41, 0.1818, 225, 0, 2, 0, 0, 0, 0, 4], "semantic": {"name": "send_terminate", "arg_names": ["self", "signal_name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def send_terminate(self, signal_name):\n if os.name != 'nt':\n os.kill(self._process.pid, getattr(signal, signal_name))\n else:\n self._set_handler_to_ignore_one_sigint()\n ctypes.windll.kernel32.GenerateConsoleCtrlEvent(0, 0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99765:If_L23_C8", "label": "if", "type": "if", "loc": [23, 27], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99765:FunctionDef_L22_C4", "vector": [4, 2, 0.3425, 0.0685, 2, 0.88, 0.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if os.name != 'nt':\n os.kill(self._process.pid, getattr(signal, signal_name))\n else:\n self._set_handler_to_ignore_one_sigint()\n ctypes.windll.kernel32.GenerateConsoleCtrlEvent(0, 0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99765:Expr_L24_C12", "label": "kill()", "type": "expression", "loc": [24, 24], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99765:If_L23_C8", "vector": [8, 3, 0.3288, 0.0137, 3, 0.83, 0.0, 173, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "kill", "arg_names": [], "import_names": [], "rhs_call_name": "kill", "annotation": ""}, "snippet": " os.kill(self._process.pid, getattr(signal, signal_name))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99765:Expr_L26_C12", "label": "_set_handler_to_ignore_one_sigint()", "type": "expression", "loc": [26, 26], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99765:If_L23_C8", "vector": [8, 3, 0.3562, 0.0137, 3, 0.83, 0.5, 473, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_set_handler_to_ignore_one_sigint", "arg_names": [], "import_names": [], "rhs_call_name": "_set_handler_to_ignore_one_sigint", "annotation": ""}, "snippet": " self._set_handler_to_ignore_one_sigint()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99765:Expr_L27_C12", "label": "GenerateConsoleCtrlEvent()", "type": "expression", "loc": [27, 27], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99765:If_L23_C8", "vector": [8, 3, 0.3699, 0.0137, 3, 0.83, 1.0, 148, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "GenerateConsoleCtrlEvent", "arg_names": [], "import_names": [], "rhs_call_name": "GenerateConsoleCtrlEvent", "annotation": ""}, "snippet": " ctypes.windll.kernel32.GenerateConsoleCtrlEvent(0, 0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99765:FunctionDef_L29_C4", "label": "_set_handler_to_ignore_one_sigint", "type": "function", "loc": [29, 32], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99765:ClassDef_L8_C0", "vector": [2, 1, 0.4178, 0.0548, 1, 0.41, 0.2727, 473, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "_set_handler_to_ignore_one_sigint", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _set_handler_to_ignore_one_sigint(self):\n orig_handler = signal.getsignal(signal.SIGINT)\n signal.signal(signal.SIGINT, lambda signum, frame:\n signal.signal(signal.SIGINT, orig_handler))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99765:Assign_L30_C8", "label": "orig_handler = getsignal()", "type": "assigned_variable", "loc": [30, 30], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99765:FunctionDef_L29_C4", "vector": [14, 2, 0.411, 0.0137, 2, 0.95, 0.0, 399, 3, 1, 0, 0, 130, 10, 1], "semantic": {"name": "orig_handler", "arg_names": [], "import_names": [], "rhs_call_name": "getsignal", "annotation": ""}, "snippet": " orig_handler = signal.getsignal(signal.SIGINT)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99765:Expr_L31_C8", "label": "signal()", "type": "expression", "loc": [31, 32], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99765:FunctionDef_L29_C4", "vector": [8, 2, 0.4315, 0.0274, 2, 0.95, 1.0, 621, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "signal", "arg_names": [], "import_names": [], "rhs_call_name": "signal", "annotation": ""}, "snippet": " signal.signal(signal.SIGINT, lambda signum, frame:\n signal.signal(signal.SIGINT, orig_handler))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99765:FunctionDef_L34_C4", "label": "get_stdout", "type": "function", "loc": [34, 36], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99765:ClassDef_L8_C0", "vector": [2, 1, 0.4795, 0.0411, 1, 0.41, 0.3636, 98, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "get_stdout", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_stdout(self):\n self.wait_until_finished()\n return self._stdout"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99765:Expr_L35_C8", "label": "wait_until_finished()", "type": "expression", "loc": [35, 35], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99765:FunctionDef_L34_C4", "vector": [8, 2, 0.4795, 0.0137, 2, 0.85, 0.0, 819, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "wait_until_finished", "arg_names": [], "import_names": [], "rhs_call_name": "wait_until_finished", "annotation": ""}, "snippet": " self.wait_until_finished()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99765:Return_L36_C8", "label": "return", "type": "return", "loc": [36, 36], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99765:FunctionDef_L34_C4", "vector": [13, 2, 0.4932, 0.0137, 2, 0.85, 1.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._stdout"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99765:FunctionDef_L38_C4", "label": "get_stderr", "type": "function", "loc": [38, 40], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99765:ClassDef_L8_C0", "vector": [2, 1, 0.5342, 0.0411, 1, 0.41, 0.4545, 114, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "get_stderr", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_stderr(self):\n self.wait_until_finished()\n return self._stderr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99765:Expr_L39_C8", "label": "wait_until_finished()", "type": "expression", "loc": [39, 39], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99765:FunctionDef_L38_C4", "vector": [8, 2, 0.5342, 0.0137, 2, 0.38, 0.0, 819, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "wait_until_finished", "arg_names": [], "import_names": [], "rhs_call_name": "wait_until_finished", "annotation": ""}, "snippet": " self.wait_until_finished()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99765:Return_L40_C8", "label": "return", "type": "return", "loc": [40, 40], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99765:FunctionDef_L38_C4", "vector": [13, 2, 0.5479, 0.0137, 2, 0.38, 1.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._stderr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99765:FunctionDef_L42_C4", "label": "log_stdout_and_stderr", "type": "function", "loc": [42, 44], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99765:ClassDef_L8_C0", "vector": [2, 1, 0.589, 0.0411, 1, 0.41, 0.5455, 34, 0, 1, 0, 0, 0, 0, 4], "semantic": {"name": "log_stdout_and_stderr", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def log_stdout_and_stderr(self):\n print(\"stdout: \", self._process.stdout.read())\n print(\"stderr: \", self._process.stderr.read())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99765:Expr_L43_C8", "label": "print()", "type": "expression", "loc": [43, 43], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99765:FunctionDef_L42_C4", "vector": [8, 2, 0.589, 0.0137, 2, 0.9, 0.0, 535, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"stdout: \", self._process.stdout.read())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99765:Expr_L44_C8", "label": "print()", "type": "expression", "loc": [44, 44], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99765:FunctionDef_L42_C4", "vector": [8, 2, 0.6027, 0.0137, 2, 0.9, 1.0, 535, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"stderr: \", self._process.stderr.read())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99765:FunctionDef_L46_C4", "label": "wait_until_finished", "type": "function", "loc": [46, 48], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99765:ClassDef_L8_C0", "vector": [2, 1, 0.6438, 0.0411, 1, 0.41, 0.6364, 819, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "wait_until_finished", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def wait_until_finished(self):\n if self._process.returncode is None:\n self._stdout, self._stderr = self._process.communicate()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99765:If_L47_C8", "label": "if", "type": "if", "loc": [47, 48], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99765:FunctionDef_L46_C4", "vector": [4, 2, 0.6507, 0.0274, 2, 0.7, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self._process.returncode is None:\n self._stdout, self._stderr = self._process.communicate()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99765:Assign_L48_C12", "label": " = communicate()", "type": "assigned_variable", "loc": [48, 48], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99765:If_L47_C8", "vector": [14, 3, 0.6575, 0.0137, 3, 0.02, 0.0, 0, 3, 0, 0, 0, 768, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "communicate", "annotation": ""}, "snippet": " self._stdout, self._stderr = self._process.communicate()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99765:FunctionDef_L50_C4", "label": "busy_sleep", "type": "function", "loc": [50, 53], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99765:ClassDef_L8_C0", "vector": [2, 1, 0.7055, 0.0548, 1, 0.41, 0.7273, 131, 0, 2, 0, 0, 0, 0, 3], "semantic": {"name": "busy_sleep", "arg_names": ["self", "seconds"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def busy_sleep(self, seconds):\n max_time = time.time() + int(seconds)\n while time.time() < max_time:\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99765:Assign_L51_C8", "label": "max_time =", "type": "assigned_variable", "loc": [51, 51], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99765:FunctionDef_L50_C4", "vector": [14, 2, 0.6986, 0.0137, 2, 0.31, 0.0, 334, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "max_time", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " max_time = time.time() + int(seconds)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99765:While_L52_C8", "label": "while", "type": "while", "loc": [52, 53], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99765:FunctionDef_L50_C4", "vector": [5, 2, 0.7192, 0.0274, 2, 0.31, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while time.time() < max_time:\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99765:FunctionDef_L55_C4", "label": "get_jython_path", "type": "function", "loc": [55, 60], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99765:ClassDef_L8_C0", "vector": [2, 1, 0.7877, 0.0822, 1, 0.41, 0.8182, 169, 0, 1, 1, 0, 0, 0, 4], "semantic": {"name": "get_jython_path", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_jython_path(self):\n jython_home = os.getenv('JYTHON_HOME')\n if not jython_home:\n raise RuntimeError('This test requires JYTHON_HOME environment variable to be set.')\n return '%s -Dpython.home=%s -classpath %s org.python.util.jython' \\\n % (self._get_java(), jython_home, self._get_classpath(jython_home))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99765:Assign_L56_C8", "label": "jython_home = getenv()", "type": "assigned_variable", "loc": [56, 56], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99765:FunctionDef_L55_C4", "vector": [14, 2, 0.7671, 0.0137, 2, 0.22, 0.0, 180, 3, 1, 0, 0, 611, 10, 1], "semantic": {"name": "jython_home", "arg_names": [], "import_names": [], "rhs_call_name": "getenv", "annotation": ""}, "snippet": " jython_home = os.getenv('JYTHON_HOME')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99765:If_L57_C8", "label": "if", "type": "if", "loc": [57, 58], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99765:FunctionDef_L55_C4", "vector": [4, 2, 0.7877, 0.0274, 2, 0.22, 0.5, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not jython_home:\n raise RuntimeError('This test requires JYTHON_HOME environment variable to be set.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99765:Return_L59_C8", "label": "return", "type": "return", "loc": [59, 60], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99765:FunctionDef_L55_C4", "vector": [13, 2, 0.8151, 0.0274, 2, 0.22, 1.0, 0, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return '%s -Dpython.home=%s -classpath %s org.python.util.jython' \\\n % (self._get_java(), jython_home, self._get_classpath(jython_home))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99765:FunctionDef_L62_C4", "label": "_get_java", "type": "function", "loc": [62, 68], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99765:ClassDef_L8_C0", "vector": [2, 1, 0.8904, 0.0959, 1, 0.41, 0.9091, 852, 0, 1, 1, 0, 0, 0, 4], "semantic": {"name": "_get_java", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _get_java(self):\n java_home = os.getenv('JAVA_HOME')\n if not java_home:\n return 'java'\n if java_home.startswith('\"') and java_home.endswith('\"'):\n java_home = java_home[1:-1]\n return os.path.join(java_home, 'bin', 'java')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99765:Assign_L63_C8", "label": "java_home = getenv()", "type": "assigned_variable", "loc": [63, 63], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99765:FunctionDef_L62_C4", "vector": [14, 2, 0.863, 0.0137, 2, 0.62, 0.0, 252, 3, 1, 0, 0, 611, 10, 1], "semantic": {"name": "java_home", "arg_names": [], "import_names": [], "rhs_call_name": "getenv", "annotation": ""}, "snippet": " java_home = os.getenv('JAVA_HOME')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99765:If_L64_C8", "label": "if", "type": "if", "loc": [64, 65], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99765:FunctionDef_L62_C4", "vector": [4, 2, 0.8836, 0.0274, 2, 0.62, 0.3333, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not java_home:\n return 'java'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99765:Return_L65_C12", "label": "return", "type": "return", "loc": [65, 65], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99765:If_L64_C8", "vector": [13, 3, 0.8904, 0.0137, 3, 0.25, 0.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 'java'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99765:If_L66_C8", "label": "if", "type": "if", "loc": [66, 67], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99765:FunctionDef_L62_C4", "vector": [4, 2, 0.911, 0.0274, 2, 0.62, 0.6667, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if java_home.startswith('\"') and java_home.endswith('\"'):\n java_home = java_home[1:-1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99765:Assign_L67_C12", "label": "java_home =", "type": "assigned_variable", "loc": [67, 67], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99765:If_L66_C8", "vector": [14, 3, 0.9178, 0.0137, 3, 0.15, 0.0, 252, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "java_home", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " java_home = java_home[1:-1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99765:Return_L68_C8", "label": "return", "type": "return", "loc": [68, 68], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99765:FunctionDef_L62_C4", "vector": [13, 2, 0.9315, 0.0137, 2, 0.62, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return os.path.join(java_home, 'bin', 'java')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99765:FunctionDef_L70_C4", "label": "_get_classpath", "type": "function", "loc": [70, 72], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99765:ClassDef_L8_C0", "vector": [2, 1, 0.9726, 0.0411, 1, 0.41, 1.0, 508, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "_get_classpath", "arg_names": ["self", "jython_home"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _get_classpath(self, jython_home):\n jython_jar = os.path.join(jython_home, 'jython.jar')\n return jython_jar + os.pathsep + os.getenv('CLASSPATH','')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99765:Assign_L71_C8", "label": "jython_jar = join()", "type": "assigned_variable", "loc": [71, 71], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99765:FunctionDef_L70_C4", "vector": [14, 2, 0.9726, 0.0137, 2, 0.89, 0.0, 672, 3, 2, 0, 0, 933, 10, 1], "semantic": {"name": "jython_jar", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": " jython_jar = os.path.join(jython_home, 'jython.jar')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99765:Return_L72_C8", "label": "return", "type": "return", "loc": [72, 72], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99765:FunctionDef_L70_C4", "vector": [13, 2, 0.9863, 0.0137, 2, 0.89, 1.0, 0, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return jython_jar + os.pathsep + os.getenv('CLASSPATH','')"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99765:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99765:FunctionDef_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99765:FunctionDef_L10_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99765:Assign_L11_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99765:FunctionDef_L10_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99765:Assign_L12_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99765:FunctionDef_L10_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99765:Assign_L13_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99765:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99765:FunctionDef_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99765:FunctionDef_L15_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99765:Assign_L16_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99765:FunctionDef_L15_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99765:Assign_L17_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99765:FunctionDef_L15_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99765:Assign_L19_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99765:FunctionDef_L15_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99765:Assign_L20_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99765:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99765:FunctionDef_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99765:FunctionDef_L22_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99765:If_L23_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99765:If_L23_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99765:Expr_L24_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99765:If_L23_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99765:Expr_L26_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99765:If_L23_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99765:Expr_L27_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99765:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99765:FunctionDef_L29_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99765:FunctionDef_L29_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99765:Assign_L30_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99765:FunctionDef_L29_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99765:Expr_L31_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99765:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99765:FunctionDef_L34_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99765:FunctionDef_L34_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99765:Expr_L35_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99765:FunctionDef_L34_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99765:Return_L36_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99765:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99765:FunctionDef_L38_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99765:FunctionDef_L38_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99765:Expr_L39_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99765:FunctionDef_L38_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99765:Return_L40_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99765:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99765:FunctionDef_L42_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99765:FunctionDef_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99765:Expr_L43_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99765:FunctionDef_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99765:Expr_L44_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99765:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99765:FunctionDef_L46_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99765:FunctionDef_L46_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99765:If_L47_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99765:If_L47_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99765:Assign_L48_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99765:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99765:FunctionDef_L50_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99765:FunctionDef_L50_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99765:Assign_L51_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99765:FunctionDef_L50_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99765:While_L52_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99765:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99765:FunctionDef_L55_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99765:FunctionDef_L55_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99765:Assign_L56_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99765:FunctionDef_L55_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99765:If_L57_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99765:FunctionDef_L55_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99765:Return_L59_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99765:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99765:FunctionDef_L62_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99765:FunctionDef_L62_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99765:Assign_L63_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99765:FunctionDef_L62_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99765:If_L64_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99765:If_L64_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99765:Return_L65_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99765:FunctionDef_L62_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99765:If_L66_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99765:If_L66_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99765:Assign_L67_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99765:FunctionDef_L62_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99765:Return_L68_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99765:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99765:FunctionDef_L70_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99765:FunctionDef_L70_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99765:Assign_L71_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99765:FunctionDef_L70_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99765:Return_L72_C8"}] |
from robot.libraries.BuiltIn import BuiltIn
BIN = BuiltIn()
def start_keyword(*args):
if BIN.get_variables()['${TESTNAME}'] == 'Listener Using BuiltIn':
BIN.set_test_variable('${SET BY LISTENER}', 'quux')
| ajibawa-2023/Python-Code-Large/train/row_99766 | 5 | 9 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99766:ImportFrom_L1_C0", "label": "from robot.libraries.BuiltIn import BuiltIn", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.1111, 0.1111, 0, 0.66, 0.0, 588, 0, 1, 0, 0, 588, 0, 0], "semantic": {"name": "robot.libraries.BuiltIn", "arg_names": [], "import_names": ["BuiltIn"], "rhs_call_name": "", "annotation": ""}, "snippet": "from robot.libraries.BuiltIn import BuiltIn"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99766:Assign_L3_C0", "label": "BIN = BuiltIn()", "type": "assigned_variable", "loc": [3, 3], "level": 0, "parent": null, "vector": [14, 0, 0.3333, 0.1111, 0, 0.66, 0.5, 831, 3, 0, 0, 0, 961, 10, 1], "semantic": {"name": "BIN", "arg_names": [], "import_names": [], "rhs_call_name": "BuiltIn", "annotation": ""}, "snippet": "BIN = BuiltIn()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99766:FunctionDef_L6_C0", "label": "start_keyword", "type": "function", "loc": [6, 8], "level": 0, "parent": null, "vector": [2, 0, 0.7778, 0.3333, 0, 0.66, 1.0, 776, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "start_keyword", "arg_names": ["args"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def start_keyword(*args):\n if BIN.get_variables()['${TESTNAME}'] == 'Listener Using BuiltIn':\n BIN.set_test_variable('${SET BY LISTENER}', 'quux')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99766:If_L7_C4", "label": "if", "type": "if", "loc": [7, 8], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99766:FunctionDef_L6_C0", "vector": [4, 1, 0.8333, 0.2222, 1, 0.54, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if BIN.get_variables()['${TESTNAME}'] == 'Listener Using BuiltIn':\n BIN.set_test_variable('${SET BY LISTENER}', 'quux')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99766:Expr_L8_C8", "label": "set_test_variable()", "type": "expression", "loc": [8, 8], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99766:If_L7_C4", "vector": [8, 2, 0.8889, 0.1111, 2, 0.98, 0.0, 556, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "set_test_variable", "arg_names": [], "import_names": [], "rhs_call_name": "set_test_variable", "annotation": ""}, "snippet": " BIN.set_test_variable('${SET BY LISTENER}', 'quux')"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99766:FunctionDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99766:If_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99766:If_L7_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99766:Expr_L8_C8"}] |
import os
import tempfile
import time
class ListenAll:
ROBOT_LISTENER_API_VERSION = '2'
def __init__(self, *path):
if not path:
path = os.path.join(tempfile.gettempdir(), 'listen_all.txt')
else:
path = ':'.join(path)
self.outfile = open(path, 'w')
def start_suite(self, name, attrs):
metastr = ' '.join(['%s: %s' % (k, v) for k, v
in attrs['metadata'].items()])
self.outfile.write("SUITE START: %s '%s' [%s]\n"
% (name, attrs['doc'], metastr))
def start_test(self, name, attrs):
tags = [ str(tag) for tag in attrs['tags'] ]
self.outfile.write("TEST START: %s '%s' %s\n" % (name, attrs['doc'], tags))
def start_keyword(self, name, attrs):
args = [ str(arg) for arg in attrs['args'] ]
self.outfile.write("KW START: %s %s\n" % (name, args))
def log_message(self, message):
msg, level = self._check_message_validity(message)
if level != 'TRACE' and 'Traceback' not in msg:
self.outfile.write('LOG MESSAGE: [%s] %s\n' % (level, msg))
def message(self, message):
msg, level = self._check_message_validity(message)
if 'Settings' in msg:
self.outfile.write('Got settings on level: %s\n' % level)
def _check_message_validity(self, message):
if message['html'] not in ['yes', 'no']:
self.outfile.write('Log message has invalid `html` attribute %s' %
message['html'])
if not message['timestamp'].startswith(str(time.localtime()[0])):
self.outfile.write('Log message has invalid timestamp %s' %
message['timestamp'])
return message['message'], message['level']
def end_keyword(self, name, attrs):
self.outfile.write("KW END: %s\n" % (attrs['status']))
def end_test(self, name, attrs):
if attrs['status'] == 'PASS':
self.outfile.write('TEST END: PASS\n')
else:
self.outfile.write("TEST END: %s %s\n"
% (attrs['status'], attrs['message']))
def end_suite(self, name, attrs):
self.outfile.write('SUITE END: %s %s\n'
% (attrs['status'], attrs['statistics']))
def output_file(self, path):
self._out_file('Output', path)
def report_file(self, path):
self._out_file('Report', path)
def log_file(self, path):
self._out_file('Log', path)
def debug_file(self, path):
self._out_file('Debug', path)
def _out_file(self, name, path):
assert os.path.isabs(path)
self.outfile.write('%s: %s\n' % (name, os.path.basename(path)))
def close(self):
self.outfile.write('Closing...\n')
self.outfile.close()
| ajibawa-2023/Python-Code-Large/train/row_99767 | 54 | 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_99767:Import_L1_C0", "label": "os import os", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0122, 0.0122, 0, 0.66, 0.0, 688, 0, 1, 0, 0, 688, 0, 0], "semantic": {"name": "os", "arg_names": [], "import_names": ["os"], "rhs_call_name": "", "annotation": ""}, "snippet": "import os"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99767:Import_L2_C0", "label": "tempfile import tempfile", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0244, 0.0122, 0, 0.66, 0.3333, 516, 0, 1, 0, 0, 516, 0, 0], "semantic": {"name": "tempfile", "arg_names": [], "import_names": ["tempfile"], "rhs_call_name": "", "annotation": ""}, "snippet": "import tempfile"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99767:Import_L3_C0", "label": "time import time", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0366, 0.0122, 0, 0.66, 0.6667, 654, 0, 1, 0, 0, 654, 0, 0], "semantic": {"name": "time", "arg_names": [], "import_names": ["time"], "rhs_call_name": "", "annotation": ""}, "snippet": "import time"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99767:ClassDef_L6_C0", "label": "ListenAll", "type": "class", "loc": [6, 82], "level": 0, "parent": null, "vector": [3, 0, 0.5366, 0.939, 0, 0.66, 1.0, 903, 0, 16, 0, 0, 0, 0, 33], "semantic": {"name": "ListenAll", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class ListenAll:\n\n ROBOT_LISTENER_API_VERSION = '2'\n\n def __init__(self, *path):\n if not path:\n path = os.path.join(tempfile.gettempdir(), 'listen_all.txt')\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99767:Assign_L8_C4", "label": "ROBOT_LISTENER_API_VERSION =", "type": "assigned_variable", "loc": [8, 8], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99767:ClassDef_L6_C0", "vector": [14, 1, 0.0976, 0.0122, 1, 0.08, 0.0, 63, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "ROBOT_LISTENER_API_VERSION", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ROBOT_LISTENER_API_VERSION = '2'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99767:FunctionDef_L10_C4", "label": "__init__", "type": "function", "loc": [10, 15], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99767:ClassDef_L6_C0", "vector": [2, 1, 0.1524, 0.0732, 1, 0.08, 0.0625, 555, 0, 2, 0, 0, 0, 0, 4], "semantic": {"name": "__init__", "arg_names": ["self", "path"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, *path):\n if not path:\n path = os.path.join(tempfile.gettempdir(), 'listen_all.txt')\n else:\n path = ':'.join(path)\n self.outfile = open(path, 'w')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99767:If_L11_C8", "label": "if", "type": "if", "loc": [11, 14], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99767:FunctionDef_L10_C4", "vector": [4, 2, 0.1524, 0.0488, 2, 0.27, 0.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not path:\n path = os.path.join(tempfile.gettempdir(), 'listen_all.txt')\n else:\n path = ':'.join(path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99767:Assign_L12_C12", "label": "path = join()", "type": "assigned_variable", "loc": [12, 12], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99767:If_L11_C8", "vector": [14, 3, 0.1463, 0.0122, 3, 0.36, 0.0, 358, 3, 2, 0, 0, 933, 10, 2], "semantic": {"name": "path", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": " path = os.path.join(tempfile.gettempdir(), 'listen_all.txt')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99767:Assign_L14_C12", "label": "path = join()", "type": "assigned_variable", "loc": [14, 14], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99767:If_L11_C8", "vector": [14, 3, 0.1707, 0.0122, 3, 0.36, 1.0, 358, 3, 1, 0, 0, 933, 10, 1], "semantic": {"name": "path", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": " path = ':'.join(path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99767:Assign_L15_C8", "label": "self.outfile = open()", "type": "assigned_variable", "loc": [15, 15], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99767:FunctionDef_L10_C4", "vector": [14, 2, 0.1829, 0.0122, 2, 0.27, 1.0, 579, 3, 2, 0, 0, 693, 10, 1], "semantic": {"name": "self.outfile", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": " self.outfile = open(path, 'w')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99767:FunctionDef_L17_C4", "label": "start_suite", "type": "function", "loc": [17, 21], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99767:ClassDef_L6_C0", "vector": [2, 1, 0.2317, 0.061, 1, 0.08, 0.125, 38, 0, 3, 0, 0, 0, 0, 3], "semantic": {"name": "start_suite", "arg_names": ["self", "name", "attrs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def start_suite(self, name, attrs):\n metastr = ' '.join(['%s: %s' % (k, v) for k, v\n in attrs['metadata'].items()])\n self.outfile.write(\"SUITE START: %s '%s' [%s]\\n\"\n % (name, attrs['doc'], metastr))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99767:Assign_L18_C8", "label": "metastr = join()", "type": "assigned_variable", "loc": [18, 19], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99767:FunctionDef_L17_C4", "vector": [14, 2, 0.2256, 0.0244, 2, 0.05, 0.0, 957, 3, 1, 0, 0, 933, 10, 2], "semantic": {"name": "metastr", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": " metastr = ' '.join(['%s: %s' % (k, v) for k, v\n in attrs['metadata'].items()])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99767:Expr_L20_C8", "label": "write()", "type": "expression", "loc": [20, 21], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99767:FunctionDef_L17_C4", "vector": [8, 2, 0.25, 0.0244, 2, 0.05, 1.0, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " self.outfile.write(\"SUITE START: %s '%s' [%s]\\n\"\n % (name, attrs['doc'], metastr))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99767:FunctionDef_L23_C4", "label": "start_test", "type": "function", "loc": [23, 25], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99767:ClassDef_L6_C0", "vector": [2, 1, 0.2927, 0.0366, 1, 0.08, 0.1875, 246, 0, 3, 0, 0, 0, 0, 2], "semantic": {"name": "start_test", "arg_names": ["self", "name", "attrs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def start_test(self, name, attrs):\n tags = [ str(tag) for tag in attrs['tags'] ]\n self.outfile.write(\"TEST START: %s '%s' %s\\n\" % (name, attrs['doc'], tags))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99767:Assign_L24_C8", "label": "tags =", "type": "assigned_variable", "loc": [24, 24], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99767:FunctionDef_L23_C4", "vector": [14, 2, 0.2927, 0.0122, 2, 0.94, 0.0, 487, 5, 0, 0, 0, 0, 0, 1], "semantic": {"name": "tags", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tags = [ str(tag) for tag in attrs['tags'] ]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99767:Expr_L25_C8", "label": "write()", "type": "expression", "loc": [25, 25], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99767:FunctionDef_L23_C4", "vector": [8, 2, 0.3049, 0.0122, 2, 0.94, 1.0, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " self.outfile.write(\"TEST START: %s '%s' %s\\n\" % (name, attrs['doc'], tags))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99767:FunctionDef_L27_C4", "label": "start_keyword", "type": "function", "loc": [27, 29], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99767:ClassDef_L6_C0", "vector": [2, 1, 0.3415, 0.0366, 1, 0.08, 0.25, 776, 0, 3, 0, 0, 0, 0, 2], "semantic": {"name": "start_keyword", "arg_names": ["self", "name", "attrs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def start_keyword(self, name, attrs):\n args = [ str(arg) for arg in attrs['args'] ]\n self.outfile.write(\"KW START: %s %s\\n\" % (name, args))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99767:Assign_L28_C8", "label": "args =", "type": "assigned_variable", "loc": [28, 28], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99767:FunctionDef_L27_C4", "vector": [14, 2, 0.3415, 0.0122, 2, 0.25, 0.0, 805, 5, 0, 0, 0, 0, 0, 1], "semantic": {"name": "args", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " args = [ str(arg) for arg in attrs['args'] ]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99767:Expr_L29_C8", "label": "write()", "type": "expression", "loc": [29, 29], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99767:FunctionDef_L27_C4", "vector": [8, 2, 0.3537, 0.0122, 2, 0.25, 1.0, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " self.outfile.write(\"KW START: %s %s\\n\" % (name, args))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99767:FunctionDef_L31_C4", "label": "log_message", "type": "function", "loc": [31, 34], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99767:ClassDef_L6_C0", "vector": [2, 1, 0.3963, 0.0488, 1, 0.08, 0.3125, 87, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "log_message", "arg_names": ["self", "message"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def log_message(self, message):\n msg, level = self._check_message_validity(message)\n if level != 'TRACE' and 'Traceback' not in msg:\n self.outfile.write('LOG MESSAGE: [%s] %s\\n' % (level, msg))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99767:Assign_L32_C8", "label": "msg, level = _check_message_validity()", "type": "assigned_variable", "loc": [32, 32], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99767:FunctionDef_L31_C4", "vector": [14, 2, 0.3902, 0.0122, 2, 0.76, 0.0, 384, 3, 1, 0, 0, 728, 10, 1], "semantic": {"name": "msg, level", "arg_names": [], "import_names": [], "rhs_call_name": "_check_message_validity", "annotation": ""}, "snippet": " msg, level = self._check_message_validity(message)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99767:If_L33_C8", "label": "if", "type": "if", "loc": [33, 34], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99767:FunctionDef_L31_C4", "vector": [4, 2, 0.4085, 0.0244, 2, 0.76, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if level != 'TRACE' and 'Traceback' not in msg:\n self.outfile.write('LOG MESSAGE: [%s] %s\\n' % (level, msg))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99767:Expr_L34_C12", "label": "write()", "type": "expression", "loc": [34, 34], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99767:If_L33_C8", "vector": [8, 3, 0.4146, 0.0122, 3, 0.65, 0.0, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " self.outfile.write('LOG MESSAGE: [%s] %s\\n' % (level, msg))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99767:FunctionDef_L36_C4", "label": "message", "type": "function", "loc": [36, 39], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99767:ClassDef_L6_C0", "vector": [2, 1, 0.4573, 0.0488, 1, 0.08, 0.375, 635, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "message", "arg_names": ["self", "message"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def message(self, message):\n msg, level = self._check_message_validity(message)\n if 'Settings' in msg:\n self.outfile.write('Got settings on level: %s\\n' % level)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99767:Assign_L37_C8", "label": "msg, level = _check_message_validity()", "type": "assigned_variable", "loc": [37, 37], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99767:FunctionDef_L36_C4", "vector": [14, 2, 0.4512, 0.0122, 2, 0.52, 0.0, 384, 3, 1, 0, 0, 728, 10, 1], "semantic": {"name": "msg, level", "arg_names": [], "import_names": [], "rhs_call_name": "_check_message_validity", "annotation": ""}, "snippet": " msg, level = self._check_message_validity(message)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99767:If_L38_C8", "label": "if", "type": "if", "loc": [38, 39], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99767:FunctionDef_L36_C4", "vector": [4, 2, 0.4695, 0.0244, 2, 0.52, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if 'Settings' in msg:\n self.outfile.write('Got settings on level: %s\\n' % level)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99767:Expr_L39_C12", "label": "write()", "type": "expression", "loc": [39, 39], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99767:If_L38_C8", "vector": [8, 3, 0.4756, 0.0122, 3, 0.13, 0.0, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " self.outfile.write('Got settings on level: %s\\n' % level)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99767:FunctionDef_L41_C4", "label": "_check_message_validity", "type": "function", "loc": [41, 48], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99767:ClassDef_L6_C0", "vector": [2, 1, 0.5427, 0.0976, 1, 0.08, 0.4375, 728, 0, 2, 1, 0, 0, 0, 5], "semantic": {"name": "_check_message_validity", "arg_names": ["self", "message"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _check_message_validity(self, message):\n if message['html'] not in ['yes', 'no']:\n self.outfile.write('Log message has invalid `html` attribute %s' %\n message['html'])\n if not message['timestamp'].startswith(str(time.localtime()[0])):\n self.outfile.write('Log message has invalid timestamp %s' %\n message['timestamp'])\n return message['message'], message['level']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99767:If_L42_C8", "label": "if", "type": "if", "loc": [42, 44], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99767:FunctionDef_L41_C4", "vector": [4, 2, 0.5244, 0.0366, 2, 0.08, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if message['html'] not in ['yes', 'no']:\n self.outfile.write('Log message has invalid `html` attribute %s' %\n message['html'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99767:Expr_L43_C12", "label": "write()", "type": "expression", "loc": [43, 44], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99767:If_L42_C8", "vector": [8, 3, 0.5305, 0.0244, 3, 0.13, 0.0, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " self.outfile.write('Log message has invalid `html` attribute %s' %\n message['html'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99767:If_L45_C8", "label": "if", "type": "if", "loc": [45, 47], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99767:FunctionDef_L41_C4", "vector": [4, 2, 0.561, 0.0366, 2, 0.08, 0.5, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not message['timestamp'].startswith(str(time.localtime()[0])):\n self.outfile.write('Log message has invalid timestamp %s' %\n message['timestamp'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99767:Expr_L46_C12", "label": "write()", "type": "expression", "loc": [46, 47], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99767:If_L45_C8", "vector": [8, 3, 0.5671, 0.0244, 3, 0.28, 0.0, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " self.outfile.write('Log message has invalid timestamp %s' %\n message['timestamp'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99767:Return_L48_C8", "label": "return", "type": "return", "loc": [48, 48], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99767:FunctionDef_L41_C4", "vector": [13, 2, 0.5854, 0.0122, 2, 0.08, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return message['message'], message['level']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99767:FunctionDef_L50_C4", "label": "end_keyword", "type": "function", "loc": [50, 51], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99767:ClassDef_L6_C0", "vector": [2, 1, 0.6159, 0.0244, 1, 0.08, 0.5, 959, 0, 3, 0, 0, 0, 0, 1], "semantic": {"name": "end_keyword", "arg_names": ["self", "name", "attrs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def end_keyword(self, name, attrs):\n self.outfile.write(\"KW END: %s\\n\" % (attrs['status']))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99767:Expr_L51_C8", "label": "write()", "type": "expression", "loc": [51, 51], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99767:FunctionDef_L50_C4", "vector": [8, 2, 0.622, 0.0122, 2, 0.79, 0.0, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " self.outfile.write(\"KW END: %s\\n\" % (attrs['status']))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99767:FunctionDef_L53_C4", "label": "end_test", "type": "function", "loc": [53, 58], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99767:ClassDef_L6_C0", "vector": [2, 1, 0.6768, 0.0732, 1, 0.08, 0.5625, 220, 0, 3, 0, 0, 0, 0, 2], "semantic": {"name": "end_test", "arg_names": ["self", "name", "attrs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def end_test(self, name, attrs):\n if attrs['status'] == 'PASS':\n self.outfile.write('TEST END: PASS\\n')\n else:\n self.outfile.write(\"TEST END: %s %s\\n\"\n % (attrs['status'], attrs['message']))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99767:If_L54_C8", "label": "if", "type": "if", "loc": [54, 58], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99767:FunctionDef_L53_C4", "vector": [4, 2, 0.6829, 0.061, 2, 0.96, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if attrs['status'] == 'PASS':\n self.outfile.write('TEST END: PASS\\n')\n else:\n self.outfile.write(\"TEST END: %s %s\\n\"\n % (attrs['status'], attrs['message']))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99767:Expr_L55_C12", "label": "write()", "type": "expression", "loc": [55, 55], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99767:If_L54_C8", "vector": [8, 3, 0.6707, 0.0122, 3, 0.79, 0.0, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " self.outfile.write('TEST END: PASS\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99767:Expr_L57_C12", "label": "write()", "type": "expression", "loc": [57, 58], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99767:If_L54_C8", "vector": [8, 3, 0.7012, 0.0244, 3, 0.79, 1.0, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " self.outfile.write(\"TEST END: %s %s\\n\"\n % (attrs['status'], attrs['message']))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99767:FunctionDef_L60_C4", "label": "end_suite", "type": "function", "loc": [60, 62], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99767:ClassDef_L6_C0", "vector": [2, 1, 0.7439, 0.0366, 1, 0.08, 0.625, 81, 0, 3, 0, 0, 0, 0, 1], "semantic": {"name": "end_suite", "arg_names": ["self", "name", "attrs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def end_suite(self, name, attrs):\n self.outfile.write('SUITE END: %s %s\\n'\n % (attrs['status'], attrs['statistics']))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99767:Expr_L61_C8", "label": "write()", "type": "expression", "loc": [61, 62], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99767:FunctionDef_L60_C4", "vector": [8, 2, 0.75, 0.0244, 2, 0.48, 0.0, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " self.outfile.write('SUITE END: %s %s\\n'\n % (attrs['status'], attrs['statistics']))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99767:FunctionDef_L64_C4", "label": "output_file", "type": "function", "loc": [64, 65], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99767:ClassDef_L6_C0", "vector": [2, 1, 0.7866, 0.0244, 1, 0.08, 0.6875, 395, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "output_file", "arg_names": ["self", "path"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def output_file(self, path):\n self._out_file('Output', path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99767:Expr_L65_C8", "label": "_out_file()", "type": "expression", "loc": [65, 65], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99767:FunctionDef_L64_C4", "vector": [8, 2, 0.7927, 0.0122, 2, 0.64, 0.0, 361, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "_out_file", "arg_names": [], "import_names": [], "rhs_call_name": "_out_file", "annotation": ""}, "snippet": " self._out_file('Output', path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99767:FunctionDef_L67_C4", "label": "report_file", "type": "function", "loc": [67, 68], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99767:ClassDef_L6_C0", "vector": [2, 1, 0.8232, 0.0244, 1, 0.08, 0.75, 970, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "report_file", "arg_names": ["self", "path"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def report_file(self, path):\n self._out_file('Report', path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99767:Expr_L68_C8", "label": "_out_file()", "type": "expression", "loc": [68, 68], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99767:FunctionDef_L67_C4", "vector": [8, 2, 0.8293, 0.0122, 2, 0.03, 0.0, 361, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "_out_file", "arg_names": [], "import_names": [], "rhs_call_name": "_out_file", "annotation": ""}, "snippet": " self._out_file('Report', path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99767:FunctionDef_L70_C4", "label": "log_file", "type": "function", "loc": [70, 71], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99767:ClassDef_L6_C0", "vector": [2, 1, 0.8598, 0.0244, 1, 0.08, 0.8125, 108, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "log_file", "arg_names": ["self", "path"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def log_file(self, path):\n self._out_file('Log', path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99767:Expr_L71_C8", "label": "_out_file()", "type": "expression", "loc": [71, 71], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99767:FunctionDef_L70_C4", "vector": [8, 2, 0.8659, 0.0122, 2, 0.94, 0.0, 361, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "_out_file", "arg_names": [], "import_names": [], "rhs_call_name": "_out_file", "annotation": ""}, "snippet": " self._out_file('Log', path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99767:FunctionDef_L73_C4", "label": "debug_file", "type": "function", "loc": [73, 74], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99767:ClassDef_L6_C0", "vector": [2, 1, 0.8963, 0.0244, 1, 0.08, 0.875, 418, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "debug_file", "arg_names": ["self", "path"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def debug_file(self, path):\n self._out_file('Debug', path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99767:Expr_L74_C8", "label": "_out_file()", "type": "expression", "loc": [74, 74], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99767:FunctionDef_L73_C4", "vector": [8, 2, 0.9024, 0.0122, 2, 0.68, 0.0, 361, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "_out_file", "arg_names": [], "import_names": [], "rhs_call_name": "_out_file", "annotation": ""}, "snippet": " self._out_file('Debug', path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99767:FunctionDef_L76_C4", "label": "_out_file", "type": "function", "loc": [76, 78], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99767:ClassDef_L6_C0", "vector": [2, 1, 0.939, 0.0366, 1, 0.08, 0.9375, 361, 0, 3, 0, 0, 0, 0, 3], "semantic": {"name": "_out_file", "arg_names": ["self", "name", "path"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _out_file(self, name, path):\n assert os.path.isabs(path)\n self.outfile.write('%s: %s\\n' % (name, os.path.basename(path)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99767:Expr_L78_C8", "label": "write()", "type": "expression", "loc": [78, 78], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99767:FunctionDef_L76_C4", "vector": [8, 2, 0.9512, 0.0122, 2, 0.94, 0.0, 837, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " self.outfile.write('%s: %s\\n' % (name, os.path.basename(path)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99767:FunctionDef_L80_C4", "label": "close", "type": "function", "loc": [80, 82], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99767:ClassDef_L6_C0", "vector": [2, 1, 0.9878, 0.0366, 1, 0.08, 1.0, 77, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "close", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def close(self):\n self.outfile.write('Closing...\\n')\n self.outfile.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99767:Expr_L81_C8", "label": "write()", "type": "expression", "loc": [81, 81], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99767:FunctionDef_L80_C4", "vector": [8, 2, 0.9878, 0.0122, 2, 0.17, 0.0, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " self.outfile.write('Closing...\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99767:Expr_L82_C8", "label": "close()", "type": "expression", "loc": [82, 82], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99767:FunctionDef_L80_C4", "vector": [8, 2, 1.0, 0.0122, 2, 0.17, 1.0, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": " self.outfile.close()"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99767:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99767:Assign_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99767:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99767:FunctionDef_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99767:FunctionDef_L10_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99767:If_L11_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99767:If_L11_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99767:Assign_L12_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99767:If_L11_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99767:Assign_L14_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99767:FunctionDef_L10_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99767:Assign_L15_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99767:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99767:FunctionDef_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99767:FunctionDef_L17_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99767:Assign_L18_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99767:FunctionDef_L17_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99767:Expr_L20_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99767:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99767:FunctionDef_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99767:FunctionDef_L23_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99767:Assign_L24_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99767:FunctionDef_L23_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99767:Expr_L25_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99767:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99767:FunctionDef_L27_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99767:FunctionDef_L27_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99767:Assign_L28_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99767:FunctionDef_L27_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99767:Expr_L29_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99767:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99767:FunctionDef_L31_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99767:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99767:Assign_L32_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99767:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99767:If_L33_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99767:If_L33_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99767:Expr_L34_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99767:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99767:FunctionDef_L36_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99767:FunctionDef_L36_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99767:Assign_L37_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99767:FunctionDef_L36_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99767:If_L38_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99767:If_L38_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99767:Expr_L39_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99767:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99767:FunctionDef_L41_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99767:FunctionDef_L41_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99767:If_L42_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99767:If_L42_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99767:Expr_L43_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99767:FunctionDef_L41_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99767:If_L45_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99767:If_L45_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99767:Expr_L46_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99767:FunctionDef_L41_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99767:Return_L48_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99767:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99767:FunctionDef_L50_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99767:FunctionDef_L50_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99767:Expr_L51_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99767:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99767:FunctionDef_L53_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99767:FunctionDef_L53_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99767:If_L54_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99767:If_L54_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99767:Expr_L55_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99767:If_L54_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99767:Expr_L57_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99767:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99767:FunctionDef_L60_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99767:FunctionDef_L60_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99767:Expr_L61_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99767:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99767:FunctionDef_L64_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99767:FunctionDef_L64_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99767:Expr_L65_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99767:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99767:FunctionDef_L67_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99767:FunctionDef_L67_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99767:Expr_L68_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99767:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99767:FunctionDef_L70_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99767:FunctionDef_L70_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99767:Expr_L71_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99767:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99767:FunctionDef_L73_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99767:FunctionDef_L73_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99767:Expr_L74_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99767:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99767:FunctionDef_L76_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99767:FunctionDef_L76_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99767:Expr_L78_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99767:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99767:FunctionDef_L80_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99767:FunctionDef_L80_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99767:Expr_L81_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99767:FunctionDef_L80_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99767:Expr_L82_C8"}] |
import os
import tempfile
class OldListenAll:
def __init__(self, *path):
if not path:
path = os.path.join(tempfile.gettempdir(), 'listen_all.txt')
else:
path = ':'.join(path)
self.outfile = open(path, 'w')
def start_suite(self, name, doc):
self.outfile.write("SUITE START: %s '%s'\n" % (name, doc))
def start_test(self, name, doc, tags):
tags = [str(tag) for tag in tags]
self.outfile.write("TEST START: %s '%s' %s\n" % (name, doc, tags))
def start_keyword(self, name, args):
args = [str(arg) for arg in args]
self.outfile.write("KW START: %s %s\n" % (name, args))
def end_keyword(self, status):
self.outfile.write("KW END: %s\n" % (status))
def end_test(self, status, message):
if status == 'PASS':
self.outfile.write('TEST END: PASS\n')
else:
self.outfile.write("TEST END: %s %s\n" % (status, message))
def end_suite(self, status, message):
self.outfile.write('SUITE END: %s %s\n' % (status, message))
def output_file(self, path):
self._out_file('Output', path)
def report_file(self, path):
self._out_file('Report', path)
def log_file(self, path):
self._out_file('Log', path)
def debug_file(self, path):
self._out_file('Debug', path)
def _out_file(self, name, path):
assert os.path.isabs(path)
self.outfile.write('%s: %s\n' % (name, os.path.basename(path)))
def close(self):
self.outfile.write('Closing...\n')
self.outfile.close()
| ajibawa-2023/Python-Code-Large/train/row_99768 | 37 | 55 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99768:Import_L1_C0", "label": "os import os", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0182, 0.0182, 0, 0.66, 0.0, 688, 0, 1, 0, 0, 688, 0, 0], "semantic": {"name": "os", "arg_names": [], "import_names": ["os"], "rhs_call_name": "", "annotation": ""}, "snippet": "import os"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99768:Import_L2_C0", "label": "tempfile import tempfile", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0364, 0.0182, 0, 0.66, 0.5, 516, 0, 1, 0, 0, 516, 0, 0], "semantic": {"name": "tempfile", "arg_names": [], "import_names": ["tempfile"], "rhs_call_name": "", "annotation": ""}, "snippet": "import tempfile"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99768:ClassDef_L5_C0", "label": "OldListenAll", "type": "class", "loc": [5, 55], "level": 0, "parent": null, "vector": [3, 0, 0.5455, 0.9273, 0, 0.66, 1.0, 555, 0, 13, 0, 0, 0, 0, 22], "semantic": {"name": "OldListenAll", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class OldListenAll:\n\n def __init__(self, *path):\n if not path:\n path = os.path.join(tempfile.gettempdir(), 'listen_all.txt')\n else:\n path = ':'.join(path)\n self.outfile = open(path, 'w')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99768:FunctionDef_L7_C4", "label": "__init__", "type": "function", "loc": [7, 12], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99768:ClassDef_L5_C0", "vector": [2, 1, 0.1727, 0.1091, 1, 0.69, 0.0, 555, 0, 2, 0, 0, 0, 0, 4], "semantic": {"name": "__init__", "arg_names": ["self", "path"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, *path):\n if not path:\n path = os.path.join(tempfile.gettempdir(), 'listen_all.txt')\n else:\n path = ':'.join(path)\n self.outfile = open(path, 'w')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99768:If_L8_C8", "label": "if", "type": "if", "loc": [8, 11], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99768:FunctionDef_L7_C4", "vector": [4, 2, 0.1727, 0.0727, 2, 0.03, 0.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not path:\n path = os.path.join(tempfile.gettempdir(), 'listen_all.txt')\n else:\n path = ':'.join(path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99768:Assign_L9_C12", "label": "path = join()", "type": "assigned_variable", "loc": [9, 9], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99768:If_L8_C8", "vector": [14, 3, 0.1636, 0.0182, 3, 0.79, 0.0, 358, 3, 2, 0, 0, 933, 10, 2], "semantic": {"name": "path", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": " path = os.path.join(tempfile.gettempdir(), 'listen_all.txt')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99768:Assign_L11_C12", "label": "path = join()", "type": "assigned_variable", "loc": [11, 11], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99768:If_L8_C8", "vector": [14, 3, 0.2, 0.0182, 3, 0.79, 1.0, 358, 3, 1, 0, 0, 933, 10, 1], "semantic": {"name": "path", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": " path = ':'.join(path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99768:Assign_L12_C8", "label": "self.outfile = open()", "type": "assigned_variable", "loc": [12, 12], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99768:FunctionDef_L7_C4", "vector": [14, 2, 0.2182, 0.0182, 2, 0.03, 1.0, 579, 3, 2, 0, 0, 693, 10, 1], "semantic": {"name": "self.outfile", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": " self.outfile = open(path, 'w')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99768:FunctionDef_L14_C4", "label": "start_suite", "type": "function", "loc": [14, 15], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99768:ClassDef_L5_C0", "vector": [2, 1, 0.2636, 0.0364, 1, 0.69, 0.0833, 38, 0, 3, 0, 0, 0, 0, 1], "semantic": {"name": "start_suite", "arg_names": ["self", "name", "doc"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def start_suite(self, name, doc):\n self.outfile.write(\"SUITE START: %s '%s'\\n\" % (name, doc))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99768:Expr_L15_C8", "label": "write()", "type": "expression", "loc": [15, 15], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99768:FunctionDef_L14_C4", "vector": [8, 2, 0.2727, 0.0182, 2, 0.0, 0.0, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " self.outfile.write(\"SUITE START: %s '%s'\\n\" % (name, doc))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99768:FunctionDef_L17_C4", "label": "start_test", "type": "function", "loc": [17, 19], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99768:ClassDef_L5_C0", "vector": [2, 1, 0.3273, 0.0545, 1, 0.69, 0.1667, 246, 0, 4, 0, 0, 0, 0, 2], "semantic": {"name": "start_test", "arg_names": ["self", "name", "doc", "tags"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def start_test(self, name, doc, tags):\n tags = [str(tag) for tag in tags]\n self.outfile.write(\"TEST START: %s '%s' %s\\n\" % (name, doc, tags))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99768:Assign_L18_C8", "label": "tags =", "type": "assigned_variable", "loc": [18, 18], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99768:FunctionDef_L17_C4", "vector": [14, 2, 0.3273, 0.0182, 2, 0.05, 0.0, 487, 5, 0, 0, 0, 0, 0, 1], "semantic": {"name": "tags", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tags = [str(tag) for tag in tags]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99768:Expr_L19_C8", "label": "write()", "type": "expression", "loc": [19, 19], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99768:FunctionDef_L17_C4", "vector": [8, 2, 0.3455, 0.0182, 2, 0.05, 1.0, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " self.outfile.write(\"TEST START: %s '%s' %s\\n\" % (name, doc, tags))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99768:FunctionDef_L21_C4", "label": "start_keyword", "type": "function", "loc": [21, 23], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99768:ClassDef_L5_C0", "vector": [2, 1, 0.4, 0.0545, 1, 0.69, 0.25, 776, 0, 3, 0, 0, 0, 0, 2], "semantic": {"name": "start_keyword", "arg_names": ["self", "name", "args"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def start_keyword(self, name, args):\n args = [str(arg) for arg in args]\n self.outfile.write(\"KW START: %s %s\\n\" % (name, args))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99768:Assign_L22_C8", "label": "args =", "type": "assigned_variable", "loc": [22, 22], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99768:FunctionDef_L21_C4", "vector": [14, 2, 0.4, 0.0182, 2, 0.32, 0.0, 805, 5, 0, 0, 0, 0, 0, 1], "semantic": {"name": "args", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " args = [str(arg) for arg in args]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99768:Expr_L23_C8", "label": "write()", "type": "expression", "loc": [23, 23], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99768:FunctionDef_L21_C4", "vector": [8, 2, 0.4182, 0.0182, 2, 0.32, 1.0, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " self.outfile.write(\"KW START: %s %s\\n\" % (name, args))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99768:FunctionDef_L25_C4", "label": "end_keyword", "type": "function", "loc": [25, 26], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99768:ClassDef_L5_C0", "vector": [2, 1, 0.4636, 0.0364, 1, 0.69, 0.3333, 959, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "end_keyword", "arg_names": ["self", "status"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def end_keyword(self, status):\n self.outfile.write(\"KW END: %s\\n\" % (status))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99768:Expr_L26_C8", "label": "write()", "type": "expression", "loc": [26, 26], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99768:FunctionDef_L25_C4", "vector": [8, 2, 0.4727, 0.0182, 2, 0.72, 0.0, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " self.outfile.write(\"KW END: %s\\n\" % (status))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99768:FunctionDef_L28_C4", "label": "end_test", "type": "function", "loc": [28, 32], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99768:ClassDef_L5_C0", "vector": [2, 1, 0.5455, 0.0909, 1, 0.69, 0.4167, 220, 0, 3, 0, 0, 0, 0, 2], "semantic": {"name": "end_test", "arg_names": ["self", "status", "message"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def end_test(self, status, message):\n if status == 'PASS':\n self.outfile.write('TEST END: PASS\\n')\n else:\n self.outfile.write(\"TEST END: %s %s\\n\" % (status, message))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99768:If_L29_C8", "label": "if", "type": "if", "loc": [29, 32], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99768:FunctionDef_L28_C4", "vector": [4, 2, 0.5545, 0.0727, 2, 0.88, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if status == 'PASS':\n self.outfile.write('TEST END: PASS\\n')\n else:\n self.outfile.write(\"TEST END: %s %s\\n\" % (status, message))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99768:Expr_L30_C12", "label": "write()", "type": "expression", "loc": [30, 30], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99768:If_L29_C8", "vector": [8, 3, 0.5455, 0.0182, 3, 0.61, 0.0, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " self.outfile.write('TEST END: PASS\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99768:Expr_L32_C12", "label": "write()", "type": "expression", "loc": [32, 32], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99768:If_L29_C8", "vector": [8, 3, 0.5818, 0.0182, 3, 0.61, 1.0, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " self.outfile.write(\"TEST END: %s %s\\n\" % (status, message))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99768:FunctionDef_L34_C4", "label": "end_suite", "type": "function", "loc": [34, 35], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99768:ClassDef_L5_C0", "vector": [2, 1, 0.6273, 0.0364, 1, 0.69, 0.5, 81, 0, 3, 0, 0, 0, 0, 1], "semantic": {"name": "end_suite", "arg_names": ["self", "status", "message"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def end_suite(self, status, message):\n self.outfile.write('SUITE END: %s %s\\n' % (status, message))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99768:Expr_L35_C8", "label": "write()", "type": "expression", "loc": [35, 35], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99768:FunctionDef_L34_C4", "vector": [8, 2, 0.6364, 0.0182, 2, 0.34, 0.0, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " self.outfile.write('SUITE END: %s %s\\n' % (status, message))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99768:FunctionDef_L37_C4", "label": "output_file", "type": "function", "loc": [37, 38], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99768:ClassDef_L5_C0", "vector": [2, 1, 0.6818, 0.0364, 1, 0.69, 0.5833, 395, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "output_file", "arg_names": ["self", "path"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def output_file(self, path):\n self._out_file('Output', path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99768:Expr_L38_C8", "label": "_out_file()", "type": "expression", "loc": [38, 38], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99768:FunctionDef_L37_C4", "vector": [8, 2, 0.6909, 0.0182, 2, 0.6, 0.0, 361, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "_out_file", "arg_names": [], "import_names": [], "rhs_call_name": "_out_file", "annotation": ""}, "snippet": " self._out_file('Output', path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99768:FunctionDef_L40_C4", "label": "report_file", "type": "function", "loc": [40, 41], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99768:ClassDef_L5_C0", "vector": [2, 1, 0.7364, 0.0364, 1, 0.69, 0.6667, 970, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "report_file", "arg_names": ["self", "path"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def report_file(self, path):\n self._out_file('Report', path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99768:Expr_L41_C8", "label": "_out_file()", "type": "expression", "loc": [41, 41], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99768:FunctionDef_L40_C4", "vector": [8, 2, 0.7455, 0.0182, 2, 0.06, 0.0, 361, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "_out_file", "arg_names": [], "import_names": [], "rhs_call_name": "_out_file", "annotation": ""}, "snippet": " self._out_file('Report', path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99768:FunctionDef_L43_C4", "label": "log_file", "type": "function", "loc": [43, 44], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99768:ClassDef_L5_C0", "vector": [2, 1, 0.7909, 0.0364, 1, 0.69, 0.75, 108, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "log_file", "arg_names": ["self", "path"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def log_file(self, path):\n self._out_file('Log', path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99768:Expr_L44_C8", "label": "_out_file()", "type": "expression", "loc": [44, 44], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99768:FunctionDef_L43_C4", "vector": [8, 2, 0.8, 0.0182, 2, 0.88, 0.0, 361, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "_out_file", "arg_names": [], "import_names": [], "rhs_call_name": "_out_file", "annotation": ""}, "snippet": " self._out_file('Log', path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99768:FunctionDef_L46_C4", "label": "debug_file", "type": "function", "loc": [46, 47], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99768:ClassDef_L5_C0", "vector": [2, 1, 0.8455, 0.0364, 1, 0.69, 0.8333, 418, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "debug_file", "arg_names": ["self", "path"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def debug_file(self, path):\n self._out_file('Debug', path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99768:Expr_L47_C8", "label": "_out_file()", "type": "expression", "loc": [47, 47], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99768:FunctionDef_L46_C4", "vector": [8, 2, 0.8545, 0.0182, 2, 0.73, 0.0, 361, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "_out_file", "arg_names": [], "import_names": [], "rhs_call_name": "_out_file", "annotation": ""}, "snippet": " self._out_file('Debug', path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99768:FunctionDef_L49_C4", "label": "_out_file", "type": "function", "loc": [49, 51], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99768:ClassDef_L5_C0", "vector": [2, 1, 0.9091, 0.0545, 1, 0.69, 0.9167, 361, 0, 3, 0, 0, 0, 0, 3], "semantic": {"name": "_out_file", "arg_names": ["self", "name", "path"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _out_file(self, name, path):\n assert os.path.isabs(path)\n self.outfile.write('%s: %s\\n' % (name, os.path.basename(path)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99768:Expr_L51_C8", "label": "write()", "type": "expression", "loc": [51, 51], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99768:FunctionDef_L49_C4", "vector": [8, 2, 0.9273, 0.0182, 2, 0.87, 0.0, 837, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " self.outfile.write('%s: %s\\n' % (name, os.path.basename(path)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99768:FunctionDef_L53_C4", "label": "close", "type": "function", "loc": [53, 55], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99768:ClassDef_L5_C0", "vector": [2, 1, 0.9818, 0.0545, 1, 0.69, 1.0, 77, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "close", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def close(self):\n self.outfile.write('Closing...\\n')\n self.outfile.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99768:Expr_L54_C8", "label": "write()", "type": "expression", "loc": [54, 54], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99768:FunctionDef_L53_C4", "vector": [8, 2, 0.9818, 0.0182, 2, 0.21, 0.0, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " self.outfile.write('Closing...\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99768:Expr_L55_C8", "label": "close()", "type": "expression", "loc": [55, 55], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99768:FunctionDef_L53_C4", "vector": [8, 2, 1.0, 0.0182, 2, 0.21, 1.0, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": " self.outfile.close()"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99768:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99768:FunctionDef_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99768:FunctionDef_L7_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99768:If_L8_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99768:If_L8_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99768:Assign_L9_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99768:If_L8_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99768:Assign_L11_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99768:FunctionDef_L7_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99768:Assign_L12_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99768:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99768:FunctionDef_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99768:FunctionDef_L14_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99768:Expr_L15_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99768:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99768:FunctionDef_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99768:FunctionDef_L17_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99768:Assign_L18_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99768:FunctionDef_L17_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99768:Expr_L19_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99768:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99768:FunctionDef_L21_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99768:FunctionDef_L21_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99768:Assign_L22_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99768:FunctionDef_L21_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99768:Expr_L23_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99768:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99768:FunctionDef_L25_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99768:FunctionDef_L25_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99768:Expr_L26_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99768:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99768:FunctionDef_L28_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99768:FunctionDef_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99768:If_L29_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99768:If_L29_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99768:Expr_L30_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99768:If_L29_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99768:Expr_L32_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99768:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99768:FunctionDef_L34_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99768:FunctionDef_L34_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99768:Expr_L35_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99768:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99768:FunctionDef_L37_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99768:FunctionDef_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99768:Expr_L38_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99768:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99768:FunctionDef_L40_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99768:FunctionDef_L40_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99768:Expr_L41_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99768:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99768:FunctionDef_L43_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99768:FunctionDef_L43_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99768:Expr_L44_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99768:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99768:FunctionDef_L46_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99768:FunctionDef_L46_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99768:Expr_L47_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99768:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99768:FunctionDef_L49_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99768:FunctionDef_L49_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99768:Expr_L51_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99768:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99768:FunctionDef_L53_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99768:FunctionDef_L53_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99768:Expr_L54_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99768:FunctionDef_L53_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99768:Expr_L55_C8"}] |
import os
import tempfile
outpath = os.path.join(tempfile.gettempdir(), 'listen_by_module.txt')
OUTFILE = open(outpath, 'w')
ROBOT_LISTENER_API_VERSION = 2
def start_suite(name, attrs):
metastr = ' '.join(['%s: %s' % (k, v) for k, v
in attrs['metadata'].items()])
OUTFILE.write("SUITE START: %s '%s' [%s]\n"
% (name, attrs['doc'], metastr))
def start_test(name, attrs):
tags = [ str(tag) for tag in attrs['tags'] ]
OUTFILE.write("TEST START: %s '%s' %s\n" % (name, attrs['doc'], tags))
def start_keyword(name, attrs):
args = [ str(arg) for arg in attrs['args'] ]
OUTFILE.write("KW START: %s %s\n" % (name, args))
def log_message(message):
msg, level = message['message'], message['level']
if level != 'TRACE' and 'Traceback' not in msg:
OUTFILE.write('LOG MESSAGE: [%s] %s\n' % (level, msg))
def message(message):
msg, level = message['message'], message['level']
if 'Settings' in msg:
OUTFILE.write('Got settings on level: %s\n' % level)
def end_keyword(name, attrs):
OUTFILE.write("KW END: %s\n" % (attrs['status']))
def end_test(name, attrs):
if attrs['status'] == 'PASS':
OUTFILE.write('TEST END: PASS\n')
else:
OUTFILE.write("TEST END: %s %s\n" % (attrs['status'], attrs['message']))
def end_suite(name, attrs):
OUTFILE.write('SUITE END: %s %s\n' % (attrs['status'], attrs['statistics']))
def output_file(path):
_out_file('Output', path)
def report_file(path):
_out_file('Report', path)
def log_file(path):
_out_file('Log', path)
def debug_file(path):
_out_file('Debug', path)
def _out_file(name, path):
assert os.path.isabs(path)
OUTFILE.write('%s: %s\n' % (name, os.path.basename(path)))
def close():
OUTFILE.write('Closing...\n')
OUTFILE.close()
| ajibawa-2023/Python-Code-Large/train/row_99769 | 43 | 63 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99769:Import_L1_C0", "label": "os import os", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0159, 0.0159, 0, 0.66, 0.0, 688, 0, 1, 0, 0, 688, 0, 0], "semantic": {"name": "os", "arg_names": [], "import_names": ["os"], "rhs_call_name": "", "annotation": ""}, "snippet": "import os"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99769:Import_L2_C0", "label": "tempfile import tempfile", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0317, 0.0159, 0, 0.66, 0.0556, 516, 0, 1, 0, 0, 516, 0, 0], "semantic": {"name": "tempfile", "arg_names": [], "import_names": ["tempfile"], "rhs_call_name": "", "annotation": ""}, "snippet": "import tempfile"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99769:Assign_L4_C0", "label": "outpath = join()", "type": "assigned_variable", "loc": [4, 4], "level": 0, "parent": null, "vector": [14, 0, 0.0635, 0.0159, 0, 0.66, 0.1111, 74, 3, 2, 0, 0, 933, 10, 2], "semantic": {"name": "outpath", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": "outpath = os.path.join(tempfile.gettempdir(), 'listen_by_module.txt')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99769:Assign_L5_C0", "label": "OUTFILE = open()", "type": "assigned_variable", "loc": [5, 5], "level": 0, "parent": null, "vector": [14, 0, 0.0794, 0.0159, 0, 0.66, 0.1667, 351, 3, 2, 0, 0, 693, 10, 1], "semantic": {"name": "OUTFILE", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": "OUTFILE = open(outpath, 'w')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99769:Assign_L6_C0", "label": "ROBOT_LISTENER_API_VERSION =", "type": "assigned_variable", "loc": [6, 6], "level": 0, "parent": null, "vector": [14, 0, 0.0952, 0.0159, 0, 0.66, 0.2222, 63, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "ROBOT_LISTENER_API_VERSION", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "ROBOT_LISTENER_API_VERSION = 2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99769:FunctionDef_L9_C0", "label": "start_suite", "type": "function", "loc": [9, 13], "level": 0, "parent": null, "vector": [2, 0, 0.1746, 0.0794, 0, 0.66, 0.2778, 38, 0, 2, 0, 0, 0, 0, 3], "semantic": {"name": "start_suite", "arg_names": ["name", "attrs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def start_suite(name, attrs):\n metastr = ' '.join(['%s: %s' % (k, v) for k, v\n in attrs['metadata'].items()])\n OUTFILE.write(\"SUITE START: %s '%s' [%s]\\n\"\n % (name, attrs['doc'], metastr))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99769:Assign_L10_C4", "label": "metastr = join()", "type": "assigned_variable", "loc": [10, 11], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99769:FunctionDef_L9_C0", "vector": [14, 1, 0.1667, 0.0317, 1, 0.62, 0.0, 957, 3, 1, 0, 0, 933, 10, 2], "semantic": {"name": "metastr", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": " metastr = ' '.join(['%s: %s' % (k, v) for k, v\n in attrs['metadata'].items()])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99769:Expr_L12_C4", "label": "write()", "type": "expression", "loc": [12, 13], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99769:FunctionDef_L9_C0", "vector": [8, 1, 0.1984, 0.0317, 1, 0.62, 1.0, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " OUTFILE.write(\"SUITE START: %s '%s' [%s]\\n\"\n % (name, attrs['doc'], metastr))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99769:FunctionDef_L15_C0", "label": "start_test", "type": "function", "loc": [15, 17], "level": 0, "parent": null, "vector": [2, 0, 0.254, 0.0476, 0, 0.66, 0.3333, 246, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "start_test", "arg_names": ["name", "attrs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def start_test(name, attrs):\n tags = [ str(tag) for tag in attrs['tags'] ]\n OUTFILE.write(\"TEST START: %s '%s' %s\\n\" % (name, attrs['doc'], tags))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99769:Assign_L16_C4", "label": "tags =", "type": "assigned_variable", "loc": [16, 16], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99769:FunctionDef_L15_C0", "vector": [14, 1, 0.254, 0.0159, 1, 0.21, 0.0, 487, 5, 0, 0, 0, 0, 0, 1], "semantic": {"name": "tags", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tags = [ str(tag) for tag in attrs['tags'] ]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99769:Expr_L17_C4", "label": "write()", "type": "expression", "loc": [17, 17], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99769:FunctionDef_L15_C0", "vector": [8, 1, 0.2698, 0.0159, 1, 0.21, 1.0, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " OUTFILE.write(\"TEST START: %s '%s' %s\\n\" % (name, attrs['doc'], tags))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99769:FunctionDef_L19_C0", "label": "start_keyword", "type": "function", "loc": [19, 21], "level": 0, "parent": null, "vector": [2, 0, 0.3175, 0.0476, 0, 0.66, 0.3889, 776, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "start_keyword", "arg_names": ["name", "attrs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def start_keyword(name, attrs):\n args = [ str(arg) for arg in attrs['args'] ]\n OUTFILE.write(\"KW START: %s %s\\n\" % (name, args))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99769:Assign_L20_C4", "label": "args =", "type": "assigned_variable", "loc": [20, 20], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99769:FunctionDef_L19_C0", "vector": [14, 1, 0.3175, 0.0159, 1, 0.95, 0.0, 805, 5, 0, 0, 0, 0, 0, 1], "semantic": {"name": "args", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " args = [ str(arg) for arg in attrs['args'] ]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99769:Expr_L21_C4", "label": "write()", "type": "expression", "loc": [21, 21], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99769:FunctionDef_L19_C0", "vector": [8, 1, 0.3333, 0.0159, 1, 0.95, 1.0, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " OUTFILE.write(\"KW START: %s %s\\n\" % (name, args))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99769:FunctionDef_L23_C0", "label": "log_message", "type": "function", "loc": [23, 26], "level": 0, "parent": null, "vector": [2, 0, 0.3889, 0.0635, 0, 0.66, 0.4444, 87, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "log_message", "arg_names": ["message"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def log_message(message):\n msg, level = message['message'], message['level']\n if level != 'TRACE' and 'Traceback' not in msg:\n OUTFILE.write('LOG MESSAGE: [%s] %s\\n' % (level, msg))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99769:Assign_L24_C4", "label": "msg, level =", "type": "assigned_variable", "loc": [24, 24], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99769:FunctionDef_L23_C0", "vector": [14, 1, 0.381, 0.0159, 1, 0.65, 0.0, 384, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "msg, level", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " msg, level = message['message'], message['level']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99769:If_L25_C4", "label": "if", "type": "if", "loc": [25, 26], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99769:FunctionDef_L23_C0", "vector": [4, 1, 0.4048, 0.0317, 1, 0.65, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if level != 'TRACE' and 'Traceback' not in msg:\n OUTFILE.write('LOG MESSAGE: [%s] %s\\n' % (level, msg))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99769:Expr_L26_C8", "label": "write()", "type": "expression", "loc": [26, 26], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99769:If_L25_C4", "vector": [8, 2, 0.4127, 0.0159, 2, 0.42, 0.0, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " OUTFILE.write('LOG MESSAGE: [%s] %s\\n' % (level, msg))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99769:FunctionDef_L28_C0", "label": "message", "type": "function", "loc": [28, 31], "level": 0, "parent": null, "vector": [2, 0, 0.4683, 0.0635, 0, 0.66, 0.5, 635, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "message", "arg_names": ["message"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def message(message):\n msg, level = message['message'], message['level']\n if 'Settings' in msg:\n OUTFILE.write('Got settings on level: %s\\n' % level)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99769:Assign_L29_C4", "label": "msg, level =", "type": "assigned_variable", "loc": [29, 29], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99769:FunctionDef_L28_C0", "vector": [14, 1, 0.4603, 0.0159, 1, 0.2, 0.0, 384, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "msg, level", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " msg, level = message['message'], message['level']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99769:If_L30_C4", "label": "if", "type": "if", "loc": [30, 31], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99769:FunctionDef_L28_C0", "vector": [4, 1, 0.4841, 0.0317, 1, 0.2, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if 'Settings' in msg:\n OUTFILE.write('Got settings on level: %s\\n' % level)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99769:Expr_L31_C8", "label": "write()", "type": "expression", "loc": [31, 31], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99769:If_L30_C4", "vector": [8, 2, 0.4921, 0.0159, 2, 0.66, 0.0, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " OUTFILE.write('Got settings on level: %s\\n' % level)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99769:FunctionDef_L33_C0", "label": "end_keyword", "type": "function", "loc": [33, 34], "level": 0, "parent": null, "vector": [2, 0, 0.5317, 0.0317, 0, 0.66, 0.5556, 959, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "end_keyword", "arg_names": ["name", "attrs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def end_keyword(name, attrs):\n OUTFILE.write(\"KW END: %s\\n\" % (attrs['status']))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99769:Expr_L34_C4", "label": "write()", "type": "expression", "loc": [34, 34], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99769:FunctionDef_L33_C0", "vector": [8, 1, 0.5397, 0.0159, 1, 0.82, 0.0, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " OUTFILE.write(\"KW END: %s\\n\" % (attrs['status']))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99769:FunctionDef_L36_C0", "label": "end_test", "type": "function", "loc": [36, 40], "level": 0, "parent": null, "vector": [2, 0, 0.6032, 0.0794, 0, 0.66, 0.6111, 220, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "end_test", "arg_names": ["name", "attrs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def end_test(name, attrs):\n if attrs['status'] == 'PASS':\n OUTFILE.write('TEST END: PASS\\n')\n else:\n OUTFILE.write(\"TEST END: %s %s\\n\" % (attrs['status'], attrs['message']))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99769:If_L37_C4", "label": "if", "type": "if", "loc": [37, 40], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99769:FunctionDef_L36_C0", "vector": [4, 1, 0.6111, 0.0635, 1, 0.63, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if attrs['status'] == 'PASS':\n OUTFILE.write('TEST END: PASS\\n')\n else:\n OUTFILE.write(\"TEST END: %s %s\\n\" % (attrs['status'], attrs['message']))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99769:Expr_L38_C8", "label": "write()", "type": "expression", "loc": [38, 38], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99769:If_L37_C4", "vector": [8, 2, 0.6032, 0.0159, 2, 0.14, 0.0, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " OUTFILE.write('TEST END: PASS\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99769:Expr_L40_C8", "label": "write()", "type": "expression", "loc": [40, 40], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99769:If_L37_C4", "vector": [8, 2, 0.6349, 0.0159, 2, 0.14, 1.0, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " OUTFILE.write(\"TEST END: %s %s\\n\" % (attrs['status'], attrs['message']))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99769:FunctionDef_L42_C0", "label": "end_suite", "type": "function", "loc": [42, 43], "level": 0, "parent": null, "vector": [2, 0, 0.6746, 0.0317, 0, 0.66, 0.6667, 81, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "end_suite", "arg_names": ["name", "attrs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def end_suite(name, attrs):\n OUTFILE.write('SUITE END: %s %s\\n' % (attrs['status'], attrs['statistics']))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99769:Expr_L43_C4", "label": "write()", "type": "expression", "loc": [43, 43], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99769:FunctionDef_L42_C0", "vector": [8, 1, 0.6825, 0.0159, 1, 0.96, 0.0, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " OUTFILE.write('SUITE END: %s %s\\n' % (attrs['status'], attrs['statistics']))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99769:FunctionDef_L45_C0", "label": "output_file", "type": "function", "loc": [45, 46], "level": 0, "parent": null, "vector": [2, 0, 0.7222, 0.0317, 0, 0.66, 0.7222, 395, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "output_file", "arg_names": ["path"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def output_file(path):\n _out_file('Output', path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99769:Expr_L46_C4", "label": "_out_file()", "type": "expression", "loc": [46, 46], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99769:FunctionDef_L45_C0", "vector": [8, 1, 0.7302, 0.0159, 1, 0.58, 0.0, 361, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "_out_file", "arg_names": [], "import_names": [], "rhs_call_name": "_out_file", "annotation": ""}, "snippet": " _out_file('Output', path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99769:FunctionDef_L48_C0", "label": "report_file", "type": "function", "loc": [48, 49], "level": 0, "parent": null, "vector": [2, 0, 0.7698, 0.0317, 0, 0.66, 0.7778, 970, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "report_file", "arg_names": ["path"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def report_file(path):\n _out_file('Report', path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99769:Expr_L49_C4", "label": "_out_file()", "type": "expression", "loc": [49, 49], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99769:FunctionDef_L48_C0", "vector": [8, 1, 0.7778, 0.0159, 1, 0.04, 0.0, 361, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "_out_file", "arg_names": [], "import_names": [], "rhs_call_name": "_out_file", "annotation": ""}, "snippet": " _out_file('Report', path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99769:FunctionDef_L51_C0", "label": "log_file", "type": "function", "loc": [51, 52], "level": 0, "parent": null, "vector": [2, 0, 0.8175, 0.0317, 0, 0.66, 0.8333, 108, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "log_file", "arg_names": ["path"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def log_file(path):\n _out_file('Log', path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99769:Expr_L52_C4", "label": "_out_file()", "type": "expression", "loc": [52, 52], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99769:FunctionDef_L51_C0", "vector": [8, 1, 0.8254, 0.0159, 1, 0.36, 0.0, 361, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "_out_file", "arg_names": [], "import_names": [], "rhs_call_name": "_out_file", "annotation": ""}, "snippet": " _out_file('Log', path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99769:FunctionDef_L54_C0", "label": "debug_file", "type": "function", "loc": [54, 55], "level": 0, "parent": null, "vector": [2, 0, 0.8651, 0.0317, 0, 0.66, 0.8889, 418, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "debug_file", "arg_names": ["path"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def debug_file(path):\n _out_file('Debug', path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99769:Expr_L55_C4", "label": "_out_file()", "type": "expression", "loc": [55, 55], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99769:FunctionDef_L54_C0", "vector": [8, 1, 0.873, 0.0159, 1, 0.57, 0.0, 361, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "_out_file", "arg_names": [], "import_names": [], "rhs_call_name": "_out_file", "annotation": ""}, "snippet": " _out_file('Debug', path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99769:FunctionDef_L57_C0", "label": "_out_file", "type": "function", "loc": [57, 59], "level": 0, "parent": null, "vector": [2, 0, 0.9206, 0.0476, 0, 0.66, 0.9444, 361, 0, 2, 0, 0, 0, 0, 3], "semantic": {"name": "_out_file", "arg_names": ["name", "path"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def _out_file(name, path):\n assert os.path.isabs(path)\n OUTFILE.write('%s: %s\\n' % (name, os.path.basename(path)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99769:Expr_L59_C4", "label": "write()", "type": "expression", "loc": [59, 59], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99769:FunctionDef_L57_C0", "vector": [8, 1, 0.9365, 0.0159, 1, 0.39, 0.0, 837, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " OUTFILE.write('%s: %s\\n' % (name, os.path.basename(path)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99769:FunctionDef_L61_C0", "label": "close", "type": "function", "loc": [61, 63], "level": 0, "parent": null, "vector": [2, 0, 0.9841, 0.0476, 0, 0.66, 1.0, 77, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def close():\n OUTFILE.write('Closing...\\n')\n OUTFILE.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99769:Expr_L62_C4", "label": "write()", "type": "expression", "loc": [62, 62], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99769:FunctionDef_L61_C0", "vector": [8, 1, 0.9841, 0.0159, 1, 0.79, 0.0, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " OUTFILE.write('Closing...\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99769:Expr_L63_C4", "label": "close()", "type": "expression", "loc": [63, 63], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99769:FunctionDef_L61_C0", "vector": [8, 1, 1.0, 0.0159, 1, 0.79, 1.0, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": " OUTFILE.close()"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99769:FunctionDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99769:Assign_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99769:FunctionDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99769:Expr_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99769:FunctionDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99769:Assign_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99769:FunctionDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99769:Expr_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99769:FunctionDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99769:Assign_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99769:FunctionDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99769:Expr_L21_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99769:FunctionDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99769:Assign_L24_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99769:FunctionDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99769:If_L25_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99769:If_L25_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99769:Expr_L26_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99769:FunctionDef_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99769:Assign_L29_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99769:FunctionDef_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99769:If_L30_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99769:If_L30_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99769:Expr_L31_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99769:FunctionDef_L33_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99769:Expr_L34_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99769:FunctionDef_L36_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99769:If_L37_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99769:If_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99769:Expr_L38_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99769:If_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99769:Expr_L40_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99769:FunctionDef_L42_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99769:Expr_L43_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99769:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99769:Expr_L46_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99769:FunctionDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99769:Expr_L49_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99769:FunctionDef_L51_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99769:Expr_L52_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99769:FunctionDef_L54_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99769:Expr_L55_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99769:FunctionDef_L57_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99769:Expr_L59_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99769:FunctionDef_L61_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99769:Expr_L62_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99769:FunctionDef_L61_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99769:Expr_L63_C4"}] |
import os
import tempfile
class ListenSome:
def __init__(self):
outpath = os.path.join(tempfile.gettempdir(), 'listen_some.txt')
self.outfile = open(outpath, 'w')
def startTest(self, name, doc, tags):
self.outfile.write(name + '\n')
def endSuite(self, stat, msg):
self.outfile.write(msg + '\n')
def close(self):
self.outfile.close()
class WithArgs(object):
def __init__(self, arg1, arg2='default'):
outpath = os.path.join(tempfile.gettempdir(), 'listener_with_args.txt')
outfile = open(outpath, 'a')
outfile.write("I got arguments '%s' and '%s'\n" % (arg1, arg2))
outfile.close()
class InvalidMethods:
def start_suite(self, wrong, number, of, args, here):
pass
def end_suite(self, *args):
raise RuntimeError("Here comes an exception!")
| ajibawa-2023/Python-Code-Large/train/row_99770 | 21 | 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_99770:Import_L1_C0", "label": "os import os", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0278, 0.0278, 0, 0.66, 0.0, 688, 0, 1, 0, 0, 688, 0, 0], "semantic": {"name": "os", "arg_names": [], "import_names": ["os"], "rhs_call_name": "", "annotation": ""}, "snippet": "import os"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99770:Import_L2_C0", "label": "tempfile import tempfile", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0556, 0.0278, 0, 0.66, 0.25, 516, 0, 1, 0, 0, 516, 0, 0], "semantic": {"name": "tempfile", "arg_names": [], "import_names": ["tempfile"], "rhs_call_name": "", "annotation": ""}, "snippet": "import tempfile"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99770:ClassDef_L5_C0", "label": "ListenSome", "type": "class", "loc": [5, 18], "level": 0, "parent": null, "vector": [3, 0, 0.3194, 0.3889, 0, 0.66, 0.5, 502, 0, 4, 0, 0, 0, 0, 6], "semantic": {"name": "ListenSome", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class ListenSome:\n \n def __init__(self):\n outpath = os.path.join(tempfile.gettempdir(), 'listen_some.txt')\n self.outfile = open(outpath, 'w')\n \n def startTest(self, name, doc, tags):\n self.outfile.write(name + '\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99770:FunctionDef_L7_C4", "label": "__init__", "type": "function", "loc": [7, 9], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99770:ClassDef_L5_C0", "vector": [2, 1, 0.2222, 0.0833, 1, 0.35, 0.0, 555, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "__init__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self):\n outpath = os.path.join(tempfile.gettempdir(), 'listen_some.txt')\n self.outfile = open(outpath, 'w')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99770:Assign_L8_C8", "label": "outpath = join()", "type": "assigned_variable", "loc": [8, 8], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99770:FunctionDef_L7_C4", "vector": [14, 2, 0.2222, 0.0278, 2, 0.41, 0.0, 74, 3, 2, 0, 0, 933, 10, 2], "semantic": {"name": "outpath", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": " outpath = os.path.join(tempfile.gettempdir(), 'listen_some.txt')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99770:Assign_L9_C8", "label": "self.outfile = open()", "type": "assigned_variable", "loc": [9, 9], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99770:FunctionDef_L7_C4", "vector": [14, 2, 0.25, 0.0278, 2, 0.41, 1.0, 579, 3, 2, 0, 0, 693, 10, 1], "semantic": {"name": "self.outfile", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": " self.outfile = open(outpath, 'w')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99770:FunctionDef_L11_C4", "label": "startTest", "type": "function", "loc": [11, 12], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99770:ClassDef_L5_C0", "vector": [2, 1, 0.3194, 0.0556, 1, 0.35, 0.3333, 503, 0, 4, 0, 0, 0, 0, 1], "semantic": {"name": "startTest", "arg_names": ["self", "name", "doc", "tags"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def startTest(self, name, doc, tags):\n self.outfile.write(name + '\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99770:Expr_L12_C8", "label": "write()", "type": "expression", "loc": [12, 12], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99770:FunctionDef_L11_C4", "vector": [8, 2, 0.3333, 0.0278, 2, 0.52, 0.0, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " self.outfile.write(name + '\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99770:FunctionDef_L14_C4", "label": "endSuite", "type": "function", "loc": [14, 15], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99770:ClassDef_L5_C0", "vector": [2, 1, 0.4028, 0.0556, 1, 0.35, 0.6667, 106, 0, 3, 0, 0, 0, 0, 1], "semantic": {"name": "endSuite", "arg_names": ["self", "stat", "msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def endSuite(self, stat, msg):\n self.outfile.write(msg + '\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99770:Expr_L15_C8", "label": "write()", "type": "expression", "loc": [15, 15], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99770:FunctionDef_L14_C4", "vector": [8, 2, 0.4167, 0.0278, 2, 0.59, 0.0, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " self.outfile.write(msg + '\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99770:FunctionDef_L17_C4", "label": "close", "type": "function", "loc": [17, 18], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99770:ClassDef_L5_C0", "vector": [2, 1, 0.4861, 0.0556, 1, 0.35, 1.0, 77, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def close(self):\n self.outfile.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99770:Expr_L18_C8", "label": "close()", "type": "expression", "loc": [18, 18], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99770:FunctionDef_L17_C4", "vector": [8, 2, 0.5, 0.0278, 2, 0.24, 0.0, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": " self.outfile.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99770:ClassDef_L21_C0", "label": "WithArgs", "type": "class", "loc": [21, 27], "level": 0, "parent": null, "vector": [3, 0, 0.6667, 0.1944, 0, 0.66, 0.75, 638, 0, 1, 0, 0, 186, 0, 5], "semantic": {"name": "WithArgs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class WithArgs(object):\n \n def __init__(self, arg1, arg2='default'):\n outpath = os.path.join(tempfile.gettempdir(), 'listener_with_args.txt')\n outfile = open(outpath, 'a')\n outfile.write(\"I got arguments '%s' and '%s'\\n\" % (arg1, arg2))\n outfile.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99770:FunctionDef_L23_C4", "label": "__init__", "type": "function", "loc": [23, 27], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99770:ClassDef_L21_C0", "vector": [2, 1, 0.6944, 0.1389, 1, 0.69, 0.0, 555, 0, 3, 0, 0, 0, 0, 5], "semantic": {"name": "__init__", "arg_names": ["self", "arg1", "arg2"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, arg1, arg2='default'):\n outpath = os.path.join(tempfile.gettempdir(), 'listener_with_args.txt')\n outfile = open(outpath, 'a')\n outfile.write(\"I got arguments '%s' and '%s'\\n\" % (arg1, arg2))\n outfile.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99770:Assign_L24_C8", "label": "outpath = join()", "type": "assigned_variable", "loc": [24, 24], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99770:FunctionDef_L23_C4", "vector": [14, 2, 0.6667, 0.0278, 2, 0.49, 0.0, 74, 3, 2, 0, 0, 933, 10, 2], "semantic": {"name": "outpath", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": " outpath = os.path.join(tempfile.gettempdir(), 'listener_with_args.txt')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99770:Assign_L25_C8", "label": "outfile = open()", "type": "assigned_variable", "loc": [25, 25], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99770:FunctionDef_L23_C4", "vector": [14, 2, 0.6944, 0.0278, 2, 0.49, 0.3333, 206, 3, 2, 0, 0, 693, 10, 1], "semantic": {"name": "outfile", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": " outfile = open(outpath, 'a')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99770:Expr_L26_C8", "label": "write()", "type": "expression", "loc": [26, 26], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99770:FunctionDef_L23_C4", "vector": [8, 2, 0.7222, 0.0278, 2, 0.49, 0.6667, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " outfile.write(\"I got arguments '%s' and '%s'\\n\" % (arg1, arg2))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99770:Expr_L27_C8", "label": "close()", "type": "expression", "loc": [27, 27], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99770:FunctionDef_L23_C4", "vector": [8, 2, 0.75, 0.0278, 2, 0.49, 1.0, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": " outfile.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99770:ClassDef_L30_C0", "label": "InvalidMethods", "type": "class", "loc": [30, 36], "level": 0, "parent": null, "vector": [3, 0, 0.9167, 0.1944, 0, 0.66, 1.0, 935, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "InvalidMethods", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class InvalidMethods:\n \n def start_suite(self, wrong, number, of, args, here):\n pass\n \n def end_suite(self, *args):\n raise RuntimeError(\"Here comes an exception!\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99770:FunctionDef_L32_C4", "label": "start_suite", "type": "function", "loc": [32, 33], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99770:ClassDef_L30_C0", "vector": [2, 1, 0.9028, 0.0556, 1, 0.25, 0.0, 38, 0, 6, 0, 0, 0, 0, 0], "semantic": {"name": "start_suite", "arg_names": ["self", "wrong", "number", "of", "args", "here"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def start_suite(self, wrong, number, of, args, here):\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99770:FunctionDef_L35_C4", "label": "end_suite", "type": "function", "loc": [35, 36], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99770:ClassDef_L30_C0", "vector": [2, 1, 0.9861, 0.0556, 1, 0.25, 1.0, 81, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "end_suite", "arg_names": ["self", "args"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def end_suite(self, *args):\n raise RuntimeError(\"Here comes an exception!\")"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99770:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99770:FunctionDef_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99770:FunctionDef_L7_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99770:Assign_L8_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99770:FunctionDef_L7_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99770:Assign_L9_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99770:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99770:FunctionDef_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99770:FunctionDef_L11_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99770:Expr_L12_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99770:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99770:FunctionDef_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99770:FunctionDef_L14_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99770:Expr_L15_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99770:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99770:FunctionDef_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99770:FunctionDef_L17_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99770:Expr_L18_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99770:ClassDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99770:FunctionDef_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99770:FunctionDef_L23_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99770:Assign_L24_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99770:FunctionDef_L23_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99770:Assign_L25_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99770:FunctionDef_L23_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99770:Expr_L26_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99770:FunctionDef_L23_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99770:Expr_L27_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99770:ClassDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99770:FunctionDef_L32_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99770:ClassDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99770:FunctionDef_L35_C4"}] |
import os
import tempfile
from robot.libraries.BuiltIn import BuiltIn
class ListenSome:
ROBOT_LISTENER_API_VERSION = '2'
def __init__(self):
outpath = os.path.join(tempfile.gettempdir(), 'listen_some.txt')
self.outfile = open(outpath, 'w')
def startTest(self, name, attrs):
self.outfile.write(name + '\n')
def endSuite(self, name, attrs):
self.outfile.write(attrs['statistics'] + '\n')
def close(self):
self.outfile.close()
class WithArgs(object):
ROBOT_LISTENER_API_VERSION = '2'
def __init__(self, arg1, arg2='default'):
outpath = os.path.join(tempfile.gettempdir(), 'listener_with_args.txt')
outfile = open(outpath, 'a')
outfile.write("I got arguments '%s' and '%s'\n" % (arg1, arg2))
outfile.close()
class InvalidMethods:
ROBOT_LISTENER_API_VERSION = '2'
def start_suite(self, wrong, number, of, args, here):
pass
def end_suite(self, *args):
raise RuntimeError("Here comes an exception!")
def message(self, msg):
raise ValueError("This fails continuously!")
class SuiteAndTestCounts(object):
ROBOT_LISTENER_API_VERSION = '2'
exp_data = {
'Subsuites & Subsuites2': ([], ['Subsuites', 'Subsuites2'], 4),
'Subsuites': ([], ['Sub1', 'Sub2'], 2),
'Sub1': (['SubSuite1 First'], [], 1),
'Sub2': (['SubSuite2 First'], [], 1),
'Subsuites2': ([], ['Subsuite3'], 2),
'Subsuite3': (['SubSuite3 First', 'SubSuite3 Second'], [], 2),
}
def start_suite(self, name, attrs):
data = attrs['tests'], attrs['suites'], attrs['totaltests']
if not data == self.exp_data[name]:
raise RuntimeError('Wrong tests or suites in %s, %s != %s' %
(name, self.exp_data[name], data))
class KeywordType(object):
ROBOT_LISTENER_API_VERSION = '2'
def start_keyword(self, name, attrs):
expected = attrs['args'][0] if name == 'BuiltIn.Log' else name
if attrs['type'] != expected:
raise RuntimeError("Wrong keyword type '%s', expected '%s'."
% (attrs['type'], expected))
end_keyword = start_keyword
class KeywordExecutingListener(object):
ROBOT_LISTENER_API_VERSION = '2'
def start_suite(self, name, attrs):
self._start(name)
def end_suite(self, name, attrs):
self._end(name)
def start_test(self, name, attrs):
self._start(name)
def end_test(self, name, attrs):
self._end(name)
def _start(self, name):
self._run_keyword('Start %s' % name)
def _end(self, name):
self._run_keyword('End %s' % name)
def _run_keyword(self, arg):
BuiltIn().run_keyword('Log', arg)
| ajibawa-2023/Python-Code-Large/train/row_99771 | 54 | 99 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99771:Import_L1_C0", "label": "os import os", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0101, 0.0101, 0, 0.66, 0.0, 688, 0, 1, 0, 0, 688, 0, 0], "semantic": {"name": "os", "arg_names": [], "import_names": ["os"], "rhs_call_name": "", "annotation": ""}, "snippet": "import os"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99771:Import_L2_C0", "label": "tempfile import tempfile", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0202, 0.0101, 0, 0.66, 0.125, 516, 0, 1, 0, 0, 516, 0, 0], "semantic": {"name": "tempfile", "arg_names": [], "import_names": ["tempfile"], "rhs_call_name": "", "annotation": ""}, "snippet": "import tempfile"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99771:ImportFrom_L4_C0", "label": "from robot.libraries.BuiltIn import BuiltIn", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0404, 0.0101, 0, 0.66, 0.25, 588, 0, 1, 0, 0, 588, 0, 0], "semantic": {"name": "robot.libraries.BuiltIn", "arg_names": [], "import_names": ["BuiltIn"], "rhs_call_name": "", "annotation": ""}, "snippet": "from robot.libraries.BuiltIn import BuiltIn"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99771:ClassDef_L7_C0", "label": "ListenSome", "type": "class", "loc": [7, 21], "level": 0, "parent": null, "vector": [3, 0, 0.1414, 0.1515, 0, 0.66, 0.375, 502, 0, 4, 0, 0, 0, 0, 6], "semantic": {"name": "ListenSome", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class ListenSome:\n ROBOT_LISTENER_API_VERSION = '2'\n\n def __init__(self):\n outpath = os.path.join(tempfile.gettempdir(), 'listen_some.txt')\n self.outfile = open(outpath, 'w')\n\n def startTest(self, name, attrs):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99771:Assign_L8_C4", "label": "ROBOT_LISTENER_API_VERSION =", "type": "assigned_variable", "loc": [8, 8], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99771:ClassDef_L7_C0", "vector": [14, 1, 0.0808, 0.0101, 1, 0.46, 0.0, 63, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "ROBOT_LISTENER_API_VERSION", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ROBOT_LISTENER_API_VERSION = '2'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99771:FunctionDef_L10_C4", "label": "__init__", "type": "function", "loc": [10, 12], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99771:ClassDef_L7_C0", "vector": [2, 1, 0.1111, 0.0303, 1, 0.46, 0.25, 555, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "__init__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self):\n outpath = os.path.join(tempfile.gettempdir(), 'listen_some.txt')\n self.outfile = open(outpath, 'w')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99771:Assign_L11_C8", "label": "outpath = join()", "type": "assigned_variable", "loc": [11, 11], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99771:FunctionDef_L10_C4", "vector": [14, 2, 0.1111, 0.0101, 2, 0.48, 0.0, 74, 3, 2, 0, 0, 933, 10, 2], "semantic": {"name": "outpath", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": " outpath = os.path.join(tempfile.gettempdir(), 'listen_some.txt')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99771:Assign_L12_C8", "label": "self.outfile = open()", "type": "assigned_variable", "loc": [12, 12], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99771:FunctionDef_L10_C4", "vector": [14, 2, 0.1212, 0.0101, 2, 0.48, 1.0, 579, 3, 2, 0, 0, 693, 10, 1], "semantic": {"name": "self.outfile", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": " self.outfile = open(outpath, 'w')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99771:FunctionDef_L14_C4", "label": "startTest", "type": "function", "loc": [14, 15], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99771:ClassDef_L7_C0", "vector": [2, 1, 0.1465, 0.0202, 1, 0.46, 0.5, 503, 0, 3, 0, 0, 0, 0, 1], "semantic": {"name": "startTest", "arg_names": ["self", "name", "attrs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def startTest(self, name, attrs):\n self.outfile.write(name + '\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99771:Expr_L15_C8", "label": "write()", "type": "expression", "loc": [15, 15], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99771:FunctionDef_L14_C4", "vector": [8, 2, 0.1515, 0.0101, 2, 0.73, 0.0, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " self.outfile.write(name + '\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99771:FunctionDef_L17_C4", "label": "endSuite", "type": "function", "loc": [17, 18], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99771:ClassDef_L7_C0", "vector": [2, 1, 0.1768, 0.0202, 1, 0.46, 0.75, 106, 0, 3, 0, 0, 0, 0, 1], "semantic": {"name": "endSuite", "arg_names": ["self", "name", "attrs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def endSuite(self, name, attrs):\n self.outfile.write(attrs['statistics'] + '\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99771:Expr_L18_C8", "label": "write()", "type": "expression", "loc": [18, 18], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99771:FunctionDef_L17_C4", "vector": [8, 2, 0.1818, 0.0101, 2, 0.51, 0.0, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " self.outfile.write(attrs['statistics'] + '\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99771:FunctionDef_L20_C4", "label": "close", "type": "function", "loc": [20, 21], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99771:ClassDef_L7_C0", "vector": [2, 1, 0.2071, 0.0202, 1, 0.46, 1.0, 77, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def close(self):\n self.outfile.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99771:Expr_L21_C8", "label": "close()", "type": "expression", "loc": [21, 21], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99771:FunctionDef_L20_C4", "vector": [8, 2, 0.2121, 0.0101, 2, 0.88, 0.0, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": " self.outfile.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99771:ClassDef_L24_C0", "label": "WithArgs", "type": "class", "loc": [24, 31], "level": 0, "parent": null, "vector": [3, 0, 0.2778, 0.0808, 0, 0.66, 0.5, 638, 0, 1, 0, 0, 186, 0, 5], "semantic": {"name": "WithArgs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class WithArgs(object):\n ROBOT_LISTENER_API_VERSION = '2'\n\n def __init__(self, arg1, arg2='default'):\n outpath = os.path.join(tempfile.gettempdir(), 'listener_with_args.txt')\n outfile = open(outpath, 'a')\n outfile.write(\"I got arguments '%s' and '%s'\\n\" % (arg1, arg2))\n outfile.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99771:Assign_L25_C4", "label": "ROBOT_LISTENER_API_VERSION =", "type": "assigned_variable", "loc": [25, 25], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99771:ClassDef_L24_C0", "vector": [14, 1, 0.2525, 0.0101, 1, 0.76, 0.0, 63, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "ROBOT_LISTENER_API_VERSION", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ROBOT_LISTENER_API_VERSION = '2'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99771:FunctionDef_L27_C4", "label": "__init__", "type": "function", "loc": [27, 31], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99771:ClassDef_L24_C0", "vector": [2, 1, 0.2929, 0.0505, 1, 0.76, 1.0, 555, 0, 3, 0, 0, 0, 0, 5], "semantic": {"name": "__init__", "arg_names": ["self", "arg1", "arg2"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, arg1, arg2='default'):\n outpath = os.path.join(tempfile.gettempdir(), 'listener_with_args.txt')\n outfile = open(outpath, 'a')\n outfile.write(\"I got arguments '%s' and '%s'\\n\" % (arg1, arg2))\n outfile.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99771:Assign_L28_C8", "label": "outpath = join()", "type": "assigned_variable", "loc": [28, 28], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99771:FunctionDef_L27_C4", "vector": [14, 2, 0.2828, 0.0101, 2, 0.54, 0.0, 74, 3, 2, 0, 0, 933, 10, 2], "semantic": {"name": "outpath", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": " outpath = os.path.join(tempfile.gettempdir(), 'listener_with_args.txt')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99771:Assign_L29_C8", "label": "outfile = open()", "type": "assigned_variable", "loc": [29, 29], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99771:FunctionDef_L27_C4", "vector": [14, 2, 0.2929, 0.0101, 2, 0.54, 0.3333, 206, 3, 2, 0, 0, 693, 10, 1], "semantic": {"name": "outfile", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": " outfile = open(outpath, 'a')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99771:Expr_L30_C8", "label": "write()", "type": "expression", "loc": [30, 30], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99771:FunctionDef_L27_C4", "vector": [8, 2, 0.303, 0.0101, 2, 0.54, 0.6667, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " outfile.write(\"I got arguments '%s' and '%s'\\n\" % (arg1, arg2))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99771:Expr_L31_C8", "label": "close()", "type": "expression", "loc": [31, 31], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99771:FunctionDef_L27_C4", "vector": [8, 2, 0.3131, 0.0101, 2, 0.54, 1.0, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": " outfile.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99771:ClassDef_L34_C0", "label": "InvalidMethods", "type": "class", "loc": [34, 44], "level": 0, "parent": null, "vector": [3, 0, 0.3939, 0.1111, 0, 0.66, 0.625, 935, 0, 3, 0, 0, 0, 0, 2], "semantic": {"name": "InvalidMethods", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class InvalidMethods:\n ROBOT_LISTENER_API_VERSION = '2'\n\n def start_suite(self, wrong, number, of, args, here):\n pass\n\n def end_suite(self, *args):\n raise RuntimeError(\"Here comes an exception!\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99771:Assign_L35_C4", "label": "ROBOT_LISTENER_API_VERSION =", "type": "assigned_variable", "loc": [35, 35], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99771:ClassDef_L34_C0", "vector": [14, 1, 0.3535, 0.0101, 1, 0.92, 0.0, 63, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "ROBOT_LISTENER_API_VERSION", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ROBOT_LISTENER_API_VERSION = '2'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99771:FunctionDef_L37_C4", "label": "start_suite", "type": "function", "loc": [37, 38], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99771:ClassDef_L34_C0", "vector": [2, 1, 0.3788, 0.0202, 1, 0.92, 0.3333, 38, 0, 6, 0, 0, 0, 0, 0], "semantic": {"name": "start_suite", "arg_names": ["self", "wrong", "number", "of", "args", "here"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def start_suite(self, wrong, number, of, args, here):\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99771:FunctionDef_L40_C4", "label": "end_suite", "type": "function", "loc": [40, 41], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99771:ClassDef_L34_C0", "vector": [2, 1, 0.4091, 0.0202, 1, 0.92, 0.6667, 81, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "end_suite", "arg_names": ["self", "args"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def end_suite(self, *args):\n raise RuntimeError(\"Here comes an exception!\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99771:FunctionDef_L43_C4", "label": "message", "type": "function", "loc": [43, 44], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99771:ClassDef_L34_C0", "vector": [2, 1, 0.4394, 0.0202, 1, 0.92, 1.0, 635, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "message", "arg_names": ["self", "msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def message(self, msg):\n raise ValueError(\"This fails continuously!\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99771:ClassDef_L47_C0", "label": "SuiteAndTestCounts", "type": "class", "loc": [47, 62], "level": 0, "parent": null, "vector": [3, 0, 0.5505, 0.1616, 0, 0.66, 0.75, 638, 0, 1, 0, 0, 186, 0, 1], "semantic": {"name": "SuiteAndTestCounts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class SuiteAndTestCounts(object):\n ROBOT_LISTENER_API_VERSION = '2'\n exp_data = {\n 'Subsuites & Subsuites2': ([], ['Subsuites', 'Subsuites2'], 4),\n 'Subsuites': ([], ['Sub1', 'Sub2'], 2),\n 'Sub1': (['SubSuite1 First'], [], 1),\n 'Sub2': (['SubSuite2 First'], [], 1),\n 'Subsuites2': ([], ['Subsuite3'], 2),"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99771:Assign_L48_C4", "label": "ROBOT_LISTENER_API_VERSION =", "type": "assigned_variable", "loc": [48, 48], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99771:ClassDef_L47_C0", "vector": [14, 1, 0.4848, 0.0101, 1, 0.92, 0.0, 63, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "ROBOT_LISTENER_API_VERSION", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ROBOT_LISTENER_API_VERSION = '2'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99771:Assign_L49_C4", "label": "exp_data =", "type": "assigned_variable", "loc": [49, 56], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99771:ClassDef_L47_C0", "vector": [14, 1, 0.5303, 0.0808, 1, 0.92, 0.5, 825, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "exp_data", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " exp_data = {\n 'Subsuites & Subsuites2': ([], ['Subsuites', 'Subsuites2'], 4),\n 'Subsuites': ([], ['Sub1', 'Sub2'], 2),\n 'Sub1': (['SubSuite1 First'], [], 1),\n 'Sub2': (['SubSuite2 First'], [], 1),\n 'Subsuites2': ([], ['Subsuite3'], 2),\n 'Subsuite3': (['SubSuite3 First', 'SubSuite3 Second'], [], 2),\n }"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99771:FunctionDef_L58_C4", "label": "start_suite", "type": "function", "loc": [58, 62], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99771:ClassDef_L47_C0", "vector": [2, 1, 0.6061, 0.0505, 1, 0.92, 1.0, 38, 0, 3, 0, 0, 0, 0, 1], "semantic": {"name": "start_suite", "arg_names": ["self", "name", "attrs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def start_suite(self, name, attrs):\n data = attrs['tests'], attrs['suites'], attrs['totaltests']\n if not data == self.exp_data[name]:\n raise RuntimeError('Wrong tests or suites in %s, %s != %s' %\n (name, self.exp_data[name], data))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99771:Assign_L59_C8", "label": "data =", "type": "assigned_variable", "loc": [59, 59], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99771:FunctionDef_L58_C4", "vector": [14, 2, 0.596, 0.0101, 2, 0.41, 0.0, 929, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "data", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " data = attrs['tests'], attrs['suites'], attrs['totaltests']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99771:If_L60_C8", "label": "if", "type": "if", "loc": [60, 62], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99771:FunctionDef_L58_C4", "vector": [4, 2, 0.6162, 0.0303, 2, 0.41, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not data == self.exp_data[name]:\n raise RuntimeError('Wrong tests or suites in %s, %s != %s' %\n (name, self.exp_data[name], data))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99771:ClassDef_L65_C0", "label": "KeywordType", "type": "class", "loc": [65, 74], "level": 0, "parent": null, "vector": [3, 0, 0.702, 0.101, 0, 0.66, 0.875, 915, 0, 1, 0, 0, 186, 0, 1], "semantic": {"name": "KeywordType", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class KeywordType(object):\n ROBOT_LISTENER_API_VERSION = '2'\n\n def start_keyword(self, name, attrs):\n expected = attrs['args'][0] if name == 'BuiltIn.Log' else name\n if attrs['type'] != expected:\n raise RuntimeError(\"Wrong keyword type '%s', expected '%s'.\"\n % (attrs['type'], expected))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99771:Assign_L66_C4", "label": "ROBOT_LISTENER_API_VERSION =", "type": "assigned_variable", "loc": [66, 66], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99771:ClassDef_L65_C0", "vector": [14, 1, 0.6667, 0.0101, 1, 0.38, 0.0, 63, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "ROBOT_LISTENER_API_VERSION", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ROBOT_LISTENER_API_VERSION = '2'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99771:FunctionDef_L68_C4", "label": "start_keyword", "type": "function", "loc": [68, 72], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99771:ClassDef_L65_C0", "vector": [2, 1, 0.7071, 0.0505, 1, 0.38, 0.5, 776, 0, 3, 0, 0, 0, 0, 1], "semantic": {"name": "start_keyword", "arg_names": ["self", "name", "attrs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def start_keyword(self, name, attrs):\n expected = attrs['args'][0] if name == 'BuiltIn.Log' else name\n if attrs['type'] != expected:\n raise RuntimeError(\"Wrong keyword type '%s', expected '%s'.\"\n % (attrs['type'], expected))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99771:Assign_L69_C8", "label": "expected =", "type": "assigned_variable", "loc": [69, 69], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99771:FunctionDef_L68_C4", "vector": [14, 2, 0.697, 0.0101, 2, 0.64, 0.0, 361, 8, 0, 0, 0, 0, 0, 0], "semantic": {"name": "expected", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " expected = attrs['args'][0] if name == 'BuiltIn.Log' else name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99771:If_L70_C8", "label": "if", "type": "if", "loc": [70, 72], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99771:FunctionDef_L68_C4", "vector": [4, 2, 0.7172, 0.0303, 2, 0.64, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if attrs['type'] != expected:\n raise RuntimeError(\"Wrong keyword type '%s', expected '%s'.\"\n % (attrs['type'], expected))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99771:Assign_L74_C4", "label": "end_keyword =", "type": "assigned_variable", "loc": [74, 74], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99771:ClassDef_L65_C0", "vector": [14, 1, 0.7475, 0.0101, 1, 0.38, 1.0, 959, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "end_keyword", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " end_keyword = start_keyword"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99771:ClassDef_L77_C0", "label": "KeywordExecutingListener", "type": "class", "loc": [77, 99], "level": 0, "parent": null, "vector": [3, 0, 0.8889, 0.2323, 0, 0.66, 1.0, 469, 0, 7, 0, 0, 186, 0, 8], "semantic": {"name": "KeywordExecutingListener", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class KeywordExecutingListener(object):\n ROBOT_LISTENER_API_VERSION = '2'\n\n def start_suite(self, name, attrs):\n self._start(name)\n\n def end_suite(self, name, attrs):\n self._end(name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99771:Assign_L78_C4", "label": "ROBOT_LISTENER_API_VERSION =", "type": "assigned_variable", "loc": [78, 78], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99771:ClassDef_L77_C0", "vector": [14, 1, 0.7879, 0.0101, 1, 0.56, 0.0, 63, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "ROBOT_LISTENER_API_VERSION", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ROBOT_LISTENER_API_VERSION = '2'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99771:FunctionDef_L80_C4", "label": "start_suite", "type": "function", "loc": [80, 81], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99771:ClassDef_L77_C0", "vector": [2, 1, 0.8131, 0.0202, 1, 0.56, 0.1429, 38, 0, 3, 0, 0, 0, 0, 1], "semantic": {"name": "start_suite", "arg_names": ["self", "name", "attrs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def start_suite(self, name, attrs):\n self._start(name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99771:Expr_L81_C8", "label": "_start()", "type": "expression", "loc": [81, 81], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99771:FunctionDef_L80_C4", "vector": [8, 2, 0.8182, 0.0101, 2, 0.96, 0.0, 212, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_start", "arg_names": [], "import_names": [], "rhs_call_name": "_start", "annotation": ""}, "snippet": " self._start(name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99771:FunctionDef_L83_C4", "label": "end_suite", "type": "function", "loc": [83, 84], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99771:ClassDef_L77_C0", "vector": [2, 1, 0.8434, 0.0202, 1, 0.56, 0.2857, 81, 0, 3, 0, 0, 0, 0, 1], "semantic": {"name": "end_suite", "arg_names": ["self", "name", "attrs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def end_suite(self, name, attrs):\n self._end(name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99771:Expr_L84_C8", "label": "_end()", "type": "expression", "loc": [84, 84], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99771:FunctionDef_L83_C4", "vector": [8, 2, 0.8485, 0.0101, 2, 0.74, 0.0, 964, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_end", "arg_names": [], "import_names": [], "rhs_call_name": "_end", "annotation": ""}, "snippet": " self._end(name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99771:FunctionDef_L86_C4", "label": "start_test", "type": "function", "loc": [86, 87], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99771:ClassDef_L77_C0", "vector": [2, 1, 0.8737, 0.0202, 1, 0.56, 0.4286, 246, 0, 3, 0, 0, 0, 0, 1], "semantic": {"name": "start_test", "arg_names": ["self", "name", "attrs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def start_test(self, name, attrs):\n self._start(name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99771:Expr_L87_C8", "label": "_start()", "type": "expression", "loc": [87, 87], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99771:FunctionDef_L86_C4", "vector": [8, 2, 0.8788, 0.0101, 2, 0.11, 0.0, 212, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_start", "arg_names": [], "import_names": [], "rhs_call_name": "_start", "annotation": ""}, "snippet": " self._start(name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99771:FunctionDef_L89_C4", "label": "end_test", "type": "function", "loc": [89, 90], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99771:ClassDef_L77_C0", "vector": [2, 1, 0.904, 0.0202, 1, 0.56, 0.5714, 220, 0, 3, 0, 0, 0, 0, 1], "semantic": {"name": "end_test", "arg_names": ["self", "name", "attrs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def end_test(self, name, attrs):\n self._end(name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99771:Expr_L90_C8", "label": "_end()", "type": "expression", "loc": [90, 90], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99771:FunctionDef_L89_C4", "vector": [8, 2, 0.9091, 0.0101, 2, 0.79, 0.0, 964, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_end", "arg_names": [], "import_names": [], "rhs_call_name": "_end", "annotation": ""}, "snippet": " self._end(name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99771:FunctionDef_L92_C4", "label": "_start", "type": "function", "loc": [92, 93], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99771:ClassDef_L77_C0", "vector": [2, 1, 0.9343, 0.0202, 1, 0.56, 0.7143, 212, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "_start", "arg_names": ["self", "name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _start(self, name):\n self._run_keyword('Start %s' % name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99771:Expr_L93_C8", "label": "_run_keyword()", "type": "expression", "loc": [93, 93], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99771:FunctionDef_L92_C4", "vector": [8, 2, 0.9394, 0.0101, 2, 0.36, 0.0, 972, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_run_keyword", "arg_names": [], "import_names": [], "rhs_call_name": "_run_keyword", "annotation": ""}, "snippet": " self._run_keyword('Start %s' % name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99771:FunctionDef_L95_C4", "label": "_end", "type": "function", "loc": [95, 96], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99771:ClassDef_L77_C0", "vector": [2, 1, 0.9646, 0.0202, 1, 0.56, 0.8571, 964, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "_end", "arg_names": ["self", "name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _end(self, name):\n self._run_keyword('End %s' % name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99771:Expr_L96_C8", "label": "_run_keyword()", "type": "expression", "loc": [96, 96], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99771:FunctionDef_L95_C4", "vector": [8, 2, 0.9697, 0.0101, 2, 0.86, 0.0, 972, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_run_keyword", "arg_names": [], "import_names": [], "rhs_call_name": "_run_keyword", "annotation": ""}, "snippet": " self._run_keyword('End %s' % name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99771:FunctionDef_L98_C4", "label": "_run_keyword", "type": "function", "loc": [98, 99], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99771:ClassDef_L77_C0", "vector": [2, 1, 0.9949, 0.0202, 1, 0.56, 1.0, 972, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "_run_keyword", "arg_names": ["self", "arg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _run_keyword(self, arg):\n BuiltIn().run_keyword('Log', arg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99771:Expr_L99_C8", "label": "run_keyword()", "type": "expression", "loc": [99, 99], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99771:FunctionDef_L98_C4", "vector": [8, 2, 1.0, 0.0101, 2, 0.02, 0.0, 458, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "run_keyword", "arg_names": [], "import_names": [], "rhs_call_name": "run_keyword", "annotation": ""}, "snippet": " BuiltIn().run_keyword('Log', arg)"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99771:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99771:Assign_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99771:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99771:FunctionDef_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99771:FunctionDef_L10_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99771:Assign_L11_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99771:FunctionDef_L10_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99771:Assign_L12_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99771:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99771:FunctionDef_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99771:FunctionDef_L14_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99771:Expr_L15_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99771:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99771:FunctionDef_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99771:FunctionDef_L17_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99771:Expr_L18_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99771:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99771:FunctionDef_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99771:FunctionDef_L20_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99771:Expr_L21_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99771:ClassDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99771:Assign_L25_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99771:ClassDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99771:FunctionDef_L27_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99771:FunctionDef_L27_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99771:Assign_L28_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99771:FunctionDef_L27_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99771:Assign_L29_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99771:FunctionDef_L27_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99771:Expr_L30_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99771:FunctionDef_L27_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99771:Expr_L31_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99771:ClassDef_L34_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99771:Assign_L35_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99771:ClassDef_L34_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99771:FunctionDef_L37_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99771:ClassDef_L34_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99771:FunctionDef_L40_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99771:ClassDef_L34_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99771:FunctionDef_L43_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99771:ClassDef_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99771:Assign_L48_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99771:ClassDef_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99771:Assign_L49_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99771:ClassDef_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99771:FunctionDef_L58_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99771:FunctionDef_L58_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99771:Assign_L59_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99771:FunctionDef_L58_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99771:If_L60_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99771:ClassDef_L65_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99771:Assign_L66_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99771:ClassDef_L65_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99771:FunctionDef_L68_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99771:FunctionDef_L68_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99771:Assign_L69_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99771:FunctionDef_L68_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99771:If_L70_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99771:ClassDef_L65_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99771:Assign_L74_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99771:ClassDef_L77_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99771:Assign_L78_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99771:ClassDef_L77_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99771:FunctionDef_L80_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99771:FunctionDef_L80_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99771:Expr_L81_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99771:ClassDef_L77_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99771:FunctionDef_L83_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99771:FunctionDef_L83_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99771:Expr_L84_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99771:ClassDef_L77_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99771:FunctionDef_L86_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99771:FunctionDef_L86_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99771:Expr_L87_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99771:ClassDef_L77_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99771:FunctionDef_L89_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99771:FunctionDef_L89_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99771:Expr_L90_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99771:ClassDef_L77_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99771:FunctionDef_L92_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99771:FunctionDef_L92_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99771:Expr_L93_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99771:ClassDef_L77_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99771:FunctionDef_L95_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99771:FunctionDef_L95_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99771:Expr_L96_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99771:ClassDef_L77_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99771:FunctionDef_L98_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99771:FunctionDef_L98_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99771:Expr_L99_C8"}] |
import os
import tempfile
outpath = os.path.join(tempfile.gettempdir(), 'listen_by_module.txt')
OUTFILE = open(outpath, 'w')
def start_suite(name, doc):
OUTFILE.write("SUITE START: %s '%s'\n" % (name, doc))
def start_test(name, doc, tags):
tags = [ str(tag) for tag in tags ]
OUTFILE.write("TEST START: %s '%s' %s\n" % (name, doc, tags))
def start_keyword(name, args):
args = [str(arg) for arg in args]
OUTFILE.write("KW START: %s %s\n" % (name, args))
def end_keyword(status):
OUTFILE.write("KW END: %s\n" % (status))
def end_test(status, message):
if status == 'PASS':
OUTFILE.write('TEST END: PASS\n')
else:
OUTFILE.write("TEST END: %s %s\n" % (status, message))
def end_suite(status, message):
OUTFILE.write('SUITE END: %s %s\n' % (status, message))
def output_file(path):
_out_file('Output', path)
def report_file(path):
_out_file('Report', path)
def log_file(path):
_out_file('Log', path)
def debug_file(path):
_out_file('Debug', path)
def _out_file(name, path):
assert os.path.isabs(path)
OUTFILE.write('%s: %s\n' % (name, os.path.basename(path)))
def close():
OUTFILE.write('Closing...\n')
OUTFILE.close()
| ajibawa-2023/Python-Code-Large/train/row_99772 | 33 | 49 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99772:Import_L1_C0", "label": "os import os", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0204, 0.0204, 0, 0.66, 0.0, 688, 0, 1, 0, 0, 688, 0, 0], "semantic": {"name": "os", "arg_names": [], "import_names": ["os"], "rhs_call_name": "", "annotation": ""}, "snippet": "import os"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99772:Import_L2_C0", "label": "tempfile import tempfile", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0408, 0.0204, 0, 0.66, 0.0667, 516, 0, 1, 0, 0, 516, 0, 0], "semantic": {"name": "tempfile", "arg_names": [], "import_names": ["tempfile"], "rhs_call_name": "", "annotation": ""}, "snippet": "import tempfile"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99772:Assign_L4_C0", "label": "outpath = join()", "type": "assigned_variable", "loc": [4, 4], "level": 0, "parent": null, "vector": [14, 0, 0.0816, 0.0204, 0, 0.66, 0.1333, 74, 3, 2, 0, 0, 933, 10, 2], "semantic": {"name": "outpath", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": "outpath = os.path.join(tempfile.gettempdir(), 'listen_by_module.txt')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99772:Assign_L5_C0", "label": "OUTFILE = open()", "type": "assigned_variable", "loc": [5, 5], "level": 0, "parent": null, "vector": [14, 0, 0.102, 0.0204, 0, 0.66, 0.2, 351, 3, 2, 0, 0, 693, 10, 1], "semantic": {"name": "OUTFILE", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": "OUTFILE = open(outpath, 'w')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99772:FunctionDef_L8_C0", "label": "start_suite", "type": "function", "loc": [8, 9], "level": 0, "parent": null, "vector": [2, 0, 0.1735, 0.0408, 0, 0.66, 0.2667, 38, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "start_suite", "arg_names": ["name", "doc"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def start_suite(name, doc):\n OUTFILE.write(\"SUITE START: %s '%s'\\n\" % (name, doc))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99772:Expr_L9_C4", "label": "write()", "type": "expression", "loc": [9, 9], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99772:FunctionDef_L8_C0", "vector": [8, 1, 0.1837, 0.0204, 1, 0.58, 0.0, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " OUTFILE.write(\"SUITE START: %s '%s'\\n\" % (name, doc))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99772:FunctionDef_L11_C0", "label": "start_test", "type": "function", "loc": [11, 13], "level": 0, "parent": null, "vector": [2, 0, 0.2449, 0.0612, 0, 0.66, 0.3333, 246, 0, 3, 0, 0, 0, 0, 2], "semantic": {"name": "start_test", "arg_names": ["name", "doc", "tags"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def start_test(name, doc, tags):\n tags = [ str(tag) for tag in tags ]\n OUTFILE.write(\"TEST START: %s '%s' %s\\n\" % (name, doc, tags))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99772:Assign_L12_C4", "label": "tags =", "type": "assigned_variable", "loc": [12, 12], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99772:FunctionDef_L11_C0", "vector": [14, 1, 0.2449, 0.0204, 1, 0.13, 0.0, 487, 5, 0, 0, 0, 0, 0, 1], "semantic": {"name": "tags", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tags = [ str(tag) for tag in tags ]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99772:Expr_L13_C4", "label": "write()", "type": "expression", "loc": [13, 13], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99772:FunctionDef_L11_C0", "vector": [8, 1, 0.2653, 0.0204, 1, 0.13, 1.0, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " OUTFILE.write(\"TEST START: %s '%s' %s\\n\" % (name, doc, tags))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99772:FunctionDef_L15_C0", "label": "start_keyword", "type": "function", "loc": [15, 17], "level": 0, "parent": null, "vector": [2, 0, 0.3265, 0.0612, 0, 0.66, 0.4, 776, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "start_keyword", "arg_names": ["name", "args"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def start_keyword(name, args):\n args = [str(arg) for arg in args]\n OUTFILE.write(\"KW START: %s %s\\n\" % (name, args))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99772:Assign_L16_C4", "label": "args =", "type": "assigned_variable", "loc": [16, 16], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99772:FunctionDef_L15_C0", "vector": [14, 1, 0.3265, 0.0204, 1, 0.52, 0.0, 805, 5, 0, 0, 0, 0, 0, 1], "semantic": {"name": "args", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " args = [str(arg) for arg in args]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99772:Expr_L17_C4", "label": "write()", "type": "expression", "loc": [17, 17], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99772:FunctionDef_L15_C0", "vector": [8, 1, 0.3469, 0.0204, 1, 0.52, 1.0, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " OUTFILE.write(\"KW START: %s %s\\n\" % (name, args))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99772:FunctionDef_L19_C0", "label": "end_keyword", "type": "function", "loc": [19, 20], "level": 0, "parent": null, "vector": [2, 0, 0.398, 0.0408, 0, 0.66, 0.4667, 959, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "end_keyword", "arg_names": ["status"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def end_keyword(status):\n OUTFILE.write(\"KW END: %s\\n\" % (status))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99772:Expr_L20_C4", "label": "write()", "type": "expression", "loc": [20, 20], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99772:FunctionDef_L19_C0", "vector": [8, 1, 0.4082, 0.0204, 1, 0.68, 0.0, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " OUTFILE.write(\"KW END: %s\\n\" % (status))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99772:FunctionDef_L22_C0", "label": "end_test", "type": "function", "loc": [22, 26], "level": 0, "parent": null, "vector": [2, 0, 0.4898, 0.102, 0, 0.66, 0.5333, 220, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "end_test", "arg_names": ["status", "message"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def end_test(status, message):\n if status == 'PASS':\n OUTFILE.write('TEST END: PASS\\n')\n else:\n OUTFILE.write(\"TEST END: %s %s\\n\" % (status, message))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99772:If_L23_C4", "label": "if", "type": "if", "loc": [23, 26], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99772:FunctionDef_L22_C0", "vector": [4, 1, 0.5, 0.0816, 1, 0.38, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if status == 'PASS':\n OUTFILE.write('TEST END: PASS\\n')\n else:\n OUTFILE.write(\"TEST END: %s %s\\n\" % (status, message))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99772:Expr_L24_C8", "label": "write()", "type": "expression", "loc": [24, 24], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99772:If_L23_C4", "vector": [8, 2, 0.4898, 0.0204, 2, 0.49, 0.0, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " OUTFILE.write('TEST END: PASS\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99772:Expr_L26_C8", "label": "write()", "type": "expression", "loc": [26, 26], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99772:If_L23_C4", "vector": [8, 2, 0.5306, 0.0204, 2, 0.49, 1.0, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " OUTFILE.write(\"TEST END: %s %s\\n\" % (status, message))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99772:FunctionDef_L28_C0", "label": "end_suite", "type": "function", "loc": [28, 29], "level": 0, "parent": null, "vector": [2, 0, 0.5816, 0.0408, 0, 0.66, 0.6, 81, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "end_suite", "arg_names": ["status", "message"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def end_suite(status, message):\n OUTFILE.write('SUITE END: %s %s\\n' % (status, message))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99772:Expr_L29_C4", "label": "write()", "type": "expression", "loc": [29, 29], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99772:FunctionDef_L28_C0", "vector": [8, 1, 0.5918, 0.0204, 1, 0.5, 0.0, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " OUTFILE.write('SUITE END: %s %s\\n' % (status, message))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99772:FunctionDef_L31_C0", "label": "output_file", "type": "function", "loc": [31, 32], "level": 0, "parent": null, "vector": [2, 0, 0.6429, 0.0408, 0, 0.66, 0.6667, 395, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "output_file", "arg_names": ["path"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def output_file(path):\n _out_file('Output', path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99772:Expr_L32_C4", "label": "_out_file()", "type": "expression", "loc": [32, 32], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99772:FunctionDef_L31_C0", "vector": [8, 1, 0.6531, 0.0204, 1, 0.66, 0.0, 361, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "_out_file", "arg_names": [], "import_names": [], "rhs_call_name": "_out_file", "annotation": ""}, "snippet": " _out_file('Output', path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99772:FunctionDef_L34_C0", "label": "report_file", "type": "function", "loc": [34, 35], "level": 0, "parent": null, "vector": [2, 0, 0.7041, 0.0408, 0, 0.66, 0.7333, 970, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "report_file", "arg_names": ["path"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def report_file(path):\n _out_file('Report', path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99772:Expr_L35_C4", "label": "_out_file()", "type": "expression", "loc": [35, 35], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99772:FunctionDef_L34_C0", "vector": [8, 1, 0.7143, 0.0204, 1, 0.44, 0.0, 361, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "_out_file", "arg_names": [], "import_names": [], "rhs_call_name": "_out_file", "annotation": ""}, "snippet": " _out_file('Report', path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99772:FunctionDef_L37_C0", "label": "log_file", "type": "function", "loc": [37, 38], "level": 0, "parent": null, "vector": [2, 0, 0.7653, 0.0408, 0, 0.66, 0.8, 108, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "log_file", "arg_names": ["path"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def log_file(path):\n _out_file('Log', path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99772:Expr_L38_C4", "label": "_out_file()", "type": "expression", "loc": [38, 38], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99772:FunctionDef_L37_C0", "vector": [8, 1, 0.7755, 0.0204, 1, 0.59, 0.0, 361, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "_out_file", "arg_names": [], "import_names": [], "rhs_call_name": "_out_file", "annotation": ""}, "snippet": " _out_file('Log', path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99772:FunctionDef_L40_C0", "label": "debug_file", "type": "function", "loc": [40, 41], "level": 0, "parent": null, "vector": [2, 0, 0.8265, 0.0408, 0, 0.66, 0.8667, 418, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "debug_file", "arg_names": ["path"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def debug_file(path):\n _out_file('Debug', path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99772:Expr_L41_C4", "label": "_out_file()", "type": "expression", "loc": [41, 41], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99772:FunctionDef_L40_C0", "vector": [8, 1, 0.8367, 0.0204, 1, 0.03, 0.0, 361, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "_out_file", "arg_names": [], "import_names": [], "rhs_call_name": "_out_file", "annotation": ""}, "snippet": " _out_file('Debug', path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99772:FunctionDef_L43_C0", "label": "_out_file", "type": "function", "loc": [43, 45], "level": 0, "parent": null, "vector": [2, 0, 0.898, 0.0612, 0, 0.66, 0.9333, 361, 0, 2, 0, 0, 0, 0, 3], "semantic": {"name": "_out_file", "arg_names": ["name", "path"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def _out_file(name, path):\n assert os.path.isabs(path)\n OUTFILE.write('%s: %s\\n' % (name, os.path.basename(path)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99772:Expr_L45_C4", "label": "write()", "type": "expression", "loc": [45, 45], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99772:FunctionDef_L43_C0", "vector": [8, 1, 0.9184, 0.0204, 1, 0.47, 0.0, 837, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " OUTFILE.write('%s: %s\\n' % (name, os.path.basename(path)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99772:FunctionDef_L47_C0", "label": "close", "type": "function", "loc": [47, 49], "level": 0, "parent": null, "vector": [2, 0, 0.9796, 0.0612, 0, 0.66, 1.0, 77, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def close():\n OUTFILE.write('Closing...\\n')\n OUTFILE.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99772:Expr_L48_C4", "label": "write()", "type": "expression", "loc": [48, 48], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99772:FunctionDef_L47_C0", "vector": [8, 1, 0.9796, 0.0204, 1, 0.38, 0.0, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " OUTFILE.write('Closing...\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99772:Expr_L49_C4", "label": "close()", "type": "expression", "loc": [49, 49], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99772:FunctionDef_L47_C0", "vector": [8, 1, 1.0, 0.0204, 1, 0.38, 1.0, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": " OUTFILE.close()"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99772:FunctionDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99772:Expr_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99772:FunctionDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99772:Assign_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99772:FunctionDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99772:Expr_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99772:FunctionDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99772:Assign_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99772:FunctionDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99772:Expr_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99772:FunctionDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99772:Expr_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99772:FunctionDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99772:If_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99772:If_L23_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99772:Expr_L24_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99772:If_L23_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99772:Expr_L26_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99772:FunctionDef_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99772:Expr_L29_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99772:FunctionDef_L31_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99772:Expr_L32_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99772:FunctionDef_L34_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99772:Expr_L35_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99772:FunctionDef_L37_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99772:Expr_L38_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99772:FunctionDef_L40_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99772:Expr_L41_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99772:FunctionDef_L43_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99772:Expr_L45_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99772:FunctionDef_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99772:Expr_L48_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99772:FunctionDef_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99772:Expr_L49_C4"}] |
import os
import tempfile
ROBOT_LISTENER_API_VERSION = '2'
OUTFILE = open(os.path.join(tempfile.gettempdir(), 'listener_attrs.txt'), 'w')
START_ATTRIBUTES = ['doc', 'starttime']
END_ATTRIBUTES = START_ATTRIBUTES + ['endtime', 'elapsedtime', 'status']
EXPECTED_TYPES = {'elapsedtime': (int, long), 'tags': list, 'args': list,
'metadata': dict, 'tests': list, 'suites': list,
'totaltests': int}
def start_suite(name, attrs):
_verify_attributes('START SUITE', attrs,
START_ATTRIBUTES+['longname', 'metadata', 'tests',
'suites', 'totaltests'])
def end_suite(name, attrs):
_verify_attributes('END SUITE', attrs, END_ATTRIBUTES+['longname', 'statistics', 'message'])
def start_test(name, attrs):
_verify_attributes('START TEST', attrs, START_ATTRIBUTES + ['longname', 'tags'])
def end_test(name, attrs):
_verify_attributes('END TEST', attrs, END_ATTRIBUTES + ['longname', 'tags', 'message'])
def start_keyword(name, attrs):
_verify_attributes('START KEYWORD', attrs, START_ATTRIBUTES + ['args', 'type'])
def end_keyword(name, attrs):
_verify_attributes('END KEYWORD', attrs, END_ATTRIBUTES + ['args', 'type'])
def _verify_attributes(method_name, attrs, names):
OUTFILE.write(method_name + '\n')
if len(names) != len(attrs):
OUTFILE.write('FAILED: wrong number of attributes\n')
OUTFILE.write('Expected: %s\nActual: %s\n' % (names, attrs.keys()))
return
for name in names:
value = attrs[name]
exp_type = EXPECTED_TYPES.get(name, basestring)
if isinstance(value, exp_type):
OUTFILE.write('PASSED | %s: %s\n' % (name, value))
else:
OUTFILE.write('FAILED | %s: %r, Expected: %s, Actual: %s\n'
% (name, value, type(value), exp_type))
def close():
OUTFILE.close()
| ajibawa-2023/Python-Code-Large/train/row_99773 | 33 | 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_99773:Import_L1_C0", "label": "os import os", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0192, 0.0192, 0, 0.66, 0.0, 688, 0, 1, 0, 0, 688, 0, 0], "semantic": {"name": "os", "arg_names": [], "import_names": ["os"], "rhs_call_name": "", "annotation": ""}, "snippet": "import os"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99773:Import_L2_C0", "label": "tempfile import tempfile", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0385, 0.0192, 0, 0.66, 0.0714, 516, 0, 1, 0, 0, 516, 0, 0], "semantic": {"name": "tempfile", "arg_names": [], "import_names": ["tempfile"], "rhs_call_name": "", "annotation": ""}, "snippet": "import tempfile"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99773:Assign_L5_C0", "label": "ROBOT_LISTENER_API_VERSION =", "type": "assigned_variable", "loc": [5, 5], "level": 0, "parent": null, "vector": [14, 0, 0.0962, 0.0192, 0, 0.66, 0.1429, 63, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "ROBOT_LISTENER_API_VERSION", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "ROBOT_LISTENER_API_VERSION = '2'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99773:Assign_L6_C0", "label": "OUTFILE = open()", "type": "assigned_variable", "loc": [6, 6], "level": 0, "parent": null, "vector": [14, 0, 0.1154, 0.0192, 0, 0.66, 0.2143, 351, 3, 2, 0, 0, 693, 10, 3], "semantic": {"name": "OUTFILE", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": "OUTFILE = open(os.path.join(tempfile.gettempdir(), 'listener_attrs.txt'), 'w')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99773:Assign_L8_C0", "label": "START_ATTRIBUTES =", "type": "assigned_variable", "loc": [8, 8], "level": 0, "parent": null, "vector": [14, 0, 0.1538, 0.0192, 0, 0.66, 0.2857, 874, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "START_ATTRIBUTES", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "START_ATTRIBUTES = ['doc', 'starttime']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99773:Assign_L9_C0", "label": "END_ATTRIBUTES =", "type": "assigned_variable", "loc": [9, 9], "level": 0, "parent": null, "vector": [14, 0, 0.1731, 0.0192, 0, 0.66, 0.3571, 7, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "END_ATTRIBUTES", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "END_ATTRIBUTES = START_ATTRIBUTES + ['endtime', 'elapsedtime', 'status']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99773:Assign_L10_C0", "label": "EXPECTED_TYPES =", "type": "assigned_variable", "loc": [10, 12], "level": 0, "parent": null, "vector": [14, 0, 0.2115, 0.0577, 0, 0.66, 0.4286, 491, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "EXPECTED_TYPES", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "EXPECTED_TYPES = {'elapsedtime': (int, long), 'tags': list, 'args': list,\n 'metadata': dict, 'tests': list, 'suites': list,\n 'totaltests': int}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99773:FunctionDef_L15_C0", "label": "start_suite", "type": "function", "loc": [15, 18], "level": 0, "parent": null, "vector": [2, 0, 0.3173, 0.0769, 0, 0.66, 0.5, 38, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "start_suite", "arg_names": ["name", "attrs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def start_suite(name, attrs):\n _verify_attributes('START SUITE', attrs,\n START_ATTRIBUTES+['longname', 'metadata', 'tests',\n 'suites', 'totaltests'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99773:Expr_L16_C4", "label": "_verify_attributes()", "type": "expression", "loc": [16, 18], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99773:FunctionDef_L15_C0", "vector": [8, 1, 0.3269, 0.0577, 1, 0.69, 0.0, 31, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "_verify_attributes", "arg_names": [], "import_names": [], "rhs_call_name": "_verify_attributes", "annotation": ""}, "snippet": " _verify_attributes('START SUITE', attrs,\n START_ATTRIBUTES+['longname', 'metadata', 'tests',\n 'suites', 'totaltests'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99773:FunctionDef_L20_C0", "label": "end_suite", "type": "function", "loc": [20, 21], "level": 0, "parent": null, "vector": [2, 0, 0.3942, 0.0385, 0, 0.66, 0.5714, 81, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "end_suite", "arg_names": ["name", "attrs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def end_suite(name, attrs):\n _verify_attributes('END SUITE', attrs, END_ATTRIBUTES+['longname', 'statistics', 'message'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99773:Expr_L21_C4", "label": "_verify_attributes()", "type": "expression", "loc": [21, 21], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99773:FunctionDef_L20_C0", "vector": [8, 1, 0.4038, 0.0192, 1, 0.66, 0.0, 31, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "_verify_attributes", "arg_names": [], "import_names": [], "rhs_call_name": "_verify_attributes", "annotation": ""}, "snippet": " _verify_attributes('END SUITE', attrs, END_ATTRIBUTES+['longname', 'statistics', 'message'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99773:FunctionDef_L23_C0", "label": "start_test", "type": "function", "loc": [23, 24], "level": 0, "parent": null, "vector": [2, 0, 0.4519, 0.0385, 0, 0.66, 0.6429, 246, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "start_test", "arg_names": ["name", "attrs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def start_test(name, attrs):\n _verify_attributes('START TEST', attrs, START_ATTRIBUTES + ['longname', 'tags'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99773:Expr_L24_C4", "label": "_verify_attributes()", "type": "expression", "loc": [24, 24], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99773:FunctionDef_L23_C0", "vector": [8, 1, 0.4615, 0.0192, 1, 0.41, 0.0, 31, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "_verify_attributes", "arg_names": [], "import_names": [], "rhs_call_name": "_verify_attributes", "annotation": ""}, "snippet": " _verify_attributes('START TEST', attrs, START_ATTRIBUTES + ['longname', 'tags'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99773:FunctionDef_L26_C0", "label": "end_test", "type": "function", "loc": [26, 27], "level": 0, "parent": null, "vector": [2, 0, 0.5096, 0.0385, 0, 0.66, 0.7143, 220, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "end_test", "arg_names": ["name", "attrs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def end_test(name, attrs):\n _verify_attributes('END TEST', attrs, END_ATTRIBUTES + ['longname', 'tags', 'message'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99773:Expr_L27_C4", "label": "_verify_attributes()", "type": "expression", "loc": [27, 27], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99773:FunctionDef_L26_C0", "vector": [8, 1, 0.5192, 0.0192, 1, 0.29, 0.0, 31, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "_verify_attributes", "arg_names": [], "import_names": [], "rhs_call_name": "_verify_attributes", "annotation": ""}, "snippet": " _verify_attributes('END TEST', attrs, END_ATTRIBUTES + ['longname', 'tags', 'message'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99773:FunctionDef_L29_C0", "label": "start_keyword", "type": "function", "loc": [29, 30], "level": 0, "parent": null, "vector": [2, 0, 0.5673, 0.0385, 0, 0.66, 0.7857, 776, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "start_keyword", "arg_names": ["name", "attrs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def start_keyword(name, attrs):\n _verify_attributes('START KEYWORD', attrs, START_ATTRIBUTES + ['args', 'type'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99773:Expr_L30_C4", "label": "_verify_attributes()", "type": "expression", "loc": [30, 30], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99773:FunctionDef_L29_C0", "vector": [8, 1, 0.5769, 0.0192, 1, 0.64, 0.0, 31, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "_verify_attributes", "arg_names": [], "import_names": [], "rhs_call_name": "_verify_attributes", "annotation": ""}, "snippet": " _verify_attributes('START KEYWORD', attrs, START_ATTRIBUTES + ['args', 'type'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99773:FunctionDef_L32_C0", "label": "end_keyword", "type": "function", "loc": [32, 33], "level": 0, "parent": null, "vector": [2, 0, 0.625, 0.0385, 0, 0.66, 0.8571, 959, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "end_keyword", "arg_names": ["name", "attrs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def end_keyword(name, attrs):\n _verify_attributes('END KEYWORD', attrs, END_ATTRIBUTES + ['args', 'type'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99773:Expr_L33_C4", "label": "_verify_attributes()", "type": "expression", "loc": [33, 33], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99773:FunctionDef_L32_C0", "vector": [8, 1, 0.6346, 0.0192, 1, 0.16, 0.0, 31, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "_verify_attributes", "arg_names": [], "import_names": [], "rhs_call_name": "_verify_attributes", "annotation": ""}, "snippet": " _verify_attributes('END KEYWORD', attrs, END_ATTRIBUTES + ['args', 'type'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99773:FunctionDef_L35_C0", "label": "_verify_attributes", "type": "function", "loc": [35, 48], "level": 0, "parent": null, "vector": [2, 0, 0.7981, 0.2692, 0, 0.66, 0.9286, 31, 0, 3, 0, 0, 0, 0, 11], "semantic": {"name": "_verify_attributes", "arg_names": ["method_name", "attrs", "names"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def _verify_attributes(method_name, attrs, names):\n OUTFILE.write(method_name + '\\n')\n if len(names) != len(attrs):\n OUTFILE.write('FAILED: wrong number of attributes\\n')\n OUTFILE.write('Expected: %s\\nActual: %s\\n' % (names, attrs.keys()))\n return\n for name in names:\n value = attrs[name]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99773:Expr_L36_C4", "label": "write()", "type": "expression", "loc": [36, 36], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99773:FunctionDef_L35_C0", "vector": [8, 1, 0.6923, 0.0192, 1, 0.24, 0.0, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " OUTFILE.write(method_name + '\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99773:If_L37_C4", "label": "if", "type": "if", "loc": [37, 40], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99773:FunctionDef_L35_C0", "vector": [4, 1, 0.7404, 0.0769, 1, 0.24, 0.5, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(names) != len(attrs):\n OUTFILE.write('FAILED: wrong number of attributes\\n')\n OUTFILE.write('Expected: %s\\nActual: %s\\n' % (names, attrs.keys()))\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99773:Expr_L38_C8", "label": "write()", "type": "expression", "loc": [38, 38], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99773:If_L37_C4", "vector": [8, 2, 0.7308, 0.0192, 2, 0.94, 0.0, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " OUTFILE.write('FAILED: wrong number of attributes\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99773:Expr_L39_C8", "label": "write()", "type": "expression", "loc": [39, 39], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99773:If_L37_C4", "vector": [8, 2, 0.75, 0.0192, 2, 0.94, 0.5, 837, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " OUTFILE.write('Expected: %s\\nActual: %s\\n' % (names, attrs.keys()))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99773:Return_L40_C8", "label": "return", "type": "return", "loc": [40, 40], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99773:If_L37_C4", "vector": [13, 2, 0.7692, 0.0192, 2, 0.94, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99773:For_L41_C4", "label": "for name", "type": "for", "loc": [41, 48], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99773:FunctionDef_L35_C0", "vector": [6, 1, 0.8558, 0.1538, 1, 0.24, 1.0, 57, 2, 0, 0, 0, 0, 0, 5], "semantic": {"name": "name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for name in names:\n value = attrs[name]\n exp_type = EXPECTED_TYPES.get(name, basestring)\n if isinstance(value, exp_type):\n OUTFILE.write('PASSED | %s: %s\\n' % (name, value))\n else:\n OUTFILE.write('FAILED | %s: %r, Expected: %s, Actual: %s\\n' \n % (name, value, type(value), exp_type))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99773:Assign_L42_C8", "label": "value =", "type": "assigned_variable", "loc": [42, 42], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99773:For_L41_C4", "vector": [14, 2, 0.8077, 0.0192, 2, 0.12, 0.0, 441, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "value", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " value = attrs[name]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99773:Assign_L43_C8", "label": "exp_type = get()", "type": "assigned_variable", "loc": [43, 43], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99773:For_L41_C4", "vector": [14, 2, 0.8269, 0.0192, 2, 0.12, 0.5, 689, 3, 2, 0, 0, 607, 10, 1], "semantic": {"name": "exp_type", "arg_names": [], "import_names": [], "rhs_call_name": "get", "annotation": ""}, "snippet": " exp_type = EXPECTED_TYPES.get(name, basestring)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99773:If_L44_C8", "label": "if", "type": "if", "loc": [44, 48], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99773:For_L41_C4", "vector": [4, 2, 0.8846, 0.0962, 2, 0.12, 1.0, 0, 3, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if isinstance(value, exp_type):\n OUTFILE.write('PASSED | %s: %s\\n' % (name, value))\n else:\n OUTFILE.write('FAILED | %s: %r, Expected: %s, Actual: %s\\n' \n % (name, value, type(value), exp_type))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99773:Expr_L45_C12", "label": "write()", "type": "expression", "loc": [45, 45], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99773:If_L44_C8", "vector": [8, 3, 0.8654, 0.0192, 3, 0.27, 0.0, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " OUTFILE.write('PASSED | %s: %s\\n' % (name, value))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99773:Expr_L47_C12", "label": "write()", "type": "expression", "loc": [47, 48], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99773:If_L44_C8", "vector": [8, 3, 0.9135, 0.0385, 3, 0.27, 1.0, 837, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " OUTFILE.write('FAILED | %s: %r, Expected: %s, Actual: %s\\n' \n % (name, value, type(value), exp_type))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99773:FunctionDef_L50_C0", "label": "close", "type": "function", "loc": [50, 51], "level": 0, "parent": null, "vector": [2, 0, 0.9712, 0.0385, 0, 0.66, 1.0, 77, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def close():\n OUTFILE.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99773:Expr_L51_C4", "label": "close()", "type": "expression", "loc": [51, 51], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99773:FunctionDef_L50_C0", "vector": [8, 1, 0.9808, 0.0192, 1, 0.78, 0.0, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": " OUTFILE.close()"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99773:FunctionDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99773:Expr_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99773:FunctionDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99773:Expr_L21_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99773:FunctionDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99773:Expr_L24_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99773:FunctionDef_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99773:Expr_L27_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99773:FunctionDef_L29_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99773:Expr_L30_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99773:FunctionDef_L32_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99773:Expr_L33_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99773:FunctionDef_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99773:Expr_L36_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99773:FunctionDef_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99773:If_L37_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99773:If_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99773:Expr_L38_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99773:If_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99773:Expr_L39_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99773:If_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99773:Return_L40_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99773:FunctionDef_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99773:For_L41_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99773:For_L41_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99773:Assign_L42_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99773:For_L41_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99773:Assign_L43_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99773:For_L41_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99773:If_L44_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99773:If_L44_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99773:Expr_L45_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99773:If_L44_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99773:Expr_L47_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99773:FunctionDef_L50_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99773:Expr_L51_C4"}] |
def get_variables(*args):
return { 'PPATH_VARFILE_2' : ' '.join(args),
'LIST__PPATH_VARFILE_2' : args }
| ajibawa-2023/Python-Code-Large/train/row_99774 | 2 | 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_99774:FunctionDef_L1_C0", "label": "get_variables", "type": "function", "loc": [1, 3], "level": 0, "parent": null, "vector": [2, 0, 0.5, 0.75, 0, 0.66, 0.0, 461, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "get_variables", "arg_names": ["args"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def get_variables(*args):\n return { 'PPATH_VARFILE_2' : ' '.join(args),\n 'LIST__PPATH_VARFILE_2' : args }"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99774:Return_L2_C4", "label": "return", "type": "return", "loc": [2, 3], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99774:FunctionDef_L1_C0", "vector": [13, 1, 0.625, 0.5, 1, 0.13, 0.0, 0, 0, 0, 0, 0, 0, 6, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return { 'PPATH_VARFILE_2' : ' '.join(args),\n 'LIST__PPATH_VARFILE_2' : args }"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99774:FunctionDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99774:Return_L2_C4"}] |
PPATH_VARFILE = "Variable from varible file in PYTHONPATH" | ajibawa-2023/Python-Code-Large/train/row_99775 | 1 | 1 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99775:Assign_L1_C0", "label": "PPATH_VARFILE =", "type": "assigned_variable", "loc": [1, 1], "level": 0, "parent": null, "vector": [14, 0, 1.0, 1.0, 0, 0.66, 0.0, 799, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "PPATH_VARFILE", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "PPATH_VARFILE = \"Variable from varible file in PYTHONPATH\""}] | [] |
list1 = [1, 2, 3, 4, 'foo', 'bar']
dictionary1 = {'a': 1}
dictionary2 = {'a': 1, 'b': 2}
| ajibawa-2023/Python-Code-Large/train/row_99776 | 3 | 3 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99776:Assign_L1_C0", "label": "list1 =", "type": "assigned_variable", "loc": [1, 1], "level": 0, "parent": null, "vector": [14, 0, 0.3333, 0.3333, 0, 0.66, 0.0, 150, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "list1", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "list1 = [1, 2, 3, 4, 'foo', 'bar']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99776:Assign_L2_C0", "label": "dictionary1 =", "type": "assigned_variable", "loc": [2, 2], "level": 0, "parent": null, "vector": [14, 0, 0.6667, 0.3333, 0, 0.66, 0.5, 355, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "dictionary1", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "dictionary1 = {'a': 1}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99776:Assign_L3_C0", "label": "dictionary2 =", "type": "assigned_variable", "loc": [3, 3], "level": 0, "parent": null, "vector": [14, 0, 1.0, 0.3333, 0, 0.66, 1.0, 702, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "dictionary2", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "dictionary2 = {'a': 1, 'b': 2}"}] | [] |
class TraceLogArgsLibrary(object):
def only_mandatory(self, mand1, mand2):
pass
def mandatory_and_default(self, mand, default="default value"):
pass
def multiple_default_values(self, a=1, a2=2, a3=3, a4=4):
pass
def mandatory_and_varargs(self, mand, *varargs):
pass
def return_object_with_invalid_repr(self):
return InvalidRepr()
def return_object_with_non_ascii_string_repr(self):
return ByteRepr()
class InvalidRepr:
def __repr__(self):
return u'Hyv\xe4'
class ByteRepr:
def __repr__(self):
return 'Hyv\xe4' | ajibawa-2023/Python-Code-Large/train/row_99777 | 15 | 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_99777:ClassDef_L1_C0", "label": "TraceLogArgsLibrary", "type": "class", "loc": [1, 19], "level": 0, "parent": null, "vector": [3, 0, 0.3333, 0.6333, 0, 0.66, 0.0, 552, 0, 6, 0, 0, 186, 0, 2], "semantic": {"name": "TraceLogArgsLibrary", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class TraceLogArgsLibrary(object):\n\n def only_mandatory(self, mand1, mand2):\n pass\n\n def mandatory_and_default(self, mand, default=\"default value\"):\n pass\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99777:FunctionDef_L3_C4", "label": "only_mandatory", "type": "function", "loc": [3, 4], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99777:ClassDef_L1_C0", "vector": [2, 1, 0.1167, 0.0667, 1, 0.83, 0.0, 124, 0, 3, 0, 0, 0, 0, 0], "semantic": {"name": "only_mandatory", "arg_names": ["self", "mand1", "mand2"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def only_mandatory(self, mand1, mand2):\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99777:FunctionDef_L6_C4", "label": "mandatory_and_default", "type": "function", "loc": [6, 7], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99777:ClassDef_L1_C0", "vector": [2, 1, 0.2167, 0.0667, 1, 0.83, 0.2, 326, 0, 3, 0, 0, 0, 0, 0], "semantic": {"name": "mandatory_and_default", "arg_names": ["self", "mand", "default"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def mandatory_and_default(self, mand, default=\"default value\"):\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99777:FunctionDef_L9_C4", "label": "multiple_default_values", "type": "function", "loc": [9, 10], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99777:ClassDef_L1_C0", "vector": [2, 1, 0.3167, 0.0667, 1, 0.83, 0.4, 198, 0, 5, 0, 0, 0, 0, 0], "semantic": {"name": "multiple_default_values", "arg_names": ["self", "a", "a2", "a3", "a4"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def multiple_default_values(self, a=1, a2=2, a3=3, a4=4):\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99777:FunctionDef_L12_C4", "label": "mandatory_and_varargs", "type": "function", "loc": [12, 13], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99777:ClassDef_L1_C0", "vector": [2, 1, 0.4167, 0.0667, 1, 0.83, 0.6, 23, 0, 3, 0, 0, 0, 0, 0], "semantic": {"name": "mandatory_and_varargs", "arg_names": ["self", "mand", "varargs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def mandatory_and_varargs(self, mand, *varargs):\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99777:FunctionDef_L15_C4", "label": "return_object_with_invalid_repr", "type": "function", "loc": [15, 16], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99777:ClassDef_L1_C0", "vector": [2, 1, 0.5167, 0.0667, 1, 0.83, 0.8, 714, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "return_object_with_invalid_repr", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def return_object_with_invalid_repr(self):\n return InvalidRepr()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99777:Return_L16_C8", "label": "return", "type": "return", "loc": [16, 16], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99777:FunctionDef_L15_C4", "vector": [13, 2, 0.5333, 0.0333, 2, 0.31, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return InvalidRepr()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99777:FunctionDef_L18_C4", "label": "return_object_with_non_ascii_string_repr", "type": "function", "loc": [18, 19], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99777:ClassDef_L1_C0", "vector": [2, 1, 0.6167, 0.0667, 1, 0.83, 1.0, 174, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "return_object_with_non_ascii_string_repr", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def return_object_with_non_ascii_string_repr(self):\n return ByteRepr()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99777:Return_L19_C8", "label": "return", "type": "return", "loc": [19, 19], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99777:FunctionDef_L18_C4", "vector": [13, 2, 0.6333, 0.0333, 2, 0.14, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ByteRepr()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99777:ClassDef_L22_C0", "label": "InvalidRepr", "type": "class", "loc": [22, 25], "level": 0, "parent": null, "vector": [3, 0, 0.7833, 0.1333, 0, 0.66, 0.5, 566, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "InvalidRepr", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class InvalidRepr:\n\n def __repr__(self):\n return u'Hyv\\xe4'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99777:FunctionDef_L24_C4", "label": "__repr__", "type": "function", "loc": [24, 25], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99777:ClassDef_L22_C0", "vector": [2, 1, 0.8167, 0.0667, 1, 0.86, 0.0, 204, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "__repr__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __repr__(self):\n return u'Hyv\\xe4'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99777:Return_L25_C8", "label": "return", "type": "return", "loc": [25, 25], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99777:FunctionDef_L24_C4", "vector": [13, 2, 0.8333, 0.0333, 2, 0.01, 0.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return u'Hyv\\xe4'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99777:ClassDef_L27_C0", "label": "ByteRepr", "type": "class", "loc": [27, 30], "level": 0, "parent": null, "vector": [3, 0, 0.95, 0.1333, 0, 0.66, 1.0, 513, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "ByteRepr", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class ByteRepr:\n\n def __repr__(self):\n return 'Hyv\\xe4'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99777:FunctionDef_L29_C4", "label": "__repr__", "type": "function", "loc": [29, 30], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99777:ClassDef_L27_C0", "vector": [2, 1, 0.9833, 0.0667, 1, 0.41, 0.0, 204, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "__repr__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __repr__(self):\n return 'Hyv\\xe4'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99777:Return_L30_C8", "label": "return", "type": "return", "loc": [30, 30], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99777:FunctionDef_L29_C4", "vector": [13, 2, 1.0, 0.0333, 2, 0.65, 0.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 'Hyv\\xe4'"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99777:ClassDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99777:FunctionDef_L3_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99777:ClassDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99777:FunctionDef_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99777:ClassDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99777:FunctionDef_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99777:ClassDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99777:FunctionDef_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99777:ClassDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99777:FunctionDef_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99777:FunctionDef_L15_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99777:Return_L16_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99777:ClassDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99777:FunctionDef_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99777:FunctionDef_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99777:Return_L19_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99777:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99777:FunctionDef_L24_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99777:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99777:Return_L25_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99777:ClassDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99777:FunctionDef_L29_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99777:FunctionDef_L29_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99777:Return_L30_C8"}] |
class FailUntilSucceeds:
ROBOT_LIBRARY_SCOPE = 'TESTCASE'
def __init__(self, times_to_fail=0):
self.times_to_fail = int(times_to_fail)
def fail_until_retried_often_enough(self, message="Hello"):
self.times_to_fail -= 1
if self.times_to_fail >= 0:
raise Exception('Still %d times to fail!' % (self.times_to_fail))
return message
| ajibawa-2023/Python-Code-Large/train/row_99778 | 7 | 12 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99778:ClassDef_L1_C0", "label": "FailUntilSucceeds", "type": "class", "loc": [1, 12], "level": 0, "parent": null, "vector": [3, 0, 0.5417, 1.0, 0, 0.66, 0.0, 243, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "FailUntilSucceeds", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class FailUntilSucceeds:\n \n ROBOT_LIBRARY_SCOPE = 'TESTCASE'\n \n def __init__(self, times_to_fail=0):\n self.times_to_fail = int(times_to_fail)\n \n def fail_until_retried_often_enough(self, message=\"Hello\"):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99778:Assign_L3_C4", "label": "ROBOT_LIBRARY_SCOPE =", "type": "assigned_variable", "loc": [3, 3], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99778:ClassDef_L1_C0", "vector": [14, 1, 0.25, 0.0833, 1, 0.59, 0.0, 305, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "ROBOT_LIBRARY_SCOPE", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ROBOT_LIBRARY_SCOPE = 'TESTCASE'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99778:FunctionDef_L5_C4", "label": "__init__", "type": "function", "loc": [5, 6], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99778:ClassDef_L1_C0", "vector": [2, 1, 0.4583, 0.1667, 1, 0.59, 0.5, 555, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": ["self", "times_to_fail"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, times_to_fail=0):\n self.times_to_fail = int(times_to_fail)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99778:Assign_L6_C8", "label": "self.times_to_fail = int()", "type": "assigned_variable", "loc": [6, 6], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99778:FunctionDef_L5_C4", "vector": [14, 2, 0.5, 0.0833, 2, 0.5, 0.0, 808, 3, 1, 0, 0, 901, 10, 1], "semantic": {"name": "self.times_to_fail", "arg_names": [], "import_names": [], "rhs_call_name": "int", "annotation": ""}, "snippet": " self.times_to_fail = int(times_to_fail)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99778:FunctionDef_L8_C4", "label": "fail_until_retried_often_enough", "type": "function", "loc": [8, 12], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99778:ClassDef_L1_C0", "vector": [2, 1, 0.8333, 0.4167, 1, 0.59, 1.0, 112, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "fail_until_retried_often_enough", "arg_names": ["self", "message"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def fail_until_retried_often_enough(self, message=\"Hello\"):\n self.times_to_fail -= 1\n if self.times_to_fail >= 0:\n raise Exception('Still %d times to fail!' % (self.times_to_fail))\n return message"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99778:If_L10_C8", "label": "if", "type": "if", "loc": [10, 11], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99778:FunctionDef_L8_C4", "vector": [4, 2, 0.875, 0.1667, 2, 0.2, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.times_to_fail >= 0:\n raise Exception('Still %d times to fail!' % (self.times_to_fail))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99778:Return_L12_C8", "label": "return", "type": "return", "loc": [12, 12], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99778:FunctionDef_L8_C4", "vector": [13, 2, 1.0, 0.0833, 2, 0.2, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return message"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99778:ClassDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99778:Assign_L3_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99778:ClassDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99778:FunctionDef_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99778:FunctionDef_L5_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99778:Assign_L6_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99778:ClassDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99778:FunctionDef_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99778:FunctionDef_L8_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99778:If_L10_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99778:FunctionDef_L8_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99778:Return_L12_C8"}] |
import exceptions
class ObjectToReturn:
def __init__(self, name):
self.name = name
def __str__(self):
return self.name
def exception(self, name, msg=""):
exception = getattr(exceptions, name)
raise exception, msg
| ajibawa-2023/Python-Code-Large/train/row_99779 | 8 | 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_99779:Import_L1_C0", "label": "exceptions import exceptions", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0833, 0.0833, 0, 0.66, 0.0, 63, 0, 1, 0, 0, 63, 0, 0], "semantic": {"name": "exceptions", "arg_names": [], "import_names": ["exceptions"], "rhs_call_name": "", "annotation": ""}, "snippet": "import exceptions"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99779:ClassDef_L3_C0", "label": "ObjectToReturn", "type": "class", "loc": [3, 12], "level": 0, "parent": null, "vector": [3, 0, 0.625, 0.8333, 0, 0.66, 1.0, 601, 0, 3, 0, 0, 0, 0, 1], "semantic": {"name": "ObjectToReturn", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class ObjectToReturn:\n \n def __init__(self, name):\n self.name = name\n\n def __str__(self):\n return self.name\n "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99779:FunctionDef_L5_C4", "label": "__init__", "type": "function", "loc": [5, 6], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99779:ClassDef_L3_C0", "vector": [2, 1, 0.4583, 0.1667, 1, 0.08, 0.0, 555, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, name):\n self.name = name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99779:Assign_L6_C8", "label": "self.name =", "type": "assigned_variable", "loc": [6, 6], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99779:FunctionDef_L5_C4", "vector": [14, 2, 0.5, 0.0833, 2, 0.57, 0.0, 689, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.name = name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99779:FunctionDef_L8_C4", "label": "__str__", "type": "function", "loc": [8, 9], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99779:ClassDef_L3_C0", "vector": [2, 1, 0.7083, 0.1667, 1, 0.08, 0.5, 527, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "__str__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __str__(self):\n return self.name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99779:Return_L9_C8", "label": "return", "type": "return", "loc": [9, 9], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99779:FunctionDef_L8_C4", "vector": [13, 2, 0.75, 0.0833, 2, 0.65, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99779:FunctionDef_L11_C4", "label": "exception", "type": "function", "loc": [11, 12], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99779:ClassDef_L3_C0", "vector": [2, 1, 0.9583, 0.1667, 1, 0.08, 1.0, 69, 0, 3, 0, 0, 0, 0, 1], "semantic": {"name": "exception", "arg_names": ["self", "name", "msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def exception(self, name, msg=\"\"):\n exception = getattr(exceptions, name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99779:Assign_L12_C8", "label": "exception = getattr()", "type": "assigned_variable", "loc": [12, 12], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99779:FunctionDef_L11_C4", "vector": [14, 2, 1.0, 0.0833, 2, 0.45, 0.0, 69, 3, 2, 0, 0, 121, 10, 1], "semantic": {"name": "exception", "arg_names": [], "import_names": [], "rhs_call_name": "getattr", "annotation": ""}, "snippet": " exception = getattr(exceptions, name)"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99779:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99779:FunctionDef_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99779:FunctionDef_L5_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99779:Assign_L6_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99779:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99779:FunctionDef_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99779:FunctionDef_L8_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99779:Return_L9_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99779:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99779:FunctionDef_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99779:FunctionDef_L11_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99779:Assign_L12_C8"}] |
class SameNamesAsInBuiltIn:
def noop(self):
"""Using this keyword without libname causes an error""" | ajibawa-2023/Python-Code-Large/train/row_99780 | 3 | 4 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99780:ClassDef_L1_C0", "label": "SameNamesAsInBuiltIn", "type": "class", "loc": [1, 4], "level": 0, "parent": null, "vector": [3, 0, 0.625, 1.0, 0, 0.66, 0.0, 82, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "SameNamesAsInBuiltIn", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class SameNamesAsInBuiltIn:\n \n def noop(self):\n \"\"\"Using this keyword without libname causes an error\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99780:FunctionDef_L3_C4", "label": "noop", "type": "function", "loc": [3, 4], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99780:ClassDef_L1_C0", "vector": [2, 1, 0.875, 0.5, 1, 0.15, 0.0, 907, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "noop", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def noop(self):\n \"\"\"Using this keyword without libname causes an error\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99780:Expr_L4_C8", "label": "expression", "type": "expression", "loc": [4, 4], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99780:FunctionDef_L3_C4", "vector": [8, 2, 1.0, 0.25, 2, 0.89, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Using this keyword without libname causes an error\"\"\""}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99780:ClassDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99780:FunctionDef_L3_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99780:FunctionDef_L3_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99780:Expr_L4_C8"}] |
class ZipLib:
def kw_from_zip(self, arg):
print '*INFO*', arg
return arg * 2
| ajibawa-2023/Python-Code-Large/train/row_99781 | 4 | 7 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99781:ClassDef_L1_C0", "label": "ZipLib", "type": "class", "loc": [1, 5], "level": 0, "parent": null, "vector": [3, 0, 0.4286, 0.7143, 0, 0.66, 0.0, 240, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "ZipLib", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class ZipLib:\n\n\tdef kw_from_zip(self, arg):\n\t\tprint('*INFO*', arg)\n\t\treturn arg * 2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99781:FunctionDef_L3_C1", "label": "kw_from_zip", "type": "function", "loc": [3, 5], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99781:ClassDef_L1_C0", "vector": [2, 1, 0.5714, 0.4286, 1, 0.86, 0.0, 374, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "kw_from_zip", "arg_names": ["self", "arg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef kw_from_zip(self, arg):\n\t\tprint('*INFO*', arg)\n\t\treturn arg * 2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99781:Expr_L4_C2", "label": "print()", "type": "expression", "loc": [4, 4], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99781:FunctionDef_L3_C1", "vector": [8, 2, 0.5714, 0.1429, 2, 0.85, 0.0, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "\t\tprint('*INFO*', arg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99781:Return_L5_C2", "label": "return", "type": "return", "loc": [5, 5], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99781:FunctionDef_L3_C1", "vector": [13, 2, 0.7143, 0.1429, 2, 0.85, 1.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\treturn arg * 2"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99781:ClassDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99781:FunctionDef_L3_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99781:FunctionDef_L3_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99781:Expr_L4_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99781:FunctionDef_L3_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99781:Return_L5_C2"}] |
class PythonVarArgsConstructor:
def __init__(self, mandatory, *varargs):
self.mandatory = mandatory
self.varargs = varargs
def get_args(self):
return self.mandatory, ' '.join(self.varargs)
| ajibawa-2023/Python-Code-Large/train/row_99782 | 6 | 9 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99782:ClassDef_L1_C0", "label": "PythonVarArgsConstructor", "type": "class", "loc": [1, 8], "level": 0, "parent": null, "vector": [3, 0, 0.5, 0.8889, 0, 0.66, 0.0, 282, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "PythonVarArgsConstructor", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class PythonVarArgsConstructor:\n \n def __init__(self, mandatory, *varargs):\n self.mandatory = mandatory\n self.varargs = varargs\n\n def get_args(self):\n return self.mandatory, ' '.join(self.varargs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99782:FunctionDef_L3_C4", "label": "__init__", "type": "function", "loc": [3, 5], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99782:ClassDef_L1_C0", "vector": [2, 1, 0.4444, 0.3333, 1, 0.52, 0.0, 555, 0, 3, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "mandatory", "varargs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, mandatory, *varargs):\n self.mandatory = mandatory\n self.varargs = varargs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99782:Assign_L4_C8", "label": "self.mandatory =", "type": "assigned_variable", "loc": [4, 4], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99782:FunctionDef_L3_C4", "vector": [14, 2, 0.4444, 0.1111, 2, 0.45, 0.0, 557, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.mandatory", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.mandatory = mandatory"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99782:Assign_L5_C8", "label": "self.varargs =", "type": "assigned_variable", "loc": [5, 5], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99782:FunctionDef_L3_C4", "vector": [14, 2, 0.5556, 0.1111, 2, 0.45, 1.0, 321, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.varargs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.varargs = varargs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99782:FunctionDef_L7_C4", "label": "get_args", "type": "function", "loc": [7, 8], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99782:ClassDef_L1_C0", "vector": [2, 1, 0.8333, 0.2222, 1, 0.52, 1.0, 671, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "get_args", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_args(self):\n return self.mandatory, ' '.join(self.varargs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99782:Return_L8_C8", "label": "return", "type": "return", "loc": [8, 8], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99782:FunctionDef_L7_C4", "vector": [13, 2, 0.8889, 0.1111, 2, 0.13, 0.0, 0, 0, 0, 0, 0, 0, 8, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.mandatory, ' '.join(self.varargs)"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99782:ClassDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99782:FunctionDef_L3_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99782:FunctionDef_L3_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99782:Assign_L4_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99782:FunctionDef_L3_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99782:Assign_L5_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99782:ClassDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99782:FunctionDef_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99782:FunctionDef_L7_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99782:Return_L8_C8"}] |
import ExampleJavaLibrary
import DefaultArgs
class ExtendJavaLib(ExampleJavaLibrary):
def kw_in_java_extender(self, arg):
return arg*2
def javaSleep(self, secs):
raise Exception('Overridden kw executed!')
def using_method_from_java_parent(self):
self.divByZero()
class ExtendJavaLibWithConstructor(DefaultArgs):
def keyword(self):
return None
class ExtendJavaLibWithInit(ExampleJavaLibrary):
def __init__(self, *args):
self.args = args
def get_args(self):
return self.args
class ExtendJavaLibWithInitAndConstructor(DefaultArgs):
def __init__(self, *args):
if len(args) == 1:
DefaultArgs.__init__(self, args[0])
self.kw = lambda self: "Hello, world!"
| ajibawa-2023/Python-Code-Large/train/row_99784 | 21 | 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_99784:Import_L1_C0", "label": "ExampleJavaLibrary import ExampleJavaLibrary", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.027, 0.027, 0, 0.66, 0.0, 716, 0, 1, 0, 0, 716, 0, 0], "semantic": {"name": "ExampleJavaLibrary", "arg_names": [], "import_names": ["ExampleJavaLibrary"], "rhs_call_name": "", "annotation": ""}, "snippet": "import ExampleJavaLibrary"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99784:Import_L2_C0", "label": "DefaultArgs import DefaultArgs", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0541, 0.027, 0, 0.66, 0.2, 96, 0, 1, 0, 0, 96, 0, 0], "semantic": {"name": "DefaultArgs", "arg_names": [], "import_names": ["DefaultArgs"], "rhs_call_name": "", "annotation": ""}, "snippet": "import DefaultArgs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99784:ClassDef_L5_C0", "label": "ExtendJavaLib", "type": "class", "loc": [5, 14], "level": 0, "parent": null, "vector": [3, 0, 0.2568, 0.2703, 0, 0.66, 0.4, 497, 0, 3, 0, 0, 716, 0, 2], "semantic": {"name": "ExtendJavaLib", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class ExtendJavaLib(ExampleJavaLibrary):\n\n def kw_in_java_extender(self, arg):\n return arg*2\n\n def javaSleep(self, secs):\n raise Exception('Overridden kw executed!')\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99784:FunctionDef_L7_C4", "label": "kw_in_java_extender", "type": "function", "loc": [7, 8], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99784:ClassDef_L5_C0", "vector": [2, 1, 0.2027, 0.0541, 1, 0.4, 0.0, 655, 0, 2, 1, 0, 0, 0, 0], "semantic": {"name": "kw_in_java_extender", "arg_names": ["self", "arg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def kw_in_java_extender(self, arg):\n return arg*2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99784:Return_L8_C8", "label": "return", "type": "return", "loc": [8, 8], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99784:FunctionDef_L7_C4", "vector": [13, 2, 0.2162, 0.027, 2, 0.8, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return arg*2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99784:FunctionDef_L10_C4", "label": "javaSleep", "type": "function", "loc": [10, 11], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99784:ClassDef_L5_C0", "vector": [2, 1, 0.2838, 0.0541, 1, 0.4, 0.5, 559, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "javaSleep", "arg_names": ["self", "secs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def javaSleep(self, secs):\n raise Exception('Overridden kw executed!')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99784:FunctionDef_L13_C4", "label": "using_method_from_java_parent", "type": "function", "loc": [13, 14], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99784:ClassDef_L5_C0", "vector": [2, 1, 0.3649, 0.0541, 1, 0.4, 1.0, 786, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "using_method_from_java_parent", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def using_method_from_java_parent(self):\n self.divByZero()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99784:Expr_L14_C8", "label": "divByZero()", "type": "expression", "loc": [14, 14], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99784:FunctionDef_L13_C4", "vector": [8, 2, 0.3784, 0.027, 2, 0.04, 0.0, 901, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "divByZero", "arg_names": [], "import_names": [], "rhs_call_name": "divByZero", "annotation": ""}, "snippet": " self.divByZero()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99784:ClassDef_L17_C0", "label": "ExtendJavaLibWithConstructor", "type": "class", "loc": [17, 20], "level": 0, "parent": null, "vector": [3, 0, 0.5, 0.1081, 0, 0.66, 0.6, 279, 0, 1, 0, 0, 96, 0, 0], "semantic": {"name": "ExtendJavaLibWithConstructor", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class ExtendJavaLibWithConstructor(DefaultArgs):\n\n def keyword(self):\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99784:FunctionDef_L19_C4", "label": "keyword", "type": "function", "loc": [19, 20], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99784:ClassDef_L17_C0", "vector": [2, 1, 0.527, 0.0541, 1, 0.14, 0.0, 454, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "keyword", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def keyword(self):\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99784:Return_L20_C8", "label": "return", "type": "return", "loc": [20, 20], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99784:FunctionDef_L19_C4", "vector": [13, 2, 0.5405, 0.027, 2, 0.77, 0.0, 0, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99784:ClassDef_L23_C0", "label": "ExtendJavaLibWithInit", "type": "class", "loc": [23, 29], "level": 0, "parent": null, "vector": [3, 0, 0.7027, 0.1892, 0, 0.66, 0.8, 724, 0, 2, 0, 0, 716, 0, 0], "semantic": {"name": "ExtendJavaLibWithInit", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class ExtendJavaLibWithInit(ExampleJavaLibrary):\n\n def __init__(self, *args):\n self.args = args\n\n def get_args(self):\n return self.args"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99784:FunctionDef_L25_C4", "label": "__init__", "type": "function", "loc": [25, 26], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99784:ClassDef_L23_C0", "vector": [2, 1, 0.6892, 0.0541, 1, 0.05, 0.0, 555, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "args"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, *args):\n self.args = args"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99784:Assign_L26_C8", "label": "self.args =", "type": "assigned_variable", "loc": [26, 26], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99784:FunctionDef_L25_C4", "vector": [14, 2, 0.7027, 0.027, 2, 0.23, 0.0, 640, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.args", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.args = args"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99784:FunctionDef_L28_C4", "label": "get_args", "type": "function", "loc": [28, 29], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99784:ClassDef_L23_C0", "vector": [2, 1, 0.7703, 0.0541, 1, 0.05, 1.0, 671, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "get_args", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_args(self):\n return self.args"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99784:Return_L29_C8", "label": "return", "type": "return", "loc": [29, 29], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99784:FunctionDef_L28_C4", "vector": [13, 2, 0.7838, 0.027, 2, 0.82, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.args"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99784:ClassDef_L32_C0", "label": "ExtendJavaLibWithInitAndConstructor", "type": "class", "loc": [32, 37], "level": 0, "parent": null, "vector": [3, 0, 0.9324, 0.1622, 0, 0.66, 1.0, 702, 0, 1, 0, 0, 96, 0, 2], "semantic": {"name": "ExtendJavaLibWithInitAndConstructor", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class ExtendJavaLibWithInitAndConstructor(DefaultArgs):\n\n def __init__(self, *args):\n if len(args) == 1:\n DefaultArgs.__init__(self, args[0])\n self.kw = lambda self: \"Hello, world!\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99784:FunctionDef_L34_C4", "label": "__init__", "type": "function", "loc": [34, 37], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99784:ClassDef_L32_C0", "vector": [2, 1, 0.9595, 0.1081, 1, 0.37, 0.0, 555, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": ["self", "args"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, *args):\n if len(args) == 1:\n DefaultArgs.__init__(self, args[0])\n self.kw = lambda self: \"Hello, world!\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99784:If_L35_C8", "label": "if", "type": "if", "loc": [35, 36], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99784:FunctionDef_L34_C4", "vector": [4, 2, 0.9595, 0.0541, 2, 0.32, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(args) == 1:\n DefaultArgs.__init__(self, args[0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99784:Expr_L36_C12", "label": "__init__()", "type": "expression", "loc": [36, 36], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99784:If_L35_C8", "vector": [8, 3, 0.973, 0.027, 3, 0.43, 0.0, 555, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " DefaultArgs.__init__(self, args[0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99784:Assign_L37_C8", "label": "self.kw =", "type": "assigned_variable", "loc": [37, 37], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99784:FunctionDef_L34_C4", "vector": [14, 2, 1.0, 0.027, 2, 0.32, 1.0, 745, 9, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.kw", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.kw = lambda self: \"Hello, world!\""}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99784:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99784:FunctionDef_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99784:FunctionDef_L7_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99784:Return_L8_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99784:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99784:FunctionDef_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99784:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99784:FunctionDef_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99784:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99784:Expr_L14_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99784:ClassDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99784:FunctionDef_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99784:FunctionDef_L19_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99784:Return_L20_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99784:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99784:FunctionDef_L25_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99784:FunctionDef_L25_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99784:Assign_L26_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99784:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99784:FunctionDef_L28_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99784:FunctionDef_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99784:Return_L29_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99784:ClassDef_L32_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99784:FunctionDef_L34_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99784:FunctionDef_L34_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99784:If_L35_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99784:If_L35_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99784:Expr_L36_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99784:FunctionDef_L34_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99784:Assign_L37_C8"}] |
class ArgumentsPython:
# method docs are used in unit tests as expected min and max args
def a_0(self):
"""(0,0)"""
return 'a_0'
def a_1(self, arg):
"""(1,1)"""
return 'a_1: ' + arg
def a_3(self, arg1, arg2, arg3):
"""(3,3)"""
return ' '.join(['a_3:',arg1,arg2,arg3])
def a_0_1(self, arg='default'):
"""(0,1)"""
return 'a_0_1: ' + arg
def a_1_3(self, arg1, arg2='default', arg3='default'):
"""(1,3)"""
return ' '.join(['a_1_3:',arg1,arg2,arg3])
def a_0_n(self, *args):
"""(0,sys.maxint)"""
return ' '.join(['a_0_n:', ' '.join(args)])
def a_1_n(self, arg, *args):
"""(1,sys.maxint)"""
return ' '.join(['a_1_n:', arg, ' '.join(args)])
def a_1_2_n(self, arg1, arg2='default', *args):
"""(1,sys.maxint)"""
return ' '.join(['a_1_2_n:', arg1, arg2, ' '.join(args)])
| ajibawa-2023/Python-Code-Large/train/row_99786 | 25 | 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_99786:ClassDef_L1_C0", "label": "ArgumentsPython", "type": "class", "loc": [1, 35], "level": 0, "parent": null, "vector": [3, 0, 0.5, 0.9722, 0, 0.66, 0.0, 360, 0, 8, 0, 0, 0, 0, 8], "semantic": {"name": "ArgumentsPython", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class ArgumentsPython:\n \n # method docs are used in unit tests as expected min and max args\n \n def a_0(self):\n \"\"\"(0,0)\"\"\"\n return 'a_0'\n "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99786:FunctionDef_L5_C4", "label": "a_0", "type": "function", "loc": [5, 7], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99786:ClassDef_L1_C0", "vector": [2, 1, 0.1667, 0.0833, 1, 0.33, 0.0, 653, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "a_0", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def a_0(self):\n \"\"\"(0,0)\"\"\"\n return 'a_0'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99786:Expr_L6_C8", "label": "expression", "type": "expression", "loc": [6, 6], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99786:FunctionDef_L5_C4", "vector": [8, 2, 0.1667, 0.0278, 2, 0.28, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"(0,0)\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99786:Return_L7_C8", "label": "return", "type": "return", "loc": [7, 7], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99786:FunctionDef_L5_C4", "vector": [13, 2, 0.1944, 0.0278, 2, 0.28, 1.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 'a_0'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99786:FunctionDef_L9_C4", "label": "a_1", "type": "function", "loc": [9, 11], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99786:ClassDef_L1_C0", "vector": [2, 1, 0.2778, 0.0833, 1, 0.33, 0.1429, 818, 0, 2, 1, 0, 0, 0, 0], "semantic": {"name": "a_1", "arg_names": ["self", "arg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def a_1(self, arg):\n \"\"\"(1,1)\"\"\"\n return 'a_1: ' + arg"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99786:Expr_L10_C8", "label": "expression", "type": "expression", "loc": [10, 10], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99786:FunctionDef_L9_C4", "vector": [8, 2, 0.2778, 0.0278, 2, 0.33, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"(1,1)\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99786:Return_L11_C8", "label": "return", "type": "return", "loc": [11, 11], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99786:FunctionDef_L9_C4", "vector": [13, 2, 0.3056, 0.0278, 2, 0.33, 1.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 'a_1: ' + arg"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99786:FunctionDef_L13_C4", "label": "a_3", "type": "function", "loc": [13, 15], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99786:ClassDef_L1_C0", "vector": [2, 1, 0.3889, 0.0833, 1, 0.33, 0.2857, 878, 0, 4, 1, 0, 0, 0, 1], "semantic": {"name": "a_3", "arg_names": ["self", "arg1", "arg2", "arg3"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def a_3(self, arg1, arg2, arg3):\n \"\"\"(3,3)\"\"\"\n return ' '.join(['a_3:',arg1,arg2,arg3])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99786:Expr_L14_C8", "label": "expression", "type": "expression", "loc": [14, 14], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99786:FunctionDef_L13_C4", "vector": [8, 2, 0.3889, 0.0278, 2, 0.72, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"(3,3)\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99786:Return_L15_C8", "label": "return", "type": "return", "loc": [15, 15], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99786:FunctionDef_L13_C4", "vector": [13, 2, 0.4167, 0.0278, 2, 0.72, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ' '.join(['a_3:',arg1,arg2,arg3])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99786:FunctionDef_L17_C4", "label": "a_0_1", "type": "function", "loc": [17, 19], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99786:ClassDef_L1_C0", "vector": [2, 1, 0.5, 0.0833, 1, 0.33, 0.4286, 712, 0, 2, 1, 0, 0, 0, 0], "semantic": {"name": "a_0_1", "arg_names": ["self", "arg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def a_0_1(self, arg='default'):\n \"\"\"(0,1)\"\"\"\n return 'a_0_1: ' + arg"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99786:Expr_L18_C8", "label": "expression", "type": "expression", "loc": [18, 18], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99786:FunctionDef_L17_C4", "vector": [8, 2, 0.5, 0.0278, 2, 0.71, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"(0,1)\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99786:Return_L19_C8", "label": "return", "type": "return", "loc": [19, 19], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99786:FunctionDef_L17_C4", "vector": [13, 2, 0.5278, 0.0278, 2, 0.71, 1.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 'a_0_1: ' + arg"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99786:FunctionDef_L21_C4", "label": "a_1_3", "type": "function", "loc": [21, 23], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99786:ClassDef_L1_C0", "vector": [2, 1, 0.6111, 0.0833, 1, 0.33, 0.5714, 521, 0, 4, 1, 0, 0, 0, 1], "semantic": {"name": "a_1_3", "arg_names": ["self", "arg1", "arg2", "arg3"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def a_1_3(self, arg1, arg2='default', arg3='default'):\n \"\"\"(1,3)\"\"\"\n return ' '.join(['a_1_3:',arg1,arg2,arg3])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99786:Expr_L22_C8", "label": "expression", "type": "expression", "loc": [22, 22], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99786:FunctionDef_L21_C4", "vector": [8, 2, 0.6111, 0.0278, 2, 0.2, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"(1,3)\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99786:Return_L23_C8", "label": "return", "type": "return", "loc": [23, 23], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99786:FunctionDef_L21_C4", "vector": [13, 2, 0.6389, 0.0278, 2, 0.2, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ' '.join(['a_1_3:',arg1,arg2,arg3])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99786:FunctionDef_L25_C4", "label": "a_0_n", "type": "function", "loc": [25, 27], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99786:ClassDef_L1_C0", "vector": [2, 1, 0.7222, 0.0833, 1, 0.33, 0.7143, 697, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "a_0_n", "arg_names": ["self", "args"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def a_0_n(self, *args):\n \"\"\"(0,sys.maxint)\"\"\"\n return ' '.join(['a_0_n:', ' '.join(args)])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99786:Expr_L26_C8", "label": "expression", "type": "expression", "loc": [26, 26], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99786:FunctionDef_L25_C4", "vector": [8, 2, 0.7222, 0.0278, 2, 0.42, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"(0,sys.maxint)\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99786:Return_L27_C8", "label": "return", "type": "return", "loc": [27, 27], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99786:FunctionDef_L25_C4", "vector": [13, 2, 0.75, 0.0278, 2, 0.42, 1.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ' '.join(['a_0_n:', ' '.join(args)])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99786:FunctionDef_L29_C4", "label": "a_1_n", "type": "function", "loc": [29, 31], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99786:ClassDef_L1_C0", "vector": [2, 1, 0.8333, 0.0833, 1, 0.33, 0.8571, 993, 0, 3, 1, 0, 0, 0, 2], "semantic": {"name": "a_1_n", "arg_names": ["self", "arg", "args"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def a_1_n(self, arg, *args):\n \"\"\"(1,sys.maxint)\"\"\"\n return ' '.join(['a_1_n:', arg, ' '.join(args)])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99786:Expr_L30_C8", "label": "expression", "type": "expression", "loc": [30, 30], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99786:FunctionDef_L29_C4", "vector": [8, 2, 0.8333, 0.0278, 2, 0.95, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"(1,sys.maxint)\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99786:Return_L31_C8", "label": "return", "type": "return", "loc": [31, 31], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99786:FunctionDef_L29_C4", "vector": [13, 2, 0.8611, 0.0278, 2, 0.95, 1.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ' '.join(['a_1_n:', arg, ' '.join(args)])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99786:FunctionDef_L33_C4", "label": "a_1_2_n", "type": "function", "loc": [33, 35], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99786:ClassDef_L1_C0", "vector": [2, 1, 0.9444, 0.0833, 1, 0.33, 1.0, 561, 0, 4, 1, 0, 0, 0, 2], "semantic": {"name": "a_1_2_n", "arg_names": ["self", "arg1", "arg2", "args"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def a_1_2_n(self, arg1, arg2='default', *args):\n \"\"\"(1,sys.maxint)\"\"\"\n return ' '.join(['a_1_2_n:', arg1, arg2, ' '.join(args)])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99786:Expr_L34_C8", "label": "expression", "type": "expression", "loc": [34, 34], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99786:FunctionDef_L33_C4", "vector": [8, 2, 0.9444, 0.0278, 2, 0.78, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"(1,sys.maxint)\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99786:Return_L35_C8", "label": "return", "type": "return", "loc": [35, 35], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99786:FunctionDef_L33_C4", "vector": [13, 2, 0.9722, 0.0278, 2, 0.78, 1.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ' '.join(['a_1_2_n:', arg1, arg2, ' '.join(args)])"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99786:ClassDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99786:FunctionDef_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99786:FunctionDef_L5_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99786:Expr_L6_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99786:FunctionDef_L5_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99786:Return_L7_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99786:ClassDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99786:FunctionDef_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99786:FunctionDef_L9_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99786:Expr_L10_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99786:FunctionDef_L9_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99786:Return_L11_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99786:ClassDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99786:FunctionDef_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99786:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99786:Expr_L14_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99786:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99786:Return_L15_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99786:ClassDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99786:FunctionDef_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99786:FunctionDef_L17_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99786:Expr_L18_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99786:FunctionDef_L17_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99786:Return_L19_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99786:ClassDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99786:FunctionDef_L21_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99786:FunctionDef_L21_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99786:Expr_L22_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99786:FunctionDef_L21_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99786:Return_L23_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99786:ClassDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99786:FunctionDef_L25_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99786:FunctionDef_L25_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99786:Expr_L26_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99786:FunctionDef_L25_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99786:Return_L27_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99786:ClassDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99786:FunctionDef_L29_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99786:FunctionDef_L29_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99786:Expr_L30_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99786:FunctionDef_L29_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99786:Return_L31_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99786:ClassDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99786:FunctionDef_L33_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99786:FunctionDef_L33_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99786:Expr_L34_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99786:FunctionDef_L33_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99786:Return_L35_C8"}] |
from robot import utils
class RunKeywordLibrary:
ROBOT_LIBRARY_SCOPE = 'TESTCASE'
def __init__(self):
self.kw_names = ['Run Keyword That Passes', 'Run Keyword That Fails']
def get_keyword_names(self):
return self.kw_names
def run_keyword(self, name, args):
try:
method = dict(zip(self.kw_names, [self._passes, self._fails]))[name]
except KeyError:
raise AttributeError
return method(args)
def _passes(self, args):
for arg in args:
print arg,
return ', '.join(args)
def _fails(self, args):
if not args:
raise AssertionError('Failure')
raise AssertionError('Failure: %s' % ' '.join(args))
class GlobalRunKeywordLibrary(RunKeywordLibrary):
ROBOT_LIBRARY_SCOPE = 'GLOBAL'
class RunKeywordButNoGetKeywordNamesLibrary:
def run_keyword(self, *args):
return ' '.join(args)
def some_other_keyword(self, *args):
return ' '.join(args)
| ajibawa-2023/Python-Code-Large/train/row_99787 | 24 | 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_99787:ImportFrom_L1_C0", "label": "from robot import utils", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0244, 0.0244, 0, 0.66, 0.0, 735, 0, 1, 0, 0, 735, 0, 0], "semantic": {"name": "robot", "arg_names": [], "import_names": ["utils"], "rhs_call_name": "", "annotation": ""}, "snippet": "from robot import utils"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99787:ClassDef_L4_C0", "label": "RunKeywordLibrary", "type": "class", "loc": [4, 28], "level": 0, "parent": null, "vector": [3, 0, 0.3902, 0.6098, 0, 0.66, 0.3333, 741, 0, 5, 0, 0, 0, 0, 8], "semantic": {"name": "RunKeywordLibrary", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class RunKeywordLibrary:\n ROBOT_LIBRARY_SCOPE = 'TESTCASE'\n\n def __init__(self):\n self.kw_names = ['Run Keyword That Passes', 'Run Keyword That Fails']\n\n def get_keyword_names(self):\n return self.kw_names"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99787:Assign_L5_C4", "label": "ROBOT_LIBRARY_SCOPE =", "type": "assigned_variable", "loc": [5, 5], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99787:ClassDef_L4_C0", "vector": [14, 1, 0.122, 0.0244, 1, 0.88, 0.0, 305, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "ROBOT_LIBRARY_SCOPE", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ROBOT_LIBRARY_SCOPE = 'TESTCASE'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99787:FunctionDef_L7_C4", "label": "__init__", "type": "function", "loc": [7, 8], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99787:ClassDef_L4_C0", "vector": [2, 1, 0.1829, 0.0488, 1, 0.88, 0.2, 555, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self):\n self.kw_names = ['Run Keyword That Passes', 'Run Keyword That Fails']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99787:Assign_L8_C8", "label": "self.kw_names =", "type": "assigned_variable", "loc": [8, 8], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99787:FunctionDef_L7_C4", "vector": [14, 2, 0.1951, 0.0244, 2, 0.61, 0.0, 33, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.kw_names", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.kw_names = ['Run Keyword That Passes', 'Run Keyword That Fails']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99787:FunctionDef_L10_C4", "label": "get_keyword_names", "type": "function", "loc": [10, 11], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99787:ClassDef_L4_C0", "vector": [2, 1, 0.2561, 0.0488, 1, 0.88, 0.4, 768, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "get_keyword_names", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_keyword_names(self):\n return self.kw_names"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99787:Return_L11_C8", "label": "return", "type": "return", "loc": [11, 11], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99787:FunctionDef_L10_C4", "vector": [13, 2, 0.2683, 0.0244, 2, 0.13, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.kw_names"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99787:FunctionDef_L13_C4", "label": "run_keyword", "type": "function", "loc": [13, 18], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99787:ClassDef_L4_C0", "vector": [2, 1, 0.378, 0.1463, 1, 0.88, 0.6, 458, 0, 3, 1, 0, 0, 0, 3], "semantic": {"name": "run_keyword", "arg_names": ["self", "name", "args"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def run_keyword(self, name, args):\n try:\n method = dict(zip(self.kw_names, [self._passes, self._fails]))[name]\n except KeyError:\n raise AttributeError\n return method(args)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99787:Try_L14_C8", "label": "try", "type": "try", "loc": [14, 17], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99787:FunctionDef_L13_C4", "vector": [7, 2, 0.378, 0.0976, 2, 0.53, 0.0, 0, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n method = dict(zip(self.kw_names, [self._passes, self._fails]))[name]\n except KeyError:\n raise AttributeError"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99787:Assign_L15_C12", "label": "method =", "type": "assigned_variable", "loc": [15, 15], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99787:Try_L14_C8", "vector": [14, 3, 0.3659, 0.0244, 3, 0.96, 0.0, 445, 6, 0, 0, 0, 0, 0, 2], "semantic": {"name": "method", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " method = dict(zip(self.kw_names, [self._passes, self._fails]))[name]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99787:Return_L18_C8", "label": "return", "type": "return", "loc": [18, 18], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99787:FunctionDef_L13_C4", "vector": [13, 2, 0.439, 0.0244, 2, 0.53, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return method(args)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99787:FunctionDef_L20_C4", "label": "_passes", "type": "function", "loc": [20, 23], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99787:ClassDef_L4_C0", "vector": [2, 1, 0.5244, 0.0976, 1, 0.88, 0.8, 176, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "_passes", "arg_names": ["self", "args"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _passes(self, args):\n for arg in args:\n print(arg,)\n return ', '.join(args)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99787:For_L21_C8", "label": "for arg", "type": "for", "loc": [21, 22], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99787:FunctionDef_L20_C4", "vector": [6, 2, 0.5244, 0.0488, 2, 0.99, 0.0, 447, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "arg", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for arg in args:\n print(arg,)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99787:Expr_L22_C12", "label": "print()", "type": "expression", "loc": [22, 22], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99787:For_L21_C8", "vector": [8, 3, 0.5366, 0.0244, 3, 0.84, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(arg,)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99787:Return_L23_C8", "label": "return", "type": "return", "loc": [23, 23], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99787:FunctionDef_L20_C4", "vector": [13, 2, 0.561, 0.0244, 2, 0.99, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ', '.join(args)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99787:FunctionDef_L25_C4", "label": "_fails", "type": "function", "loc": [25, 28], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99787:ClassDef_L4_C0", "vector": [2, 1, 0.6463, 0.0976, 1, 0.88, 1.0, 937, 0, 2, 0, 0, 0, 0, 3], "semantic": {"name": "_fails", "arg_names": ["self", "args"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _fails(self, args):\n if not args:\n raise AssertionError('Failure')\n raise AssertionError('Failure: %s' % ' '.join(args))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99787:If_L26_C8", "label": "if", "type": "if", "loc": [26, 27], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99787:FunctionDef_L25_C4", "vector": [4, 2, 0.6463, 0.0488, 2, 0.67, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not args:\n raise AssertionError('Failure')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99787:ClassDef_L31_C0", "label": "GlobalRunKeywordLibrary", "type": "class", "loc": [31, 32], "level": 0, "parent": null, "vector": [3, 0, 0.7683, 0.0488, 0, 0.66, 0.6667, 688, 0, 0, 0, 0, 741, 0, 0], "semantic": {"name": "GlobalRunKeywordLibrary", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class GlobalRunKeywordLibrary(RunKeywordLibrary):\n ROBOT_LIBRARY_SCOPE = 'GLOBAL'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99787:Assign_L32_C4", "label": "ROBOT_LIBRARY_SCOPE =", "type": "assigned_variable", "loc": [32, 32], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99787:ClassDef_L31_C0", "vector": [14, 1, 0.7805, 0.0244, 1, 0.94, 0.0, 305, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "ROBOT_LIBRARY_SCOPE", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ROBOT_LIBRARY_SCOPE = 'GLOBAL'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99787:ClassDef_L35_C0", "label": "RunKeywordButNoGetKeywordNamesLibrary", "type": "class", "loc": [35, 41], "level": 0, "parent": null, "vector": [3, 0, 0.9268, 0.1707, 0, 0.66, 1.0, 352, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "RunKeywordButNoGetKeywordNamesLibrary", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class RunKeywordButNoGetKeywordNamesLibrary:\n\n def run_keyword(self, *args):\n return ' '.join(args)\n\n def some_other_keyword(self, *args):\n return ' '.join(args)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99787:FunctionDef_L37_C4", "label": "run_keyword", "type": "function", "loc": [37, 38], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99787:ClassDef_L35_C0", "vector": [2, 1, 0.9146, 0.0488, 1, 0.55, 0.0, 458, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "run_keyword", "arg_names": ["self", "args"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def run_keyword(self, *args):\n return ' '.join(args)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99787:Return_L38_C8", "label": "return", "type": "return", "loc": [38, 38], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99787:FunctionDef_L37_C4", "vector": [13, 2, 0.9268, 0.0244, 2, 0.79, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ' '.join(args)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99787:FunctionDef_L40_C4", "label": "some_other_keyword", "type": "function", "loc": [40, 41], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99787:ClassDef_L35_C0", "vector": [2, 1, 0.9878, 0.0488, 1, 0.55, 1.0, 861, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "some_other_keyword", "arg_names": ["self", "args"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def some_other_keyword(self, *args):\n return ' '.join(args)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99787:Return_L41_C8", "label": "return", "type": "return", "loc": [41, 41], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99787:FunctionDef_L40_C4", "vector": [13, 2, 1.0, 0.0244, 2, 0.57, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ' '.join(args)"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99787:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99787:Assign_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99787:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99787:FunctionDef_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99787:FunctionDef_L7_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99787:Assign_L8_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99787:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99787:FunctionDef_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99787:FunctionDef_L10_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99787:Return_L11_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99787:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99787:FunctionDef_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99787:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99787:Try_L14_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99787:Try_L14_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99787:Assign_L15_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99787:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99787:Return_L18_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99787:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99787:FunctionDef_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99787:FunctionDef_L20_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99787:For_L21_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99787:For_L21_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99787:Expr_L22_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99787:FunctionDef_L20_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99787:Return_L23_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99787:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99787:FunctionDef_L25_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99787:FunctionDef_L25_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99787:If_L26_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99787:ClassDef_L31_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99787:Assign_L32_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99787:ClassDef_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99787:FunctionDef_L37_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99787:FunctionDef_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99787:Return_L38_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99787:ClassDef_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99787:FunctionDef_L40_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99787:FunctionDef_L40_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99787:Return_L41_C8"}] |
library = "It should be OK to have an attribute with same name as the module"
def keyword_from_submodule(arg='World'):
return "Hello, %s!" % arg
| ajibawa-2023/Python-Code-Large/train/row_99788 | 3 | 5 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99788:Assign_L1_C0", "label": "library =", "type": "assigned_variable", "loc": [1, 1], "level": 0, "parent": null, "vector": [14, 0, 0.2, 0.2, 0, 0.66, 0.0, 860, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "library", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "library = \"It should be OK to have an attribute with same name as the module\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99788:FunctionDef_L4_C0", "label": "keyword_from_submodule", "type": "function", "loc": [4, 5], "level": 0, "parent": null, "vector": [2, 0, 0.9, 0.4, 0, 0.66, 1.0, 962, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "keyword_from_submodule", "arg_names": ["arg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def keyword_from_submodule(arg='World'):\n return \"Hello, %s!\" % arg"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99788:Return_L5_C4", "label": "return", "type": "return", "loc": [5, 5], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99788:FunctionDef_L4_C0", "vector": [13, 1, 1.0, 0.2, 1, 0.83, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return \"Hello, %s!\" % arg"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99788:FunctionDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99788:Return_L5_C4"}] |
some_string = 'Hello, World!'
class _SomeObject:
pass
some_object = _SomeObject() | ajibawa-2023/Python-Code-Large/train/row_99789 | 3 | 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_99789:Assign_L1_C0", "label": "some_string =", "type": "assigned_variable", "loc": [1, 1], "level": 0, "parent": null, "vector": [14, 0, 0.1667, 0.1667, 0, 0.66, 0.0, 913, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "some_string", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "some_string = 'Hello, World!'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99789:ClassDef_L3_C0", "label": "_SomeObject", "type": "class", "loc": [3, 4], "level": 0, "parent": null, "vector": [3, 0, 0.5833, 0.3333, 0, 0.66, 0.5, 122, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "_SomeObject", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class _SomeObject:\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99789:Assign_L6_C0", "label": "some_object = _SomeObject()", "type": "assigned_variable", "loc": [6, 6], "level": 0, "parent": null, "vector": [14, 0, 1.0, 0.1667, 0, 0.66, 1.0, 33, 3, 0, 0, 0, 122, 10, 1], "semantic": {"name": "some_object", "arg_names": [], "import_names": [], "rhs_call_name": "_SomeObject", "annotation": ""}, "snippet": "some_object = _SomeObject()"}] | [] |
class KwargsLibrary(object):
def __init__(self, arg1=None, arg2=None):
self.arg1 = arg1
self.arg2 = arg2
def check_init_arguments(self, exp_arg1, exp_arg2):
if self.arg1 != exp_arg1 or self.arg2 != exp_arg2:
raise AssertionError('Wrong initialization values. Got (%s, %s), expected (%s, %s)'
% (self.arg1, self.arg2, exp_arg1, exp_arg2))
def one_kwarg(self, kwarg=None):
return kwarg
def two_kwargs(self, fst=None, snd=None):
return '%s, %s' % (fst, snd)
def four_kwargs(self, a=None, b=None, c=None, d=None):
return '%s, %s, %s, %s' % (a, b, c, d)
def mandatory_and_kwargs(self, a, b, c=None):
return '%s, %s, %s' % (a, b, c)
def kwargs_and_mandatory_args(self, mandatory, d1=None, d2=None, *varargs):
return '%s, %s, %s, %s' % (mandatory, d1, d2, '[%s]' % ', '.join(varargs)) | ajibawa-2023/Python-Code-Large/train/row_99790 | 16 | 25 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99790:ClassDef_L1_C0", "label": "KwargsLibrary", "type": "class", "loc": [1, 25], "level": 0, "parent": null, "vector": [3, 0, 0.52, 1.0, 0, 0.66, 0.0, 328, 0, 7, 0, 0, 186, 0, 2], "semantic": {"name": "KwargsLibrary", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class KwargsLibrary(object):\n\n def __init__(self, arg1=None, arg2=None):\n self.arg1 = arg1\n self.arg2 = arg2\n\n def check_init_arguments(self, exp_arg1, exp_arg2):\n if self.arg1 != exp_arg1 or self.arg2 != exp_arg2:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99790:FunctionDef_L3_C4", "label": "__init__", "type": "function", "loc": [3, 5], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99790:ClassDef_L1_C0", "vector": [2, 1, 0.16, 0.12, 1, 0.16, 0.0, 555, 0, 3, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "arg1", "arg2"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, arg1=None, arg2=None):\n self.arg1 = arg1\n self.arg2 = arg2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99790:Assign_L4_C8", "label": "self.arg1 =", "type": "assigned_variable", "loc": [4, 4], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99790:FunctionDef_L3_C4", "vector": [14, 2, 0.16, 0.04, 2, 0.2, 0.0, 572, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.arg1", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.arg1 = arg1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99790:Assign_L5_C8", "label": "self.arg2 =", "type": "assigned_variable", "loc": [5, 5], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99790:FunctionDef_L3_C4", "vector": [14, 2, 0.2, 0.04, 2, 0.2, 1.0, 552, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.arg2", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.arg2 = arg2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99790:FunctionDef_L7_C4", "label": "check_init_arguments", "type": "function", "loc": [7, 10], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99790:ClassDef_L1_C0", "vector": [2, 1, 0.34, 0.16, 1, 0.16, 0.1667, 204, 0, 3, 0, 0, 0, 0, 1], "semantic": {"name": "check_init_arguments", "arg_names": ["self", "exp_arg1", "exp_arg2"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def check_init_arguments(self, exp_arg1, exp_arg2):\n if self.arg1 != exp_arg1 or self.arg2 != exp_arg2:\n raise AssertionError('Wrong initialization values. Got (%s, %s), expected (%s, %s)'\n % (self.arg1, self.arg2, exp_arg1, exp_arg2))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99790:If_L8_C8", "label": "if", "type": "if", "loc": [8, 10], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99790:FunctionDef_L7_C4", "vector": [4, 2, 0.36, 0.12, 2, 0.59, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.arg1 != exp_arg1 or self.arg2 != exp_arg2:\n raise AssertionError('Wrong initialization values. Got (%s, %s), expected (%s, %s)'\n % (self.arg1, self.arg2, exp_arg1, exp_arg2))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99790:FunctionDef_L12_C4", "label": "one_kwarg", "type": "function", "loc": [12, 13], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99790:ClassDef_L1_C0", "vector": [2, 1, 0.5, 0.08, 1, 0.16, 0.3333, 916, 0, 2, 1, 0, 0, 0, 0], "semantic": {"name": "one_kwarg", "arg_names": ["self", "kwarg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def one_kwarg(self, kwarg=None):\n return kwarg"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99790:Return_L13_C8", "label": "return", "type": "return", "loc": [13, 13], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99790:FunctionDef_L12_C4", "vector": [13, 2, 0.52, 0.04, 2, 0.24, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return kwarg"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99790:FunctionDef_L15_C4", "label": "two_kwargs", "type": "function", "loc": [15, 16], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99790:ClassDef_L1_C0", "vector": [2, 1, 0.62, 0.08, 1, 0.16, 0.5, 446, 0, 3, 1, 0, 0, 0, 0], "semantic": {"name": "two_kwargs", "arg_names": ["self", "fst", "snd"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def two_kwargs(self, fst=None, snd=None):\n return '%s, %s' % (fst, snd)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99790:Return_L16_C8", "label": "return", "type": "return", "loc": [16, 16], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99790:FunctionDef_L15_C4", "vector": [13, 2, 0.64, 0.04, 2, 0.36, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return '%s, %s' % (fst, snd)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99790:FunctionDef_L18_C4", "label": "four_kwargs", "type": "function", "loc": [18, 19], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99790:ClassDef_L1_C0", "vector": [2, 1, 0.74, 0.08, 1, 0.16, 0.6667, 302, 0, 5, 1, 0, 0, 0, 0], "semantic": {"name": "four_kwargs", "arg_names": ["self", "a", "b", "c", "d"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def four_kwargs(self, a=None, b=None, c=None, d=None):\n return '%s, %s, %s, %s' % (a, b, c, d)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99790:Return_L19_C8", "label": "return", "type": "return", "loc": [19, 19], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99790:FunctionDef_L18_C4", "vector": [13, 2, 0.76, 0.04, 2, 0.0, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return '%s, %s, %s, %s' % (a, b, c, d)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99790:FunctionDef_L21_C4", "label": "mandatory_and_kwargs", "type": "function", "loc": [21, 22], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99790:ClassDef_L1_C0", "vector": [2, 1, 0.86, 0.08, 1, 0.16, 0.8333, 416, 0, 4, 1, 0, 0, 0, 0], "semantic": {"name": "mandatory_and_kwargs", "arg_names": ["self", "a", "b", "c"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def mandatory_and_kwargs(self, a, b, c=None):\n return '%s, %s, %s' % (a, b, c)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99790:Return_L22_C8", "label": "return", "type": "return", "loc": [22, 22], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99790:FunctionDef_L21_C4", "vector": [13, 2, 0.88, 0.04, 2, 0.28, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return '%s, %s, %s' % (a, b, c)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99790:FunctionDef_L24_C4", "label": "kwargs_and_mandatory_args", "type": "function", "loc": [24, 25], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99790:ClassDef_L1_C0", "vector": [2, 1, 0.98, 0.08, 1, 0.16, 1.0, 890, 0, 5, 1, 0, 0, 0, 1], "semantic": {"name": "kwargs_and_mandatory_args", "arg_names": ["self", "mandatory", "d1", "d2", "varargs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def kwargs_and_mandatory_args(self, mandatory, d1=None, d2=None, *varargs):\n return '%s, %s, %s, %s' % (mandatory, d1, d2, '[%s]' % ', '.join(varargs))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99790:Return_L25_C8", "label": "return", "type": "return", "loc": [25, 25], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99790:FunctionDef_L24_C4", "vector": [13, 2, 1.0, 0.04, 2, 0.52, 0.0, 0, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return '%s, %s, %s, %s' % (mandatory, d1, d2, '[%s]' % ', '.join(varargs))"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99790:ClassDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99790:FunctionDef_L3_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99790:FunctionDef_L3_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99790:Assign_L4_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99790:FunctionDef_L3_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99790:Assign_L5_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99790:ClassDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99790:FunctionDef_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99790:FunctionDef_L7_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99790:If_L8_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99790:ClassDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99790:FunctionDef_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99790:FunctionDef_L12_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99790:Return_L13_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99790:ClassDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99790:FunctionDef_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99790:FunctionDef_L15_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99790:Return_L16_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99790:ClassDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99790:FunctionDef_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99790:FunctionDef_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99790:Return_L19_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99790:ClassDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99790:FunctionDef_L21_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99790:FunctionDef_L21_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99790:Return_L22_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99790:ClassDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99790:FunctionDef_L24_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99790:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99790:Return_L25_C8"}] |
class ParameterLibrary:
def __init__(self, host='localhost', port='8080'):
self.host = host
self.port = port
def parameters(self):
return self.host, self.port | ajibawa-2023/Python-Code-Large/train/row_99791 | 6 | 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_99791:ClassDef_L1_C0", "label": "ParameterLibrary", "type": "class", "loc": [1, 8], "level": 0, "parent": null, "vector": [3, 0, 0.5625, 1.0, 0, 0.66, 0.0, 341, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "ParameterLibrary", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class ParameterLibrary:\n \n def __init__(self, host='localhost', port='8080'):\n self.host = host\n self.port = port\n \n def parameters(self):\n return self.host, self.port"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99791:FunctionDef_L3_C4", "label": "__init__", "type": "function", "loc": [3, 5], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99791:ClassDef_L1_C0", "vector": [2, 1, 0.5, 0.375, 1, 0.76, 0.0, 555, 0, 3, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "host", "port"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, host='localhost', port='8080'):\n self.host = host\n self.port = port"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99791:Assign_L4_C8", "label": "self.host =", "type": "assigned_variable", "loc": [4, 4], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99791:FunctionDef_L3_C4", "vector": [14, 2, 0.5, 0.125, 2, 0.08, 0.0, 445, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.host", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.host = host"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99791:Assign_L5_C8", "label": "self.port =", "type": "assigned_variable", "loc": [5, 5], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99791:FunctionDef_L3_C4", "vector": [14, 2, 0.625, 0.125, 2, 0.08, 1.0, 435, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.port", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.port = port"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99791:FunctionDef_L7_C4", "label": "parameters", "type": "function", "loc": [7, 8], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99791:ClassDef_L1_C0", "vector": [2, 1, 0.9375, 0.25, 1, 0.76, 1.0, 29, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "parameters", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def parameters(self):\n return self.host, self.port"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99791:Return_L8_C8", "label": "return", "type": "return", "loc": [8, 8], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99791:FunctionDef_L7_C4", "vector": [13, 2, 1.0, 0.125, 2, 0.4, 0.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.host, self.port"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99791:ClassDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99791:FunctionDef_L3_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99791:FunctionDef_L3_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99791:Assign_L4_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99791:FunctionDef_L3_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99791:Assign_L5_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99791:ClassDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99791:FunctionDef_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99791:FunctionDef_L7_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99791:Return_L8_C8"}] |
from robot import utils
def passing_handler(*args):
for arg in args:
print arg,
return ', '.join(args)
def failing_handler(*args):
if len(args) == 0:
msg = 'Failure'
else:
msg = 'Failure: %s' % ' '.join(args)
raise AssertionError(msg)
class GetKeywordNamesLibrary:
def __init__(self):
self.this_is_not_keyword = 'This is just an attribute!!'
def get_keyword_names(self):
return ['Get Keyword That Passes', 'Get Keyword That Fails',
'keyword_in_library_itself', 'non_existing_kw',
'this_is_not_keyword']
def __getattr__(self, name):
if name == 'Get Keyword That Passes':
return passing_handler
if name == 'Get Keyword That Fails':
return failing_handler
raise AttributeError("Non-existing keyword '%s'" % name)
def keyword_in_library_itself(self):
msg = 'No need for __getattr__ here!!'
print msg
return msg
| ajibawa-2023/Python-Code-Large/train/row_99792 | 23 | 37 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99792:ImportFrom_L1_C0", "label": "from robot import utils", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.027, 0.027, 0, 0.66, 0.0, 735, 0, 1, 0, 0, 735, 0, 0], "semantic": {"name": "robot", "arg_names": [], "import_names": ["utils"], "rhs_call_name": "", "annotation": ""}, "snippet": "from robot import utils"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99792:FunctionDef_L4_C0", "label": "passing_handler", "type": "function", "loc": [4, 7], "level": 0, "parent": null, "vector": [2, 0, 0.1486, 0.1081, 0, 0.66, 0.3333, 44, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "passing_handler", "arg_names": ["args"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def passing_handler(*args):\n for arg in args:\n print(arg,)\n return ', '.join(args)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99792:For_L5_C4", "label": "for arg", "type": "for", "loc": [5, 6], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99792:FunctionDef_L4_C0", "vector": [6, 1, 0.1486, 0.0541, 1, 0.27, 0.0, 447, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "arg", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for arg in args:\n print(arg,)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99792:Expr_L6_C8", "label": "print()", "type": "expression", "loc": [6, 6], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99792:For_L5_C4", "vector": [8, 2, 0.1622, 0.027, 2, 0.12, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(arg,)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99792:Return_L7_C4", "label": "return", "type": "return", "loc": [7, 7], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99792:FunctionDef_L4_C0", "vector": [13, 1, 0.1892, 0.027, 1, 0.27, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ', '.join(args)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99792:FunctionDef_L9_C0", "label": "failing_handler", "type": "function", "loc": [9, 14], "level": 0, "parent": null, "vector": [2, 0, 0.3108, 0.1622, 0, 0.66, 0.6667, 170, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "failing_handler", "arg_names": ["args"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def failing_handler(*args):\n if len(args) == 0:\n msg = 'Failure'\n else:\n msg = 'Failure: %s' % ' '.join(args)\n raise AssertionError(msg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99792:If_L10_C4", "label": "if", "type": "if", "loc": [10, 13], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99792:FunctionDef_L9_C0", "vector": [4, 1, 0.3108, 0.1081, 1, 0.77, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(args) == 0:\n msg = 'Failure'\n else:\n msg = 'Failure: %s' % ' '.join(args)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99792:Assign_L11_C8", "label": "msg =", "type": "assigned_variable", "loc": [11, 11], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99792:If_L10_C4", "vector": [14, 2, 0.2973, 0.027, 2, 0.55, 0.0, 712, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "msg", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " msg = 'Failure'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99792:Assign_L13_C8", "label": "msg =", "type": "assigned_variable", "loc": [13, 13], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99792:If_L10_C4", "vector": [14, 2, 0.3514, 0.027, 2, 0.55, 1.0, 712, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "msg", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " msg = 'Failure: %s' % ' '.join(args)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99792:ClassDef_L17_C0", "label": "GetKeywordNamesLibrary", "type": "class", "loc": [17, 37], "level": 0, "parent": null, "vector": [3, 0, 0.7297, 0.5676, 0, 0.66, 1.0, 680, 0, 4, 0, 0, 0, 0, 2], "semantic": {"name": "GetKeywordNamesLibrary", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class GetKeywordNamesLibrary:\n \n def __init__(self):\n self.this_is_not_keyword = 'This is just an attribute!!'\n \n def get_keyword_names(self):\n return ['Get Keyword That Passes', 'Get Keyword That Fails',\n 'keyword_in_library_itself', 'non_existing_kw',"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99792:FunctionDef_L19_C4", "label": "__init__", "type": "function", "loc": [19, 20], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99792:ClassDef_L17_C0", "vector": [2, 1, 0.527, 0.0541, 1, 0.73, 0.0, 555, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self):\n self.this_is_not_keyword = 'This is just an attribute!!'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99792:Assign_L20_C8", "label": "self.this_is_not_keyword =", "type": "assigned_variable", "loc": [20, 20], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99792:FunctionDef_L19_C4", "vector": [14, 2, 0.5405, 0.027, 2, 0.47, 0.0, 913, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "self.this_is_not_keyword", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.this_is_not_keyword = 'This is just an attribute!!'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99792:FunctionDef_L22_C4", "label": "get_keyword_names", "type": "function", "loc": [22, 25], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99792:ClassDef_L17_C0", "vector": [2, 1, 0.6351, 0.1081, 1, 0.73, 0.3333, 768, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "get_keyword_names", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_keyword_names(self):\n return ['Get Keyword That Passes', 'Get Keyword That Fails',\n 'keyword_in_library_itself', 'non_existing_kw',\n 'this_is_not_keyword']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99792:Return_L23_C8", "label": "return", "type": "return", "loc": [23, 25], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99792:FunctionDef_L22_C4", "vector": [13, 2, 0.6486, 0.0811, 2, 0.65, 0.0, 0, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ['Get Keyword That Passes', 'Get Keyword That Fails',\n 'keyword_in_library_itself', 'non_existing_kw',\n 'this_is_not_keyword']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99792:FunctionDef_L27_C4", "label": "__getattr__", "type": "function", "loc": [27, 32], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99792:ClassDef_L17_C0", "vector": [2, 1, 0.7973, 0.1622, 1, 0.73, 0.6667, 210, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "__getattr__", "arg_names": ["self", "name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __getattr__(self, name):\n if name == 'Get Keyword That Passes':\n return passing_handler\n if name == 'Get Keyword That Fails':\n return failing_handler\n raise AttributeError(\"Non-existing keyword '%s'\" % name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99792:If_L28_C8", "label": "if", "type": "if", "loc": [28, 29], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99792:FunctionDef_L27_C4", "vector": [4, 2, 0.7703, 0.0541, 2, 0.08, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if name == 'Get Keyword That Passes':\n return passing_handler"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99792:Return_L29_C12", "label": "return", "type": "return", "loc": [29, 29], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99792:If_L28_C8", "vector": [13, 3, 0.7838, 0.027, 3, 0.71, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return passing_handler"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99792:If_L30_C8", "label": "if", "type": "if", "loc": [30, 31], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99792:FunctionDef_L27_C4", "vector": [4, 2, 0.8243, 0.0541, 2, 0.08, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if name == 'Get Keyword That Fails':\n return failing_handler"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99792:Return_L31_C12", "label": "return", "type": "return", "loc": [31, 31], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99792:If_L30_C8", "vector": [13, 3, 0.8378, 0.027, 3, 0.05, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return failing_handler"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99792:FunctionDef_L34_C4", "label": "keyword_in_library_itself", "type": "function", "loc": [34, 37], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99792:ClassDef_L17_C0", "vector": [2, 1, 0.9595, 0.1081, 1, 0.73, 1.0, 814, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "keyword_in_library_itself", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def keyword_in_library_itself(self):\n msg = 'No need for __getattr__ here!!'\n print(msg)\n return msg"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99792:Assign_L35_C8", "label": "msg =", "type": "assigned_variable", "loc": [35, 35], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99792:FunctionDef_L34_C4", "vector": [14, 2, 0.9459, 0.027, 2, 0.9, 0.0, 712, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "msg", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " msg = 'No need for __getattr__ here!!'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99792:Expr_L36_C8", "label": "print()", "type": "expression", "loc": [36, 36], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99792:FunctionDef_L34_C4", "vector": [8, 2, 0.973, 0.027, 2, 0.9, 0.5, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(msg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99792:Return_L37_C8", "label": "return", "type": "return", "loc": [37, 37], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99792:FunctionDef_L34_C4", "vector": [13, 2, 1.0, 0.027, 2, 0.9, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return msg"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99792:FunctionDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99792:For_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99792:For_L5_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99792:Expr_L6_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99792:FunctionDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99792:Return_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99792:FunctionDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99792:If_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99792:If_L10_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99792:Assign_L11_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99792:If_L10_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99792:Assign_L13_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99792:ClassDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99792:FunctionDef_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99792:FunctionDef_L19_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99792:Assign_L20_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99792:ClassDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99792:FunctionDef_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99792:FunctionDef_L22_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99792:Return_L23_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99792:ClassDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99792:FunctionDef_L27_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99792:FunctionDef_L27_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99792:If_L28_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99792:If_L28_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99792:Return_L29_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99792:FunctionDef_L27_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99792:If_L30_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99792:If_L30_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99792:Return_L31_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99792:ClassDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99792:FunctionDef_L34_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99792:FunctionDef_L34_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99792:Assign_L35_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99792:FunctionDef_L34_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99792:Expr_L36_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99792:FunctionDef_L34_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99792:Return_L37_C8"}] |
class Mandatory:
def __init__(self, mandatory1, mandatory2):
self.mandatory1 = mandatory1
self.mandatory2 = mandatory2
def get_args(self):
return self.mandatory1, self.mandatory2
class Defaults(object):
def __init__(self, mandatory, default1='value', default2=None):
self.mandatory = mandatory
self.default1 = default1
self.default2 = default2
def get_args(self):
return self.mandatory, self.default1, self.default2
class Varargs(Mandatory):
def __init__(self, mandatory, *varargs):
Mandatory.__init__(self, mandatory, ' '.join(str(a) for a in varargs))
class Mixed(Defaults):
def __init__(self, mandatory, default=42, *extra):
Defaults.__init__(self, mandatory, default,
' '.join(str(a) for a in extra))
| ajibawa-2023/Python-Code-Large/train/row_99794 | 19 | 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_99794:ClassDef_L1_C0", "label": "Mandatory", "type": "class", "loc": [1, 8], "level": 0, "parent": null, "vector": [3, 0, 0.1406, 0.25, 0, 0.66, 0.0, 745, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "Mandatory", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Mandatory:\n\n def __init__(self, mandatory1, mandatory2):\n self.mandatory1 = mandatory1\n self.mandatory2 = mandatory2\n\n def get_args(self):\n return self.mandatory1, self.mandatory2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99794:FunctionDef_L3_C4", "label": "__init__", "type": "function", "loc": [3, 5], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99794:ClassDef_L1_C0", "vector": [2, 1, 0.125, 0.0938, 1, 0.67, 0.0, 555, 0, 3, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "mandatory1", "mandatory2"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, mandatory1, mandatory2):\n self.mandatory1 = mandatory1\n self.mandatory2 = mandatory2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99794:Assign_L4_C8", "label": "self.mandatory1 =", "type": "assigned_variable", "loc": [4, 4], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99794:FunctionDef_L3_C4", "vector": [14, 2, 0.125, 0.0312, 2, 0.12, 0.0, 309, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.mandatory1", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.mandatory1 = mandatory1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99794:Assign_L5_C8", "label": "self.mandatory2 =", "type": "assigned_variable", "loc": [5, 5], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99794:FunctionDef_L3_C4", "vector": [14, 2, 0.1562, 0.0312, 2, 0.12, 1.0, 116, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.mandatory2", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.mandatory2 = mandatory2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99794:FunctionDef_L7_C4", "label": "get_args", "type": "function", "loc": [7, 8], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99794:ClassDef_L1_C0", "vector": [2, 1, 0.2344, 0.0625, 1, 0.67, 1.0, 671, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "get_args", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_args(self):\n return self.mandatory1, self.mandatory2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99794:Return_L8_C8", "label": "return", "type": "return", "loc": [8, 8], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99794:FunctionDef_L7_C4", "vector": [13, 2, 0.25, 0.0312, 2, 0.9, 0.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.mandatory1, self.mandatory2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99794:ClassDef_L11_C0", "label": "Defaults", "type": "class", "loc": [11, 19], "level": 0, "parent": null, "vector": [3, 0, 0.4688, 0.2812, 0, 0.66, 0.3333, 820, 0, 2, 0, 0, 186, 0, 0], "semantic": {"name": "Defaults", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Defaults(object):\n\n def __init__(self, mandatory, default1='value', default2=None):\n self.mandatory = mandatory\n self.default1 = default1\n self.default2 = default2\n\n def get_args(self):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99794:FunctionDef_L13_C4", "label": "__init__", "type": "function", "loc": [13, 16], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99794:ClassDef_L11_C0", "vector": [2, 1, 0.4531, 0.125, 1, 0.55, 0.0, 555, 0, 4, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "mandatory", "default1", "default2"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, mandatory, default1='value', default2=None):\n self.mandatory = mandatory\n self.default1 = default1\n self.default2 = default2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99794:Assign_L14_C8", "label": "self.mandatory =", "type": "assigned_variable", "loc": [14, 14], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99794:FunctionDef_L13_C4", "vector": [14, 2, 0.4375, 0.0312, 2, 0.65, 0.0, 557, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.mandatory", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.mandatory = mandatory"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99794:Assign_L15_C8", "label": "self.default1 =", "type": "assigned_variable", "loc": [15, 15], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99794:FunctionDef_L13_C4", "vector": [14, 2, 0.4688, 0.0312, 2, 0.65, 0.5, 377, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.default1", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.default1 = default1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99794:Assign_L16_C8", "label": "self.default2 =", "type": "assigned_variable", "loc": [16, 16], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99794:FunctionDef_L13_C4", "vector": [14, 2, 0.5, 0.0312, 2, 0.65, 1.0, 576, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.default2", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.default2 = default2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99794:FunctionDef_L18_C4", "label": "get_args", "type": "function", "loc": [18, 19], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99794:ClassDef_L11_C0", "vector": [2, 1, 0.5781, 0.0625, 1, 0.55, 1.0, 671, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "get_args", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_args(self):\n return self.mandatory, self.default1, self.default2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99794:Return_L19_C8", "label": "return", "type": "return", "loc": [19, 19], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99794:FunctionDef_L18_C4", "vector": [13, 2, 0.5938, 0.0312, 2, 0.79, 0.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.mandatory, self.default1, self.default2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99794:ClassDef_L22_C0", "label": "Varargs", "type": "class", "loc": [22, 25], "level": 0, "parent": null, "vector": [3, 0, 0.7344, 0.125, 0, 0.66, 0.6667, 301, 0, 1, 0, 0, 745, 0, 3], "semantic": {"name": "Varargs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Varargs(Mandatory):\n\n def __init__(self, mandatory, *varargs):\n Mandatory.__init__(self, mandatory, ' '.join(str(a) for a in varargs))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99794:FunctionDef_L24_C4", "label": "__init__", "type": "function", "loc": [24, 25], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99794:ClassDef_L22_C0", "vector": [2, 1, 0.7656, 0.0625, 1, 0.9, 0.0, 555, 0, 3, 0, 0, 0, 0, 3], "semantic": {"name": "__init__", "arg_names": ["self", "mandatory", "varargs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, mandatory, *varargs):\n Mandatory.__init__(self, mandatory, ' '.join(str(a) for a in varargs))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99794:Expr_L25_C8", "label": "__init__()", "type": "expression", "loc": [25, 25], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99794:FunctionDef_L24_C4", "vector": [8, 2, 0.7812, 0.0312, 2, 0.65, 0.0, 555, 3, 3, 0, 0, 0, 0, 3], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " Mandatory.__init__(self, mandatory, ' '.join(str(a) for a in varargs))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99794:ClassDef_L28_C0", "label": "Mixed", "type": "class", "loc": [28, 32], "level": 0, "parent": null, "vector": [3, 0, 0.9375, 0.1562, 0, 0.66, 1.0, 781, 0, 1, 0, 0, 820, 0, 3], "semantic": {"name": "Mixed", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Mixed(Defaults):\n\n def __init__(self, mandatory, default=42, *extra):\n Defaults.__init__(self, mandatory, default, \n ' '.join(str(a) for a in extra))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99794:FunctionDef_L30_C4", "label": "__init__", "type": "function", "loc": [30, 32], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99794:ClassDef_L28_C0", "vector": [2, 1, 0.9688, 0.0938, 1, 0.42, 0.0, 555, 0, 4, 0, 0, 0, 0, 3], "semantic": {"name": "__init__", "arg_names": ["self", "mandatory", "default", "extra"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, mandatory, default=42, *extra):\n Defaults.__init__(self, mandatory, default, \n ' '.join(str(a) for a in extra))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99794:Expr_L31_C8", "label": "__init__()", "type": "expression", "loc": [31, 32], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99794:FunctionDef_L30_C4", "vector": [8, 2, 0.9844, 0.0625, 2, 0.19, 0.0, 555, 3, 4, 0, 0, 0, 0, 3], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " Defaults.__init__(self, mandatory, default, \n ' '.join(str(a) for a in extra))"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99794:ClassDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99794:FunctionDef_L3_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99794:FunctionDef_L3_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99794:Assign_L4_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99794:FunctionDef_L3_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99794:Assign_L5_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99794:ClassDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99794:FunctionDef_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99794:FunctionDef_L7_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99794:Return_L8_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99794:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99794:FunctionDef_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99794:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99794:Assign_L14_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99794:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99794:Assign_L15_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99794:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99794:Assign_L16_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99794:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99794:FunctionDef_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99794:FunctionDef_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99794:Return_L19_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99794:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99794:FunctionDef_L24_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99794:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99794:Expr_L25_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99794:ClassDef_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99794:FunctionDef_L30_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99794:FunctionDef_L30_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99794:Expr_L31_C8"}] |
from ExampleLibrary import ExampleLibrary
class ExtendPythonLib(ExampleLibrary):
def kw_in_python_extender(self, arg):
return arg/2
def print_many(self, *msgs):
raise Exception('Overridden kw executed!')
def using_method_from_python_parent(self):
self.exception('AssertionError', 'Error message from lib') | ajibawa-2023/Python-Code-Large/train/row_99796 | 7 | 12 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99796:ImportFrom_L1_C0", "label": "from ExampleLibrary import ExampleLibrary", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0833, 0.0833, 0, 0.66, 0.0, 472, 0, 1, 0, 0, 472, 0, 0], "semantic": {"name": "ExampleLibrary", "arg_names": [], "import_names": ["ExampleLibrary"], "rhs_call_name": "", "annotation": ""}, "snippet": "from ExampleLibrary import ExampleLibrary"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99796:ClassDef_L3_C0", "label": "ExtendPythonLib", "type": "class", "loc": [3, 12], "level": 0, "parent": null, "vector": [3, 0, 0.625, 0.8333, 0, 0.66, 1.0, 677, 0, 3, 0, 0, 472, 0, 2], "semantic": {"name": "ExtendPythonLib", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class ExtendPythonLib(ExampleLibrary):\n \n def kw_in_python_extender(self, arg):\n return arg/2\n \n def print_many(self, *msgs):\n raise Exception('Overridden kw executed!')\n "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99796:FunctionDef_L5_C4", "label": "kw_in_python_extender", "type": "function", "loc": [5, 6], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99796:ClassDef_L3_C0", "vector": [2, 1, 0.4583, 0.1667, 1, 0.02, 0.0, 158, 0, 2, 1, 0, 0, 0, 0], "semantic": {"name": "kw_in_python_extender", "arg_names": ["self", "arg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def kw_in_python_extender(self, arg):\n return arg/2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99796:Return_L6_C8", "label": "return", "type": "return", "loc": [6, 6], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99796:FunctionDef_L5_C4", "vector": [13, 2, 0.5, 0.0833, 2, 0.56, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return arg/2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99796:FunctionDef_L8_C4", "label": "print_many", "type": "function", "loc": [8, 9], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99796:ClassDef_L3_C0", "vector": [2, 1, 0.7083, 0.1667, 1, 0.02, 0.5, 690, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print_many", "arg_names": ["self", "msgs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def print_many(self, *msgs):\n raise Exception('Overridden kw executed!')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99796:FunctionDef_L11_C4", "label": "using_method_from_python_parent", "type": "function", "loc": [11, 12], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99796:ClassDef_L3_C0", "vector": [2, 1, 0.9583, 0.1667, 1, 0.02, 1.0, 487, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "using_method_from_python_parent", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def using_method_from_python_parent(self):\n self.exception('AssertionError', 'Error message from lib')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99796:Expr_L12_C8", "label": "exception()", "type": "expression", "loc": [12, 12], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99796:FunctionDef_L11_C4", "vector": [8, 2, 1.0, 0.0833, 2, 0.59, 0.0, 69, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "exception", "arg_names": [], "import_names": [], "rhs_call_name": "exception", "annotation": ""}, "snippet": " self.exception('AssertionError', 'Error message from lib')"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99796:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99796:FunctionDef_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99796:FunctionDef_L5_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99796:Return_L6_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99796:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99796:FunctionDef_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99796:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99796:FunctionDef_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99796:FunctionDef_L11_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99796:Expr_L12_C8"}] |
__version__ = 'N/A' # This should be ignored when version is parsed
class NameLibrary:
handler_count = 10
def simple1(self):
"""Simple 1"""
def simple2___(self):
"""Simple 2"""
def underscore_name(self):
"""Underscore Name"""
def underscore_name2_(self):
"""Underscore Name2"""
def un_der__sco_r__e_3(self):
"""Un Der Sco R E 3"""
def MiXeD_CAPS(self):
"""MiXeD CAPS"""
def camelCase(self):
"""Camel Case"""
def camelCase2(self):
"""Camel Case 2"""
def mixedCAPSCamel(self):
"""Mixed CAPS Camel"""
def camelCase_and_underscores_doesNot_work(self):
"""CamelCase And Underscores DoesNot Work"""
def _skipped1(self):
"""Starts with underscore"""
skipped2 = "Not a function"
class DocLibrary:
handler_count = 3
def no_doc(self): pass
no_doc.expected_doc = ''
no_doc.expected_shortdoc = ''
def one_line_doc(self):
"""One line doc"""
one_line_doc.expected_doc = 'One line doc'
one_line_doc.expected_shortdoc = 'One line doc'
def multiline_doc(self):
"""Multiline doc.
Spans multiple lines.
"""
multiline_doc.expected_doc = 'Multiline doc.\n\nSpans multiple lines.'
multiline_doc.expected_shortdoc = 'Multiline doc.'
class ArgInfoLibrary:
handler_count = 11
def no_args(self):
"""[], [], None"""
# Argument inspection had a bug when there was args on function body
# so better keep some of them around here.
a=b=c=1
def required1(self, one):
"""['one',], [], None"""
def required2(self, one, two):
"""['one','two'], [], None"""
def required9(self, one, two, three, four, five, six, seven, eight, nine):
"""['one','two','three','four','five','six','seven','eight','nine'],\
[], None"""
def default1(self, one=1):
"""['one'], [1], None"""
def default5(self, one='', two=None, three=3, four='huh', five=True):
"""['one','two','three','four','five'], ['',None,3,'huh',True], None"""
def required1_default1(self, one, two=''):
"""['one','two'], [''], None"""
def required2_default3(self, one, two, three=3, four=4, five=5):
"""['one','two','three','four','five'], [3,4,5], None"""
def varargs(self,*one):
"""[], [], 'one'"""
def required2_varargs(self, one, two, *three):
"""['one','two'], [], 'three'"""
def req4_def2_varargs(self, one, two, three, four, five=5, six=6, *seven):
"""['one','two','three','four','five','six'], [5,6], 'seven'"""
class GetattrLibrary:
handler_count = 3
keyword_names = ['foo','bar','zap']
def get_keyword_names(self):
return self.keyword_names
def __getattr__(self, name):
def handler(*args):
return name, args
if name not in self.keyword_names:
raise AttributeError
return handler
class SynonymLibrary:
handler_count = 3
def handler(self):
pass
synonym_handler = handler
another_synonym = handler
class VersionLibrary:
ROBOT_LIBRARY_VERSION = '0.1'
kw = lambda x:None
class VersionObjectLibrary:
class _Version:
def __init__(self, ver):
self._ver = ver
def __str__(self):
return self._ver
ROBOT_LIBRARY_VERSION = _Version('ver')
kw = lambda x:None
class RecordingLibrary:
ROBOT_LIBRARY_SCOPE = 'GLOBAL'
def __init__(self):
self.calls_to_getattr = 0
def kw(self):
pass
def __getattr__(self, name):
self.calls_to_getattr += 1
if name != 'kw':
raise AttributeError
return self.kw
class ArgDocDynamicLibrary:
def __init__(self):
kws = [('No Arg', []),
('One Arg', ['arg']),
('One or Two Args', ['arg', 'darg=dvalue']),
('Many Args', ['*args'])]
self._keywords = dict((name, _KeywordInfo(name, argspec))
for name, argspec in kws)
def get_keyword_names(self):
return sorted(self._keywords.keys())
def run_keyword(self, name, *args):
print '*INFO* Executed keyword %s with arguments %s' % (name, args)
def get_keyword_documentation(self, name):
return self._keywords[name].doc
def get_keyword_arguments(self, name):
return self._keywords[name].argspec
class _KeywordInfo:
doc_template = 'Keyword documentation for %s'
def __init__(self, name, argspec):
self.doc = self.doc_template % name
self.argspec = argspec
class InvalidGetDocDynamicLibrary(ArgDocDynamicLibrary):
def get_keyword_documentation(self, name, invalid_arg):
pass
class InvalidGetArgsDynamicLibrary(ArgDocDynamicLibrary):
def get_keyword_arguments(self, name):
1/0
class InvalidAttributeDynamicLibrary(ArgDocDynamicLibrary):
get_keyword_documentation = True
get_keyword_arguments = False
| ajibawa-2023/Python-Code-Large/train/row_99797 | 123 | 163 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99797:Assign_L1_C0", "label": "__version__ =", "type": "assigned_variable", "loc": [1, 1], "level": 0, "parent": null, "vector": [14, 0, 0.0061, 0.0061, 0, 0.66, 0.0, 162, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__version__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "__version__ = 'N/A' # This should be ignored when version is parsed"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L4_C0", "label": "NameLibrary", "type": "class", "loc": [4, 28], "level": 0, "parent": null, "vector": [3, 0, 0.0982, 0.1534, 0, 0.66, 0.0769, 353, 0, 11, 0, 0, 0, 0, 0], "semantic": {"name": "NameLibrary", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class NameLibrary:\n handler_count = 10\n def simple1(self):\n \"\"\"Simple 1\"\"\"\n def simple2___(self):\n \"\"\"Simple 2\"\"\"\n def underscore_name(self):\n \"\"\"Underscore Name\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99797:Assign_L5_C4", "label": "handler_count =", "type": "assigned_variable", "loc": [5, 5], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L4_C0", "vector": [14, 1, 0.0307, 0.0061, 1, 0.82, 0.0, 947, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "handler_count", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " handler_count = 10"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L6_C4", "label": "simple1", "type": "function", "loc": [6, 7], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L4_C0", "vector": [2, 1, 0.0399, 0.0123, 1, 0.82, 0.0833, 736, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "simple1", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def simple1(self):\n \"\"\"Simple 1\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99797:Expr_L7_C8", "label": "expression", "type": "expression", "loc": [7, 7], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L6_C4", "vector": [8, 2, 0.0429, 0.0061, 2, 0.56, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Simple 1\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L8_C4", "label": "simple2___", "type": "function", "loc": [8, 9], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L4_C0", "vector": [2, 1, 0.0521, 0.0123, 1, 0.82, 0.1667, 400, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "simple2___", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def simple2___(self):\n \"\"\"Simple 2\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99797:Expr_L9_C8", "label": "expression", "type": "expression", "loc": [9, 9], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L8_C4", "vector": [8, 2, 0.0552, 0.0061, 2, 0.52, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Simple 2\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L10_C4", "label": "underscore_name", "type": "function", "loc": [10, 11], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L4_C0", "vector": [2, 1, 0.0644, 0.0123, 1, 0.82, 0.25, 232, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "underscore_name", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def underscore_name(self):\n \"\"\"Underscore Name\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99797:Expr_L11_C8", "label": "expression", "type": "expression", "loc": [11, 11], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L10_C4", "vector": [8, 2, 0.0675, 0.0061, 2, 0.73, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Underscore Name\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L12_C4", "label": "underscore_name2_", "type": "function", "loc": [12, 13], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L4_C0", "vector": [2, 1, 0.0767, 0.0123, 1, 0.82, 0.3333, 506, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "underscore_name2_", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def underscore_name2_(self):\n \"\"\"Underscore Name2\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99797:Expr_L13_C8", "label": "expression", "type": "expression", "loc": [13, 13], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L12_C4", "vector": [8, 2, 0.0798, 0.0061, 2, 0.11, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Underscore Name2\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L14_C4", "label": "un_der__sco_r__e_3", "type": "function", "loc": [14, 15], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L4_C0", "vector": [2, 1, 0.089, 0.0123, 1, 0.82, 0.4167, 495, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "un_der__sco_r__e_3", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def un_der__sco_r__e_3(self):\n \"\"\"Un Der Sco R E 3\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99797:Expr_L15_C8", "label": "expression", "type": "expression", "loc": [15, 15], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L14_C4", "vector": [8, 2, 0.092, 0.0061, 2, 0.82, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Un Der Sco R E 3\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L16_C4", "label": "MiXeD_CAPS", "type": "function", "loc": [16, 17], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L4_C0", "vector": [2, 1, 0.1012, 0.0123, 1, 0.82, 0.5, 40, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "MiXeD_CAPS", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def MiXeD_CAPS(self):\n \"\"\"MiXeD CAPS\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99797:Expr_L17_C8", "label": "expression", "type": "expression", "loc": [17, 17], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L16_C4", "vector": [8, 2, 0.1043, 0.0061, 2, 0.47, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"MiXeD CAPS\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L18_C4", "label": "camelCase", "type": "function", "loc": [18, 19], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L4_C0", "vector": [2, 1, 0.1135, 0.0123, 1, 0.82, 0.5833, 684, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "camelCase", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def camelCase(self):\n \"\"\"Camel Case\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99797:Expr_L19_C8", "label": "expression", "type": "expression", "loc": [19, 19], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L18_C4", "vector": [8, 2, 0.1166, 0.0061, 2, 0.09, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Camel Case\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L20_C4", "label": "camelCase2", "type": "function", "loc": [20, 21], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L4_C0", "vector": [2, 1, 0.1258, 0.0123, 1, 0.82, 0.6667, 449, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "camelCase2", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def camelCase2(self):\n \"\"\"Camel Case 2\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99797:Expr_L21_C8", "label": "expression", "type": "expression", "loc": [21, 21], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L20_C4", "vector": [8, 2, 0.1288, 0.0061, 2, 0.38, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Camel Case 2\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L22_C4", "label": "mixedCAPSCamel", "type": "function", "loc": [22, 23], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L4_C0", "vector": [2, 1, 0.138, 0.0123, 1, 0.82, 0.75, 574, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "mixedCAPSCamel", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def mixedCAPSCamel(self):\n \"\"\"Mixed CAPS Camel\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99797:Expr_L23_C8", "label": "expression", "type": "expression", "loc": [23, 23], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L22_C4", "vector": [8, 2, 0.1411, 0.0061, 2, 0.86, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Mixed CAPS Camel\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L24_C4", "label": "camelCase_and_underscores_doesNot_work", "type": "function", "loc": [24, 25], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L4_C0", "vector": [2, 1, 0.1503, 0.0123, 1, 0.82, 0.8333, 387, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "camelCase_and_underscores_doesNot_work", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def camelCase_and_underscores_doesNot_work(self):\n \"\"\"CamelCase And Underscores DoesNot Work\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99797:Expr_L25_C8", "label": "expression", "type": "expression", "loc": [25, 25], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L24_C4", "vector": [8, 2, 0.1534, 0.0061, 2, 0.36, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"CamelCase And Underscores DoesNot Work\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L26_C4", "label": "_skipped1", "type": "function", "loc": [26, 27], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L4_C0", "vector": [2, 1, 0.1626, 0.0123, 1, 0.82, 0.9167, 642, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "_skipped1", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _skipped1(self):\n \"\"\"Starts with underscore\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99797:Expr_L27_C8", "label": "expression", "type": "expression", "loc": [27, 27], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L26_C4", "vector": [8, 2, 0.1656, 0.0061, 2, 0.89, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Starts with underscore\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99797:Assign_L28_C4", "label": "skipped2 =", "type": "assigned_variable", "loc": [28, 28], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L4_C0", "vector": [14, 1, 0.1718, 0.0061, 1, 0.82, 1.0, 383, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "skipped2", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " skipped2 = \"Not a function\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L31_C0", "label": "DocLibrary", "type": "class", "loc": [31, 46], "level": 0, "parent": null, "vector": [3, 0, 0.2362, 0.0982, 0, 0.66, 0.1538, 2, 0, 3, 0, 0, 0, 0, 0], "semantic": {"name": "DocLibrary", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class DocLibrary:\n handler_count = 3\n def no_doc(self): pass\n no_doc.expected_doc = ''\n no_doc.expected_shortdoc = ''\n def one_line_doc(self):\n \"\"\"One line doc\"\"\"\n one_line_doc.expected_doc = 'One line doc'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99797:Assign_L32_C4", "label": "handler_count =", "type": "assigned_variable", "loc": [32, 32], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L31_C0", "vector": [14, 1, 0.1963, 0.0061, 1, 0.49, 0.0, 947, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "handler_count", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " handler_count = 3"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L33_C4", "label": "no_doc", "type": "function", "loc": [33, 33], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L31_C0", "vector": [2, 1, 0.2025, 0.0061, 1, 0.49, 0.1111, 355, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "no_doc", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def no_doc(self): pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99797:Assign_L34_C4", "label": "no_doc.expected_doc =", "type": "assigned_variable", "loc": [34, 34], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L31_C0", "vector": [14, 1, 0.2086, 0.0061, 1, 0.49, 0.2222, 622, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "no_doc.expected_doc", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " no_doc.expected_doc = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99797:Assign_L35_C4", "label": "no_doc.expected_shortdoc =", "type": "assigned_variable", "loc": [35, 35], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L31_C0", "vector": [14, 1, 0.2147, 0.0061, 1, 0.49, 0.3333, 491, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "no_doc.expected_shortdoc", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " no_doc.expected_shortdoc = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L36_C4", "label": "one_line_doc", "type": "function", "loc": [36, 37], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L31_C0", "vector": [2, 1, 0.2239, 0.0123, 1, 0.49, 0.4444, 256, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "one_line_doc", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def one_line_doc(self):\n \"\"\"One line doc\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99797:Expr_L37_C8", "label": "expression", "type": "expression", "loc": [37, 37], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L36_C4", "vector": [8, 2, 0.227, 0.0061, 2, 0.49, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"One line doc\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99797:Assign_L38_C4", "label": "one_line_doc.expected_doc =", "type": "assigned_variable", "loc": [38, 38], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L31_C0", "vector": [14, 1, 0.2331, 0.0061, 1, 0.49, 0.5556, 130, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "one_line_doc.expected_doc", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " one_line_doc.expected_doc = 'One line doc'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99797:Assign_L39_C4", "label": "one_line_doc.expected_shortdoc =", "type": "assigned_variable", "loc": [39, 39], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L31_C0", "vector": [14, 1, 0.2393, 0.0061, 1, 0.49, 0.6667, 626, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "one_line_doc.expected_shortdoc", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " one_line_doc.expected_shortdoc = 'One line doc'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L40_C4", "label": "multiline_doc", "type": "function", "loc": [40, 44], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L31_C0", "vector": [2, 1, 0.2577, 0.0307, 1, 0.49, 0.7778, 30, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "multiline_doc", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def multiline_doc(self):\n \"\"\"Multiline doc.\n\n Spans multiple lines.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99797:Expr_L41_C8", "label": "expression", "type": "expression", "loc": [41, 44], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L40_C4", "vector": [8, 2, 0.2607, 0.0245, 2, 0.17, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Multiline doc.\n\n Spans multiple lines.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99797:Assign_L45_C4", "label": "multiline_doc.expected_doc =", "type": "assigned_variable", "loc": [45, 45], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L31_C0", "vector": [14, 1, 0.2761, 0.0061, 1, 0.49, 0.8889, 926, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "multiline_doc.expected_doc", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " multiline_doc.expected_doc = 'Multiline doc.\\n\\nSpans multiple lines.'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99797:Assign_L46_C4", "label": "multiline_doc.expected_shortdoc =", "type": "assigned_variable", "loc": [46, 46], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L31_C0", "vector": [14, 1, 0.2822, 0.0061, 1, 0.49, 1.0, 551, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "multiline_doc.expected_shortdoc", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " multiline_doc.expected_shortdoc = 'Multiline doc.'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L49_C0", "label": "ArgInfoLibrary", "type": "class", "loc": [49, 76], "level": 0, "parent": null, "vector": [3, 0, 0.3834, 0.1718, 0, 0.66, 0.2308, 283, 0, 11, 0, 0, 0, 0, 0], "semantic": {"name": "ArgInfoLibrary", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class ArgInfoLibrary:\n handler_count = 11\n def no_args(self):\n \"\"\"[], [], None\"\"\"\n # Argument inspection had a bug when there was args on function body\n # so better keep some of them around here.\n a=b=c=1\n def required1(self, one):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99797:Assign_L50_C4", "label": "handler_count =", "type": "assigned_variable", "loc": [50, 50], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L49_C0", "vector": [14, 1, 0.3067, 0.0061, 1, 0.06, 0.0, 947, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "handler_count", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " handler_count = 11"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L51_C4", "label": "no_args", "type": "function", "loc": [51, 55], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L49_C0", "vector": [2, 1, 0.3252, 0.0307, 1, 0.06, 0.0909, 951, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "no_args", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def no_args(self):\n \"\"\"[], [], None\"\"\"\n # Argument inspection had a bug when there was args on function body\n # so better keep some of them around here.\n a=b=c=1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99797:Expr_L52_C8", "label": "expression", "type": "expression", "loc": [52, 52], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L51_C4", "vector": [8, 2, 0.319, 0.0061, 2, 0.9, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"[], [], None\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99797:Assign_L55_C8", "label": "a =", "type": "assigned_variable", "loc": [55, 55], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L51_C4", "vector": [14, 2, 0.3374, 0.0061, 2, 0.9, 1.0, 475, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "a", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " a=b=c=1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L56_C4", "label": "required1", "type": "function", "loc": [56, 57], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L49_C0", "vector": [2, 1, 0.3466, 0.0123, 1, 0.06, 0.1818, 47, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "required1", "arg_names": ["self", "one"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def required1(self, one):\n \"\"\"['one',], [], None\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99797:Expr_L57_C8", "label": "expression", "type": "expression", "loc": [57, 57], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L56_C4", "vector": [8, 2, 0.3497, 0.0061, 2, 0.99, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"['one',], [], None\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L58_C4", "label": "required2", "type": "function", "loc": [58, 59], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L49_C0", "vector": [2, 1, 0.3589, 0.0123, 1, 0.06, 0.2727, 813, 0, 3, 0, 0, 0, 0, 0], "semantic": {"name": "required2", "arg_names": ["self", "one", "two"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def required2(self, one, two):\n \"\"\"['one','two'], [], None\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99797:Expr_L59_C8", "label": "expression", "type": "expression", "loc": [59, 59], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L58_C4", "vector": [8, 2, 0.362, 0.0061, 2, 0.95, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"['one','two'], [], None\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L60_C4", "label": "required9", "type": "function", "loc": [60, 62], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L49_C0", "vector": [2, 1, 0.3742, 0.0184, 1, 0.06, 0.3636, 309, 0, 10, 0, 0, 0, 0, 0], "semantic": {"name": "required9", "arg_names": ["self", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def required9(self, one, two, three, four, five, six, seven, eight, nine):\n \"\"\"['one','two','three','four','five','six','seven','eight','nine'],\\\n [], None\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99797:Expr_L61_C8", "label": "expression", "type": "expression", "loc": [61, 62], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L60_C4", "vector": [8, 2, 0.3773, 0.0123, 2, 0.9, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"['one','two','three','four','five','six','seven','eight','nine'],\\\n [], None\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L63_C4", "label": "default1", "type": "function", "loc": [63, 64], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L49_C0", "vector": [2, 1, 0.3896, 0.0123, 1, 0.06, 0.4545, 409, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "default1", "arg_names": ["self", "one"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def default1(self, one=1):\n \"\"\"['one'], [1], None\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99797:Expr_L64_C8", "label": "expression", "type": "expression", "loc": [64, 64], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L63_C4", "vector": [8, 2, 0.3926, 0.0061, 2, 0.97, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"['one'], [1], None\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L65_C4", "label": "default5", "type": "function", "loc": [65, 66], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L49_C0", "vector": [2, 1, 0.4018, 0.0123, 1, 0.06, 0.5455, 690, 0, 6, 0, 0, 0, 0, 0], "semantic": {"name": "default5", "arg_names": ["self", "one", "two", "three", "four", "five"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def default5(self, one='', two=None, three=3, four='huh', five=True):\n \"\"\"['one','two','three','four','five'], ['',None,3,'huh',True], None\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99797:Expr_L66_C8", "label": "expression", "type": "expression", "loc": [66, 66], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L65_C4", "vector": [8, 2, 0.4049, 0.0061, 2, 0.94, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"['one','two','three','four','five'], ['',None,3,'huh',True], None\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L67_C4", "label": "required1_default1", "type": "function", "loc": [67, 68], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L49_C0", "vector": [2, 1, 0.4141, 0.0123, 1, 0.06, 0.6364, 772, 0, 3, 0, 0, 0, 0, 0], "semantic": {"name": "required1_default1", "arg_names": ["self", "one", "two"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def required1_default1(self, one, two=''):\n \"\"\"['one','two'], [''], None\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99797:Expr_L68_C8", "label": "expression", "type": "expression", "loc": [68, 68], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L67_C4", "vector": [8, 2, 0.4172, 0.0061, 2, 0.98, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"['one','two'], [''], None\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L69_C4", "label": "required2_default3", "type": "function", "loc": [69, 70], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L49_C0", "vector": [2, 1, 0.4264, 0.0123, 1, 0.06, 0.7273, 880, 0, 6, 0, 0, 0, 0, 0], "semantic": {"name": "required2_default3", "arg_names": ["self", "one", "two", "three", "four", "five"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def required2_default3(self, one, two, three=3, four=4, five=5):\n \"\"\"['one','two','three','four','five'], [3,4,5], None\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99797:Expr_L70_C8", "label": "expression", "type": "expression", "loc": [70, 70], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L69_C4", "vector": [8, 2, 0.4294, 0.0061, 2, 0.86, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"['one','two','three','four','five'], [3,4,5], None\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L71_C4", "label": "varargs", "type": "function", "loc": [71, 72], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L49_C0", "vector": [2, 1, 0.4387, 0.0123, 1, 0.06, 0.8182, 501, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "varargs", "arg_names": ["self", "one"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def varargs(self,*one):\n \"\"\"[], [], 'one'\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99797:Expr_L72_C8", "label": "expression", "type": "expression", "loc": [72, 72], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L71_C4", "vector": [8, 2, 0.4417, 0.0061, 2, 0.56, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"[], [], 'one'\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L73_C4", "label": "required2_varargs", "type": "function", "loc": [73, 74], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L49_C0", "vector": [2, 1, 0.4509, 0.0123, 1, 0.06, 0.9091, 921, 0, 4, 0, 0, 0, 0, 0], "semantic": {"name": "required2_varargs", "arg_names": ["self", "one", "two", "three"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def required2_varargs(self, one, two, *three):\n \"\"\"['one','two'], [], 'three'\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99797:Expr_L74_C8", "label": "expression", "type": "expression", "loc": [74, 74], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L73_C4", "vector": [8, 2, 0.454, 0.0061, 2, 0.97, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"['one','two'], [], 'three'\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L75_C4", "label": "req4_def2_varargs", "type": "function", "loc": [75, 76], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L49_C0", "vector": [2, 1, 0.4632, 0.0123, 1, 0.06, 1.0, 112, 0, 8, 0, 0, 0, 0, 0], "semantic": {"name": "req4_def2_varargs", "arg_names": ["self", "one", "two", "three", "four", "five", "six", "seven"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def req4_def2_varargs(self, one, two, three, four, five=5, six=6, *seven):\n \"\"\"['one','two','three','four','five','six'], [5,6], 'seven'\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99797:Expr_L76_C8", "label": "expression", "type": "expression", "loc": [76, 76], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L75_C4", "vector": [8, 2, 0.4663, 0.0061, 2, 0.57, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"['one','two','three','four','five','six'], [5,6], 'seven'\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L79_C0", "label": "GetattrLibrary", "type": "class", "loc": [79, 89], "level": 0, "parent": null, "vector": [3, 0, 0.5153, 0.0675, 0, 0.66, 0.3077, 458, 0, 3, 0, 0, 0, 0, 0], "semantic": {"name": "GetattrLibrary", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class GetattrLibrary:\n handler_count = 3\n keyword_names = ['foo','bar','zap']\n def get_keyword_names(self):\n return self.keyword_names\n def __getattr__(self, name):\n def handler(*args):\n return name, args"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99797:Assign_L80_C4", "label": "handler_count =", "type": "assigned_variable", "loc": [80, 80], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L79_C0", "vector": [14, 1, 0.4908, 0.0061, 1, 0.23, 0.0, 947, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "handler_count", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " handler_count = 3"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99797:Assign_L81_C4", "label": "keyword_names =", "type": "assigned_variable", "loc": [81, 81], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L79_C0", "vector": [14, 1, 0.4969, 0.0061, 1, 0.23, 0.3333, 360, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "keyword_names", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " keyword_names = ['foo','bar','zap']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L82_C4", "label": "get_keyword_names", "type": "function", "loc": [82, 83], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L79_C0", "vector": [2, 1, 0.5061, 0.0123, 1, 0.23, 0.6667, 768, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "get_keyword_names", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_keyword_names(self):\n return self.keyword_names"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99797:Return_L83_C8", "label": "return", "type": "return", "loc": [83, 83], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L82_C4", "vector": [13, 2, 0.5092, 0.0061, 2, 0.88, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.keyword_names"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L84_C4", "label": "__getattr__", "type": "function", "loc": [84, 89], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L79_C0", "vector": [2, 1, 0.5307, 0.0368, 1, 0.23, 1.0, 210, 0, 2, 1, 0, 0, 0, 0], "semantic": {"name": "__getattr__", "arg_names": ["self", "name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __getattr__(self, name):\n def handler(*args):\n return name, args\n if name not in self.keyword_names:\n raise AttributeError\n return handler"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L85_C8", "label": "handler", "type": "function", "loc": [85, 86], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L84_C4", "vector": [2, 2, 0.5245, 0.0123, 2, 0.8, 0.0, 388, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "handler", "arg_names": ["args"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def handler(*args):\n return name, args"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99797:Return_L86_C12", "label": "return", "type": "return", "loc": [86, 86], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L85_C8", "vector": [13, 3, 0.5276, 0.0061, 3, 0.02, 0.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return name, args"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99797:If_L87_C8", "label": "if", "type": "if", "loc": [87, 88], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L84_C4", "vector": [4, 2, 0.5368, 0.0123, 2, 0.8, 0.5, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if name not in self.keyword_names:\n raise AttributeError"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99797:Return_L89_C8", "label": "return", "type": "return", "loc": [89, 89], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L84_C4", "vector": [13, 2, 0.546, 0.0061, 2, 0.8, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return handler"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L92_C0", "label": "SynonymLibrary", "type": "class", "loc": [92, 97], "level": 0, "parent": null, "vector": [3, 0, 0.5798, 0.0368, 0, 0.66, 0.3846, 400, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "SynonymLibrary", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class SynonymLibrary:\n handler_count = 3\n def handler(self):\n pass\n synonym_handler = handler\n another_synonym = handler"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99797:Assign_L93_C4", "label": "handler_count =", "type": "assigned_variable", "loc": [93, 93], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L92_C0", "vector": [14, 1, 0.5706, 0.0061, 1, 0.19, 0.0, 947, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "handler_count", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " handler_count = 3"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L94_C4", "label": "handler", "type": "function", "loc": [94, 95], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L92_C0", "vector": [2, 1, 0.5798, 0.0123, 1, 0.19, 0.3333, 388, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "handler", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def handler(self):\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99797:Assign_L96_C4", "label": "synonym_handler =", "type": "assigned_variable", "loc": [96, 96], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L92_C0", "vector": [14, 1, 0.589, 0.0061, 1, 0.19, 0.6667, 679, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "synonym_handler", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " synonym_handler = handler"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99797:Assign_L97_C4", "label": "another_synonym =", "type": "assigned_variable", "loc": [97, 97], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L92_C0", "vector": [14, 1, 0.5951, 0.0061, 1, 0.19, 1.0, 325, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "another_synonym", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " another_synonym = handler"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L100_C0", "label": "VersionLibrary", "type": "class", "loc": [100, 102], "level": 0, "parent": null, "vector": [3, 0, 0.6196, 0.0184, 0, 0.66, 0.4615, 345, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "VersionLibrary", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class VersionLibrary:\n ROBOT_LIBRARY_VERSION = '0.1'\n kw = lambda x:None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99797:Assign_L101_C4", "label": "ROBOT_LIBRARY_VERSION =", "type": "assigned_variable", "loc": [101, 101], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L100_C0", "vector": [14, 1, 0.6196, 0.0061, 1, 0.91, 0.0, 466, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "ROBOT_LIBRARY_VERSION", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ROBOT_LIBRARY_VERSION = '0.1'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99797:Assign_L102_C4", "label": "kw =", "type": "assigned_variable", "loc": [102, 102], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L100_C0", "vector": [14, 1, 0.6258, 0.0061, 1, 0.91, 1.0, 755, 9, 0, 0, 0, 0, 0, 0], "semantic": {"name": "kw", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " kw = lambda x:None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L105_C0", "label": "VersionObjectLibrary", "type": "class", "loc": [105, 112], "level": 0, "parent": null, "vector": [3, 0, 0.6656, 0.0491, 0, 0.66, 0.5385, 858, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "VersionObjectLibrary", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class VersionObjectLibrary:\n class _Version:\n def __init__(self, ver):\n self._ver = ver\n def __str__(self):\n return self._ver\n ROBOT_LIBRARY_VERSION = _Version('ver')\n kw = lambda x:None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L106_C4", "label": "_Version", "type": "class", "loc": [106, 110], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L105_C0", "vector": [3, 1, 0.6626, 0.0307, 1, 0.33, 0.0, 457, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "_Version", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " class _Version:\n def __init__(self, ver):\n self._ver = ver\n def __str__(self):\n return self._ver"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L107_C8", "label": "__init__", "type": "function", "loc": [107, 108], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L106_C4", "vector": [2, 2, 0.6595, 0.0123, 2, 0.47, 0.0, 555, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "ver"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, ver):\n self._ver = ver"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99797:Assign_L108_C12", "label": "self._ver =", "type": "assigned_variable", "loc": [108, 108], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L107_C8", "vector": [14, 3, 0.6626, 0.0061, 3, 0.82, 0.0, 78, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._ver", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._ver = ver"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L109_C8", "label": "__str__", "type": "function", "loc": [109, 110], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L106_C4", "vector": [2, 2, 0.6718, 0.0123, 2, 0.47, 1.0, 527, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "__str__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __str__(self):\n return self._ver"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99797:Return_L110_C12", "label": "return", "type": "return", "loc": [110, 110], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L109_C8", "vector": [13, 3, 0.6748, 0.0061, 3, 0.35, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._ver"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99797:Assign_L111_C4", "label": "ROBOT_LIBRARY_VERSION = _Version()", "type": "assigned_variable", "loc": [111, 111], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L105_C0", "vector": [14, 1, 0.681, 0.0061, 1, 0.33, 0.5, 466, 3, 1, 0, 0, 457, 10, 1], "semantic": {"name": "ROBOT_LIBRARY_VERSION", "arg_names": [], "import_names": [], "rhs_call_name": "_Version", "annotation": ""}, "snippet": " ROBOT_LIBRARY_VERSION = _Version('ver')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99797:Assign_L112_C4", "label": "kw =", "type": "assigned_variable", "loc": [112, 112], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L105_C0", "vector": [14, 1, 0.6871, 0.0061, 1, 0.33, 1.0, 755, 9, 0, 0, 0, 0, 0, 0], "semantic": {"name": "kw", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " kw = lambda x:None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L116_C0", "label": "RecordingLibrary", "type": "class", "loc": [116, 126], "level": 0, "parent": null, "vector": [3, 0, 0.7423, 0.0675, 0, 0.66, 0.6154, 674, 0, 3, 0, 0, 0, 0, 0], "semantic": {"name": "RecordingLibrary", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class RecordingLibrary:\n ROBOT_LIBRARY_SCOPE = 'GLOBAL'\n def __init__(self):\n self.calls_to_getattr = 0\n def kw(self):\n pass\n def __getattr__(self, name):\n self.calls_to_getattr += 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99797:Assign_L117_C4", "label": "ROBOT_LIBRARY_SCOPE =", "type": "assigned_variable", "loc": [117, 117], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L116_C0", "vector": [14, 1, 0.7178, 0.0061, 1, 0.45, 0.0, 305, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "ROBOT_LIBRARY_SCOPE", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ROBOT_LIBRARY_SCOPE = 'GLOBAL'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L118_C4", "label": "__init__", "type": "function", "loc": [118, 119], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L116_C0", "vector": [2, 1, 0.727, 0.0123, 1, 0.45, 0.3333, 555, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self):\n self.calls_to_getattr = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99797:Assign_L119_C8", "label": "self.calls_to_getattr =", "type": "assigned_variable", "loc": [119, 119], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L118_C4", "vector": [14, 2, 0.7301, 0.0061, 2, 0.54, 0.0, 931, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.calls_to_getattr", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.calls_to_getattr = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L120_C4", "label": "kw", "type": "function", "loc": [120, 121], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L116_C0", "vector": [2, 1, 0.7393, 0.0123, 1, 0.45, 0.6667, 755, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "kw", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def kw(self):\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L122_C4", "label": "__getattr__", "type": "function", "loc": [122, 126], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L116_C0", "vector": [2, 1, 0.7607, 0.0307, 1, 0.45, 1.0, 210, 0, 2, 1, 0, 0, 0, 0], "semantic": {"name": "__getattr__", "arg_names": ["self", "name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __getattr__(self, name):\n self.calls_to_getattr += 1\n if name != 'kw':\n raise AttributeError\n return self.kw"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99797:If_L124_C8", "label": "if", "type": "if", "loc": [124, 125], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L122_C4", "vector": [4, 2, 0.7638, 0.0123, 2, 0.25, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if name != 'kw':\n raise AttributeError"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99797:Return_L126_C8", "label": "return", "type": "return", "loc": [126, 126], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L122_C4", "vector": [13, 2, 0.773, 0.0061, 2, 0.25, 1.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.kw"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L129_C0", "label": "ArgDocDynamicLibrary", "type": "class", "loc": [129, 144], "level": 0, "parent": null, "vector": [3, 0, 0.8374, 0.0982, 0, 0.66, 0.6923, 148, 0, 5, 0, 0, 0, 0, 5], "semantic": {"name": "ArgDocDynamicLibrary", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class ArgDocDynamicLibrary:\n def __init__(self):\n kws = [('No Arg', []),\n ('One Arg', ['arg']),\n ('One or Two Args', ['arg', 'darg=dvalue']),\n ('Many Args', ['*args'])]\n self._keywords = dict((name, _KeywordInfo(name, argspec))\n for name, argspec in kws)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L130_C4", "label": "__init__", "type": "function", "loc": [130, 136], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L129_C0", "vector": [2, 1, 0.816, 0.0429, 1, 0.4, 0.0, 555, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self):\n kws = [('No Arg', []),\n ('One Arg', ['arg']),\n ('One or Two Args', ['arg', 'darg=dvalue']),\n ('Many Args', ['*args'])]\n self._keywords = dict((name, _KeywordInfo(name, argspec))\n for name, argspec in kws)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99797:Assign_L131_C8", "label": "kws =", "type": "assigned_variable", "loc": [131, 134], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L130_C4", "vector": [14, 2, 0.8129, 0.0245, 2, 0.28, 0.0, 47, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "kws", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " kws = [('No Arg', []),\n ('One Arg', ['arg']),\n ('One or Two Args', ['arg', 'darg=dvalue']),\n ('Many Args', ['*args'])]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99797:Assign_L135_C8", "label": "self._keywords = dict()", "type": "assigned_variable", "loc": [135, 136], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L130_C4", "vector": [14, 2, 0.8313, 0.0123, 2, 0.28, 1.0, 404, 3, 1, 0, 0, 827, 10, 2], "semantic": {"name": "self._keywords", "arg_names": [], "import_names": [], "rhs_call_name": "dict", "annotation": ""}, "snippet": " self._keywords = dict((name, _KeywordInfo(name, argspec))\n for name, argspec in kws)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L137_C4", "label": "get_keyword_names", "type": "function", "loc": [137, 138], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L129_C0", "vector": [2, 1, 0.8436, 0.0123, 1, 0.4, 0.25, 768, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "get_keyword_names", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_keyword_names(self):\n return sorted(self._keywords.keys())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99797:Return_L138_C8", "label": "return", "type": "return", "loc": [138, 138], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L137_C4", "vector": [13, 2, 0.8466, 0.0061, 2, 0.51, 0.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return sorted(self._keywords.keys())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L139_C4", "label": "run_keyword", "type": "function", "loc": [139, 140], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L129_C0", "vector": [2, 1, 0.8558, 0.0123, 1, 0.4, 0.5, 458, 0, 3, 0, 0, 0, 0, 1], "semantic": {"name": "run_keyword", "arg_names": ["self", "name", "args"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def run_keyword(self, name, *args):\n print('*INFO* Executed keyword %s with arguments %s' % (name, args))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99797:Expr_L140_C8", "label": "print()", "type": "expression", "loc": [140, 140], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L139_C4", "vector": [8, 2, 0.8589, 0.0061, 2, 0.13, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('*INFO* Executed keyword %s with arguments %s' % (name, args))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L141_C4", "label": "get_keyword_documentation", "type": "function", "loc": [141, 142], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L129_C0", "vector": [2, 1, 0.8681, 0.0123, 1, 0.4, 0.75, 886, 0, 2, 1, 0, 0, 0, 0], "semantic": {"name": "get_keyword_documentation", "arg_names": ["self", "name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_keyword_documentation(self, name):\n return self._keywords[name].doc"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99797:Return_L142_C8", "label": "return", "type": "return", "loc": [142, 142], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L141_C4", "vector": [13, 2, 0.8712, 0.0061, 2, 0.35, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._keywords[name].doc"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L143_C4", "label": "get_keyword_arguments", "type": "function", "loc": [143, 144], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L129_C0", "vector": [2, 1, 0.8804, 0.0123, 1, 0.4, 1.0, 234, 0, 2, 1, 0, 0, 0, 0], "semantic": {"name": "get_keyword_arguments", "arg_names": ["self", "name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_keyword_arguments(self, name):\n return self._keywords[name].argspec"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99797:Return_L144_C8", "label": "return", "type": "return", "loc": [144, 144], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L143_C4", "vector": [13, 2, 0.8834, 0.0061, 2, 0.47, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._keywords[name].argspec"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L146_C0", "label": "_KeywordInfo", "type": "class", "loc": [146, 150], "level": 0, "parent": null, "vector": [3, 0, 0.908, 0.0307, 0, 0.66, 0.7692, 34, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "_KeywordInfo", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class _KeywordInfo:\n doc_template = 'Keyword documentation for %s'\n def __init__(self, name, argspec):\n self.doc = self.doc_template % name\n self.argspec = argspec"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99797:Assign_L147_C4", "label": "doc_template =", "type": "assigned_variable", "loc": [147, 147], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L146_C0", "vector": [14, 1, 0.9018, 0.0061, 1, 0.78, 0.0, 81, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "doc_template", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " doc_template = 'Keyword documentation for %s'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L148_C4", "label": "__init__", "type": "function", "loc": [148, 150], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L146_C0", "vector": [2, 1, 0.9141, 0.0184, 1, 0.78, 1.0, 555, 0, 3, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "name", "argspec"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, name, argspec):\n self.doc = self.doc_template % name\n self.argspec = argspec"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99797:Assign_L149_C8", "label": "self.doc =", "type": "assigned_variable", "loc": [149, 149], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L148_C4", "vector": [14, 2, 0.9141, 0.0061, 2, 0.68, 0.0, 114, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.doc", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.doc = self.doc_template % name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99797:Assign_L150_C8", "label": "self.argspec =", "type": "assigned_variable", "loc": [150, 150], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L148_C4", "vector": [14, 2, 0.9202, 0.0061, 2, 0.68, 1.0, 377, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.argspec", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.argspec = argspec"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L153_C0", "label": "InvalidGetDocDynamicLibrary", "type": "class", "loc": [153, 155], "level": 0, "parent": null, "vector": [3, 0, 0.9448, 0.0184, 0, 0.66, 0.8462, 569, 0, 1, 0, 0, 148, 0, 0], "semantic": {"name": "InvalidGetDocDynamicLibrary", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class InvalidGetDocDynamicLibrary(ArgDocDynamicLibrary):\n def get_keyword_documentation(self, name, invalid_arg):\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L154_C4", "label": "get_keyword_documentation", "type": "function", "loc": [154, 155], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L153_C0", "vector": [2, 1, 0.9479, 0.0123, 1, 0.66, 0.0, 886, 0, 3, 0, 0, 0, 0, 0], "semantic": {"name": "get_keyword_documentation", "arg_names": ["self", "name", "invalid_arg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_keyword_documentation(self, name, invalid_arg):\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L157_C0", "label": "InvalidGetArgsDynamicLibrary", "type": "class", "loc": [157, 159], "level": 0, "parent": null, "vector": [3, 0, 0.9693, 0.0184, 0, 0.66, 0.9231, 920, 0, 1, 0, 0, 148, 0, 0], "semantic": {"name": "InvalidGetArgsDynamicLibrary", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class InvalidGetArgsDynamicLibrary(ArgDocDynamicLibrary):\n def get_keyword_arguments(self, name):\n 1/0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L158_C4", "label": "get_keyword_arguments", "type": "function", "loc": [158, 159], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L157_C0", "vector": [2, 1, 0.9724, 0.0123, 1, 0.06, 0.0, 234, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "get_keyword_arguments", "arg_names": ["self", "name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_keyword_arguments(self, name):\n 1/0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99797:Expr_L159_C8", "label": "expression", "type": "expression", "loc": [159, 159], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L158_C4", "vector": [8, 2, 0.9755, 0.0061, 2, 0.56, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " 1/0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L161_C0", "label": "InvalidAttributeDynamicLibrary", "type": "class", "loc": [161, 163], "level": 0, "parent": null, "vector": [3, 0, 0.9939, 0.0184, 0, 0.66, 1.0, 887, 0, 0, 0, 0, 148, 0, 0], "semantic": {"name": "InvalidAttributeDynamicLibrary", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class InvalidAttributeDynamicLibrary(ArgDocDynamicLibrary):\n get_keyword_documentation = True\n get_keyword_arguments = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99797:Assign_L162_C4", "label": "get_keyword_documentation =", "type": "assigned_variable", "loc": [162, 162], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L161_C0", "vector": [14, 1, 0.9939, 0.0061, 1, 0.78, 0.0, 886, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "get_keyword_documentation", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " get_keyword_documentation = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99797:Assign_L163_C4", "label": "get_keyword_arguments =", "type": "assigned_variable", "loc": [163, 163], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L161_C0", "vector": [14, 1, 1.0, 0.0061, 1, 0.78, 1.0, 234, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "get_keyword_arguments", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " get_keyword_arguments = False"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99797:Assign_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L6_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99797:Expr_L7_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L8_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99797:Expr_L9_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L10_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99797:Expr_L11_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L12_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99797:Expr_L13_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L14_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99797:Expr_L15_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L16_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99797:Expr_L17_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99797:Expr_L19_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L20_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99797:Expr_L21_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L22_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99797:Expr_L23_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L24_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99797:Expr_L25_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L26_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L26_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99797:Expr_L27_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99797:Assign_L28_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L31_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99797:Assign_L32_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L31_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L33_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L31_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99797:Assign_L34_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L31_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99797:Assign_L35_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L31_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L36_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L36_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99797:Expr_L37_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L31_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99797:Assign_L38_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L31_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99797:Assign_L39_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L31_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L40_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L40_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99797:Expr_L41_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L31_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99797:Assign_L45_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L31_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99797:Assign_L46_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L49_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99797:Assign_L50_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L49_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L51_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L51_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99797:Expr_L52_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L51_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99797:Assign_L55_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L49_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L56_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L56_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99797:Expr_L57_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L49_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L58_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L58_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99797:Expr_L59_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L49_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L60_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L60_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99797:Expr_L61_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L49_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L63_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99797:Expr_L64_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L49_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L65_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L65_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99797:Expr_L66_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L49_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L67_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L67_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99797:Expr_L68_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L49_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L69_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L69_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99797:Expr_L70_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L49_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L71_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L71_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99797:Expr_L72_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L49_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L73_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L73_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99797:Expr_L74_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L49_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L75_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L75_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99797:Expr_L76_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L79_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99797:Assign_L80_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L79_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99797:Assign_L81_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L79_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L82_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L82_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99797:Return_L83_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L79_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L84_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L84_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L85_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L85_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99797:Return_L86_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L84_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99797:If_L87_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L84_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99797:Return_L89_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L92_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99797:Assign_L93_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L92_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L94_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L92_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99797:Assign_L96_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L92_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99797:Assign_L97_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L100_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99797:Assign_L101_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L100_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99797:Assign_L102_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L105_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L106_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L106_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L107_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L107_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99797:Assign_L108_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L106_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L109_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L109_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99797:Return_L110_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L105_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99797:Assign_L111_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L105_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99797:Assign_L112_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L116_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99797:Assign_L117_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L116_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L118_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L118_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99797:Assign_L119_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L116_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L120_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L116_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L122_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L122_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99797:If_L124_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L122_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99797:Return_L126_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L129_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L130_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L130_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99797:Assign_L131_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L130_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99797:Assign_L135_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L129_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L137_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L137_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99797:Return_L138_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L129_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L139_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L139_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99797:Expr_L140_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L129_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L141_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L141_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99797:Return_L142_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L129_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L143_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L143_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99797:Return_L144_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L146_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99797:Assign_L147_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L146_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L148_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L148_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99797:Assign_L149_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L148_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99797:Assign_L150_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L153_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L154_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L157_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L158_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99797:FunctionDef_L158_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99797:Expr_L159_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L161_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99797:Assign_L162_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99797:ClassDef_L161_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99797:Assign_L163_C4"}] |
class NewStyleClassLibrary(object):
def mirror(self, arg):
arg = list(arg)
arg.reverse()
return ''.join(arg)
def _property_getter(self):
raise SystemExit('This should not be called, ever!!!')
prop = property(_property_getter)
class NewStyleClassArgsLibrary(object):
def __init__(self, param):
self.get_param = lambda self: param
class _MyMetaClass(type):
def __new__(cls, name, bases, ns):
ns['kw_created_by_metaclass'] = lambda self, arg: arg.upper()
return type.__new__(cls, name, bases, ns)
def method_in_metaclass(cls):
pass
class MetaClassLibrary(object):
__metaclass__ = _MyMetaClass
def greet(self, name):
return 'Hello %s!' % name
| ajibawa-2023/Python-Code-Large/train/row_99798 | 19 | 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_99798:ClassDef_L1_C0", "label": "NewStyleClassLibrary", "type": "class", "loc": [1, 11], "level": 0, "parent": null, "vector": [3, 0, 0.1765, 0.3235, 0, 0.66, 0.0, 12, 0, 2, 0, 0, 186, 0, 5], "semantic": {"name": "NewStyleClassLibrary", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class NewStyleClassLibrary(object):\n \n def mirror(self, arg):\n arg = list(arg)\n arg.reverse()\n return ''.join(arg)\n\n def _property_getter(self):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99798:FunctionDef_L3_C4", "label": "mirror", "type": "function", "loc": [3, 6], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99798:ClassDef_L1_C0", "vector": [2, 1, 0.1324, 0.1176, 1, 0.54, 0.0, 697, 0, 2, 1, 0, 0, 0, 3], "semantic": {"name": "mirror", "arg_names": ["self", "arg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def mirror(self, arg):\n arg = list(arg)\n arg.reverse()\n return ''.join(arg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99798:Assign_L4_C8", "label": "arg = list()", "type": "assigned_variable", "loc": [4, 4], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99798:FunctionDef_L3_C4", "vector": [14, 2, 0.1176, 0.0294, 2, 0.31, 0.0, 447, 3, 1, 0, 0, 430, 10, 1], "semantic": {"name": "arg", "arg_names": [], "import_names": [], "rhs_call_name": "list", "annotation": ""}, "snippet": " arg = list(arg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99798:Expr_L5_C8", "label": "reverse()", "type": "expression", "loc": [5, 5], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99798:FunctionDef_L3_C4", "vector": [8, 2, 0.1471, 0.0294, 2, 0.31, 0.5, 109, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "reverse", "arg_names": [], "import_names": [], "rhs_call_name": "reverse", "annotation": ""}, "snippet": " arg.reverse()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99798:Return_L6_C8", "label": "return", "type": "return", "loc": [6, 6], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99798:FunctionDef_L3_C4", "vector": [13, 2, 0.1765, 0.0294, 2, 0.31, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ''.join(arg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99798:FunctionDef_L8_C4", "label": "_property_getter", "type": "function", "loc": [8, 9], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99798:ClassDef_L1_C0", "vector": [2, 1, 0.25, 0.0588, 1, 0.54, 0.5, 825, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_property_getter", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _property_getter(self):\n raise SystemExit('This should not be called, ever!!!')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99798:Assign_L11_C4", "label": "prop = property()", "type": "assigned_variable", "loc": [11, 11], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99798:ClassDef_L1_C0", "vector": [14, 1, 0.3235, 0.0294, 1, 0.54, 1.0, 17, 3, 1, 0, 0, 244, 10, 1], "semantic": {"name": "prop", "arg_names": [], "import_names": [], "rhs_call_name": "property", "annotation": ""}, "snippet": " prop = property(_property_getter)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99798:ClassDef_L14_C0", "label": "NewStyleClassArgsLibrary", "type": "class", "loc": [14, 17], "level": 0, "parent": null, "vector": [3, 0, 0.4559, 0.1176, 0, 0.66, 0.3333, 391, 0, 1, 0, 0, 186, 0, 0], "semantic": {"name": "NewStyleClassArgsLibrary", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class NewStyleClassArgsLibrary(object):\n \n def __init__(self, param):\n self.get_param = lambda self: param"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99798:FunctionDef_L16_C4", "label": "__init__", "type": "function", "loc": [16, 17], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99798:ClassDef_L14_C0", "vector": [2, 1, 0.4853, 0.0588, 1, 0.47, 0.0, 555, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "param"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, param):\n self.get_param = lambda self: param"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99798:Assign_L17_C8", "label": "self.get_param =", "type": "assigned_variable", "loc": [17, 17], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99798:FunctionDef_L16_C4", "vector": [14, 2, 0.5, 0.0294, 2, 0.46, 0.0, 311, 9, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.get_param", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.get_param = lambda self: param"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99798:ClassDef_L20_C0", "label": "_MyMetaClass", "type": "class", "loc": [20, 27], "level": 0, "parent": null, "vector": [3, 0, 0.6912, 0.2353, 0, 0.66, 0.6667, 88, 0, 2, 0, 0, 801, 0, 2], "semantic": {"name": "_MyMetaClass", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class _MyMetaClass(type):\n \n def __new__(cls, name, bases, ns):\n ns['kw_created_by_metaclass'] = lambda self, arg: arg.upper()\n return type.__new__(cls, name, bases, ns)\n\n def method_in_metaclass(cls):\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99798:FunctionDef_L22_C4", "label": "__new__", "type": "function", "loc": [22, 24], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99798:ClassDef_L20_C0", "vector": [2, 1, 0.6765, 0.0882, 1, 0.9, 0.0, 42, 0, 4, 1, 0, 0, 0, 2], "semantic": {"name": "__new__", "arg_names": ["cls", "name", "bases", "ns"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __new__(cls, name, bases, ns):\n ns['kw_created_by_metaclass'] = lambda self, arg: arg.upper()\n return type.__new__(cls, name, bases, ns)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99798:Assign_L23_C8", "label": "assign", "type": "assigned_variable", "loc": [23, 23], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99798:FunctionDef_L22_C4", "vector": [14, 2, 0.6765, 0.0294, 2, 0.53, 0.0, 0, 9, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ns['kw_created_by_metaclass'] = lambda self, arg: arg.upper()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99798:Return_L24_C8", "label": "return", "type": "return", "loc": [24, 24], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99798:FunctionDef_L22_C4", "vector": [13, 2, 0.7059, 0.0294, 2, 0.53, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return type.__new__(cls, name, bases, ns)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99798:FunctionDef_L26_C4", "label": "method_in_metaclass", "type": "function", "loc": [26, 27], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99798:ClassDef_L20_C0", "vector": [2, 1, 0.7794, 0.0588, 1, 0.9, 1.0, 662, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "method_in_metaclass", "arg_names": ["cls"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def method_in_metaclass(cls):\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99798:ClassDef_L30_C0", "label": "MetaClassLibrary", "type": "class", "loc": [30, 34], "level": 0, "parent": null, "vector": [3, 0, 0.9412, 0.1471, 0, 0.66, 1.0, 483, 0, 1, 0, 0, 186, 0, 0], "semantic": {"name": "MetaClassLibrary", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class MetaClassLibrary(object):\n __metaclass__ = _MyMetaClass\n\n def greet(self, name):\n return 'Hello %s!' % name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99798:Assign_L31_C4", "label": "__metaclass__ =", "type": "assigned_variable", "loc": [31, 31], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99798:ClassDef_L30_C0", "vector": [14, 1, 0.9118, 0.0294, 1, 0.58, 0.0, 203, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "__metaclass__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " __metaclass__ = _MyMetaClass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99798:FunctionDef_L33_C4", "label": "greet", "type": "function", "loc": [33, 34], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99798:ClassDef_L30_C0", "vector": [2, 1, 0.9853, 0.0588, 1, 0.58, 1.0, 81, 0, 2, 1, 0, 0, 0, 0], "semantic": {"name": "greet", "arg_names": ["self", "name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def greet(self, name):\n return 'Hello %s!' % name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99798:Return_L34_C8", "label": "return", "type": "return", "loc": [34, 34], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99798:FunctionDef_L33_C4", "vector": [13, 2, 1.0, 0.0294, 2, 0.99, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 'Hello %s!' % name"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99798:ClassDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99798:FunctionDef_L3_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99798:FunctionDef_L3_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99798:Assign_L4_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99798:FunctionDef_L3_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99798:Expr_L5_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99798:FunctionDef_L3_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99798:Return_L6_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99798:ClassDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99798:FunctionDef_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99798:ClassDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99798:Assign_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99798:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99798:FunctionDef_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99798:FunctionDef_L16_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99798:Assign_L17_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99798:ClassDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99798:FunctionDef_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99798:FunctionDef_L22_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99798:Assign_L23_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99798:FunctionDef_L22_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99798:Return_L24_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99798:ClassDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99798:FunctionDef_L26_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99798:ClassDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99798:Assign_L31_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99798:ClassDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99798:FunctionDef_L33_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99798:FunctionDef_L33_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99798:Return_L34_C8"}] |
class LibClass1:
def verify_libclass1(self):
return 'LibClass 1 works'
class LibClass2:
def verify_libclass2(self):
return 'LibClass 2 works also'
| ajibawa-2023/Python-Code-Large/train/row_99799 | 6 | 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_99799:ClassDef_L1_C0", "label": "LibClass1", "type": "class", "loc": [1, 4], "level": 0, "parent": null, "vector": [3, 0, 0.2273, 0.3636, 0, 0.66, 0.0, 529, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "LibClass1", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class LibClass1:\n \n def verify_libclass1(self):\n return 'LibClass 1 works'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99799:FunctionDef_L3_C4", "label": "verify_libclass1", "type": "function", "loc": [3, 4], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99799:ClassDef_L1_C0", "vector": [2, 1, 0.3182, 0.1818, 1, 0.82, 0.0, 99, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "verify_libclass1", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def verify_libclass1(self):\n return 'LibClass 1 works'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99799:Return_L4_C8", "label": "return", "type": "return", "loc": [4, 4], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99799:FunctionDef_L3_C4", "vector": [13, 2, 0.3636, 0.0909, 2, 0.32, 0.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 'LibClass 1 works'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99799:ClassDef_L7_C0", "label": "LibClass2", "type": "class", "loc": [7, 10], "level": 0, "parent": null, "vector": [3, 0, 0.7727, 0.3636, 0, 0.66, 1.0, 228, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "LibClass2", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class LibClass2:\n\n def verify_libclass2(self):\n return 'LibClass 2 works also'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99799:FunctionDef_L9_C4", "label": "verify_libclass2", "type": "function", "loc": [9, 10], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99799:ClassDef_L7_C0", "vector": [2, 1, 0.8636, 0.1818, 1, 0.52, 0.0, 640, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "verify_libclass2", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def verify_libclass2(self):\n return 'LibClass 2 works also'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99799:Return_L10_C8", "label": "return", "type": "return", "loc": [10, 10], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99799:FunctionDef_L9_C4", "vector": [13, 2, 0.9091, 0.0909, 2, 0.43, 0.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 'LibClass 2 works also'"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99799:ClassDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99799:FunctionDef_L3_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99799:FunctionDef_L3_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99799:Return_L4_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99799:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99799:FunctionDef_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99799:FunctionDef_L9_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99799:Return_L10_C8"}] |
class FatalCatastrophyException(RuntimeError):
ROBOT_EXIT_ON_FAILURE = True
class ContinuableApocalypseException(RuntimeError):
ROBOT_CONTINUE_ON_FAILURE = True
def exit_on_failure():
raise FatalCatastrophyException()
def raise_continuable_failure(msg='Can be continued'):
raise ContinuableApocalypseException(msg)
| ajibawa-2023/Python-Code-Large/train/row_99800 | 6 | 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_99800:ClassDef_L1_C0", "label": "FatalCatastrophyException", "type": "class", "loc": [1, 2], "level": 0, "parent": null, "vector": [3, 0, 0.1364, 0.1818, 0, 0.66, 0.0, 572, 0, 0, 0, 0, 178, 0, 0], "semantic": {"name": "FatalCatastrophyException", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class FatalCatastrophyException(RuntimeError):\n ROBOT_EXIT_ON_FAILURE = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99800:Assign_L2_C4", "label": "ROBOT_EXIT_ON_FAILURE =", "type": "assigned_variable", "loc": [2, 2], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99800:ClassDef_L1_C0", "vector": [14, 1, 0.1818, 0.0909, 1, 0.31, 0.0, 675, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "ROBOT_EXIT_ON_FAILURE", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ROBOT_EXIT_ON_FAILURE = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99800:ClassDef_L4_C0", "label": "ContinuableApocalypseException", "type": "class", "loc": [4, 5], "level": 0, "parent": null, "vector": [3, 0, 0.4091, 0.1818, 0, 0.66, 0.3333, 379, 0, 0, 0, 0, 178, 0, 0], "semantic": {"name": "ContinuableApocalypseException", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class ContinuableApocalypseException(RuntimeError):\n ROBOT_CONTINUE_ON_FAILURE = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99800:Assign_L5_C4", "label": "ROBOT_CONTINUE_ON_FAILURE =", "type": "assigned_variable", "loc": [5, 5], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99800:ClassDef_L4_C0", "vector": [14, 1, 0.4545, 0.0909, 1, 0.34, 0.0, 113, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "ROBOT_CONTINUE_ON_FAILURE", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ROBOT_CONTINUE_ON_FAILURE = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99800:FunctionDef_L7_C0", "label": "exit_on_failure", "type": "function", "loc": [7, 8], "level": 0, "parent": null, "vector": [2, 0, 0.6818, 0.1818, 0, 0.66, 0.6667, 378, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "exit_on_failure", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def exit_on_failure():\n raise FatalCatastrophyException()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99800:FunctionDef_L10_C0", "label": "raise_continuable_failure", "type": "function", "loc": [10, 11], "level": 0, "parent": null, "vector": [2, 0, 0.9545, 0.1818, 0, 0.66, 1.0, 432, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "raise_continuable_failure", "arg_names": ["msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def raise_continuable_failure(msg='Can be continued'):\n raise ContinuableApocalypseException(msg)"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99800:ClassDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99800:Assign_L2_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99800:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99800:Assign_L5_C4"}] |
ROBOT_LIBRARY_SCOPE = 'Test Suite' # this should be ignored
__version__ = 'test' # this should be used as version of this library
def passing():
pass
def failing():
raise AssertionError('This is a failing keyword from module library')
def logging():
print 'Hello from module library'
print '*WARN* WARNING!'
def returning():
return 'Hello from module library'
def argument(arg):
assert arg == 'Hello', "Expected 'Hello', got '%s'" % arg
def many_arguments(arg1, arg2, arg3):
assert arg1 == arg2 == arg3, ("All arguments should have been equal, got: "
"%s, %s and %s") % (arg1, arg2, arg3)
def default_arguments(arg1, arg2='Hi', arg3='Hello'):
many_arguments(arg1, arg2, arg3)
def variable_arguments(*args):
return sum([int(arg) for arg in args])
attribute = 'This is not a keyword!'
class NotLibrary:
def two_arguments(self, arg1, arg2):
msg = "Arguments should have been unequal, both were '%s'" % arg1
assert arg1 != arg2, msg
def not_keyword(self):
pass
notlib = NotLibrary()
two_arguments_from_class = notlib.two_arguments
lambda_keyword = lambda arg: int(arg) + 1
lambda_keyword_with_two_args = lambda x, y: int(x) / int(y)
def _not_keyword():
pass
def module_library():
return "It should be OK to have an attribute with same name as the module"
| ajibawa-2023/Python-Code-Large/train/row_99801 | 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_99801:Assign_L1_C0", "label": "ROBOT_LIBRARY_SCOPE =", "type": "assigned_variable", "loc": [1, 1], "level": 0, "parent": null, "vector": [14, 0, 0.0185, 0.0185, 0, 0.66, 0.0, 305, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "ROBOT_LIBRARY_SCOPE", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "ROBOT_LIBRARY_SCOPE = 'Test Suite' # this should be ignored"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99801:Assign_L2_C0", "label": "__version__ =", "type": "assigned_variable", "loc": [2, 2], "level": 0, "parent": null, "vector": [14, 0, 0.037, 0.0185, 0, 0.66, 0.0588, 162, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__version__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "__version__ = 'test' # this should be used as version of this library"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99801:FunctionDef_L5_C0", "label": "passing", "type": "function", "loc": [5, 6], "level": 0, "parent": null, "vector": [2, 0, 0.1019, 0.037, 0, 0.66, 0.1176, 50, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "passing", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def passing():\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99801:FunctionDef_L8_C0", "label": "failing", "type": "function", "loc": [8, 9], "level": 0, "parent": null, "vector": [2, 0, 0.1574, 0.037, 0, 0.66, 0.1765, 615, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "failing", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def failing():\n raise AssertionError('This is a failing keyword from module library')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99801:FunctionDef_L11_C0", "label": "logging", "type": "function", "loc": [11, 13], "level": 0, "parent": null, "vector": [2, 0, 0.2222, 0.0556, 0, 0.66, 0.2353, 715, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "logging", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def logging():\n print('Hello from module library')\n print('*WARN* WARNING!')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99801:Expr_L12_C4", "label": "print()", "type": "expression", "loc": [12, 12], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99801:FunctionDef_L11_C0", "vector": [8, 1, 0.2222, 0.0185, 1, 0.74, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Hello from module library')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99801:Expr_L13_C4", "label": "print()", "type": "expression", "loc": [13, 13], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99801:FunctionDef_L11_C0", "vector": [8, 1, 0.2407, 0.0185, 1, 0.74, 1.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('*WARN* WARNING!')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99801:FunctionDef_L15_C0", "label": "returning", "type": "function", "loc": [15, 16], "level": 0, "parent": null, "vector": [2, 0, 0.287, 0.037, 0, 0.66, 0.2941, 544, 0, 0, 1, 0, 0, 0, 0], "semantic": {"name": "returning", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def returning():\n return 'Hello from module library'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99801:Return_L16_C4", "label": "return", "type": "return", "loc": [16, 16], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99801:FunctionDef_L15_C0", "vector": [13, 1, 0.2963, 0.0185, 1, 0.11, 0.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 'Hello from module library'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99801:FunctionDef_L18_C0", "label": "argument", "type": "function", "loc": [18, 19], "level": 0, "parent": null, "vector": [2, 0, 0.3426, 0.037, 0, 0.66, 0.3529, 452, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "argument", "arg_names": ["arg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def argument(arg):\n assert arg == 'Hello', \"Expected 'Hello', got '%s'\" % arg"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99801:FunctionDef_L21_C0", "label": "many_arguments", "type": "function", "loc": [21, 23], "level": 0, "parent": null, "vector": [2, 0, 0.4074, 0.0556, 0, 0.66, 0.4118, 19, 0, 3, 0, 0, 0, 0, 0], "semantic": {"name": "many_arguments", "arg_names": ["arg1", "arg2", "arg3"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def many_arguments(arg1, arg2, arg3):\n assert arg1 == arg2 == arg3, (\"All arguments should have been equal, got: \"\n \"%s, %s and %s\") % (arg1, arg2, arg3)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99801:FunctionDef_L25_C0", "label": "default_arguments", "type": "function", "loc": [25, 26], "level": 0, "parent": null, "vector": [2, 0, 0.4722, 0.037, 0, 0.66, 0.4706, 869, 0, 3, 0, 0, 0, 0, 1], "semantic": {"name": "default_arguments", "arg_names": ["arg1", "arg2", "arg3"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def default_arguments(arg1, arg2='Hi', arg3='Hello'):\n many_arguments(arg1, arg2, arg3) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99801:Expr_L26_C4", "label": "many_arguments()", "type": "expression", "loc": [26, 26], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99801:FunctionDef_L25_C0", "vector": [8, 1, 0.4815, 0.0185, 1, 0.96, 0.0, 19, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "many_arguments", "arg_names": [], "import_names": [], "rhs_call_name": "many_arguments", "annotation": ""}, "snippet": " many_arguments(arg1, arg2, arg3) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99801:FunctionDef_L28_C0", "label": "variable_arguments", "type": "function", "loc": [28, 29], "level": 0, "parent": null, "vector": [2, 0, 0.5278, 0.037, 0, 0.66, 0.5294, 570, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "variable_arguments", "arg_names": ["args"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def variable_arguments(*args):\n return sum([int(arg) for arg in args])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99801:Return_L29_C4", "label": "return", "type": "return", "loc": [29, 29], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99801:FunctionDef_L28_C0", "vector": [13, 1, 0.537, 0.0185, 1, 0.14, 0.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return sum([int(arg) for arg in args])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99801:Assign_L31_C0", "label": "attribute =", "type": "assigned_variable", "loc": [31, 31], "level": 0, "parent": null, "vector": [14, 0, 0.5741, 0.0185, 0, 0.66, 0.5882, 355, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "attribute", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "attribute = 'This is not a keyword!'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99801:ClassDef_L33_C0", "label": "NotLibrary", "type": "class", "loc": [33, 40], "level": 0, "parent": null, "vector": [3, 0, 0.6759, 0.1481, 0, 0.66, 0.6471, 61, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "NotLibrary", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class NotLibrary:\n \n def two_arguments(self, arg1, arg2):\n msg = \"Arguments should have been unequal, both were '%s'\" % arg1\n assert arg1 != arg2, msg\n \n def not_keyword(self):\n pass "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99801:FunctionDef_L35_C4", "label": "two_arguments", "type": "function", "loc": [35, 37], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99801:ClassDef_L33_C0", "vector": [2, 1, 0.6667, 0.0556, 1, 0.78, 0.0, 925, 0, 3, 0, 0, 0, 0, 0], "semantic": {"name": "two_arguments", "arg_names": ["self", "arg1", "arg2"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def two_arguments(self, arg1, arg2):\n msg = \"Arguments should have been unequal, both were '%s'\" % arg1\n assert arg1 != arg2, msg"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99801:Assign_L36_C8", "label": "msg =", "type": "assigned_variable", "loc": [36, 36], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99801:FunctionDef_L35_C4", "vector": [14, 2, 0.6667, 0.0185, 2, 0.67, 0.0, 712, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "msg", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " msg = \"Arguments should have been unequal, both were '%s'\" % arg1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99801:FunctionDef_L39_C4", "label": "not_keyword", "type": "function", "loc": [39, 40], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99801:ClassDef_L33_C0", "vector": [2, 1, 0.7315, 0.037, 1, 0.78, 1.0, 262, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "not_keyword", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def not_keyword(self):\n pass "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99801:Assign_L43_C0", "label": "notlib = NotLibrary()", "type": "assigned_variable", "loc": [43, 43], "level": 0, "parent": null, "vector": [14, 0, 0.7963, 0.0185, 0, 0.66, 0.7059, 955, 3, 0, 0, 0, 61, 10, 1], "semantic": {"name": "notlib", "arg_names": [], "import_names": [], "rhs_call_name": "NotLibrary", "annotation": ""}, "snippet": "notlib = NotLibrary()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99801:Assign_L44_C0", "label": "two_arguments_from_class =", "type": "assigned_variable", "loc": [44, 44], "level": 0, "parent": null, "vector": [14, 0, 0.8148, 0.0185, 0, 0.66, 0.7647, 101, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "two_arguments_from_class", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "two_arguments_from_class = notlib.two_arguments"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99801:Assign_L46_C0", "label": "lambda_keyword =", "type": "assigned_variable", "loc": [46, 46], "level": 0, "parent": null, "vector": [14, 0, 0.8519, 0.0185, 0, 0.66, 0.8235, 403, 9, 0, 0, 0, 0, 0, 1], "semantic": {"name": "lambda_keyword", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "lambda_keyword = lambda arg: int(arg) + 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99801:Assign_L47_C0", "label": "lambda_keyword_with_two_args =", "type": "assigned_variable", "loc": [47, 47], "level": 0, "parent": null, "vector": [14, 0, 0.8704, 0.0185, 0, 0.66, 0.8824, 600, 9, 0, 0, 0, 0, 0, 2], "semantic": {"name": "lambda_keyword_with_two_args", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "lambda_keyword_with_two_args = lambda x, y: int(x) / int(y)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99801:FunctionDef_L49_C0", "label": "_not_keyword", "type": "function", "loc": [49, 50], "level": 0, "parent": null, "vector": [2, 0, 0.9167, 0.037, 0, 0.66, 0.9412, 380, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "_not_keyword", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def _not_keyword():\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99801:FunctionDef_L52_C0", "label": "module_library", "type": "function", "loc": [52, 53], "level": 0, "parent": null, "vector": [2, 0, 0.9722, 0.037, 0, 0.66, 1.0, 764, 0, 0, 1, 0, 0, 0, 0], "semantic": {"name": "module_library", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def module_library():\n return \"It should be OK to have an attribute with same name as the module\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99801:Return_L53_C4", "label": "return", "type": "return", "loc": [53, 53], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99801:FunctionDef_L52_C0", "vector": [13, 1, 0.9815, 0.0185, 1, 0.71, 0.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return \"It should be OK to have an attribute with same name as the module\""}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99801:FunctionDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99801:Expr_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99801:FunctionDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99801:Expr_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99801:FunctionDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99801:Return_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99801:FunctionDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99801:Expr_L26_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99801:FunctionDef_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99801:Return_L29_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99801:ClassDef_L33_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99801:FunctionDef_L35_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99801:FunctionDef_L35_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99801:Assign_L36_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99801:ClassDef_L33_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99801:FunctionDef_L39_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99801:FunctionDef_L52_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99801:Return_L53_C4"}] |
import os
import re
from robot import utils
from robot.output import readers
from robot.common import Statistics
from robot.libraries.BuiltIn import BuiltIn
class TestCheckerLibrary:
def process_output(self, path):
path = path.replace('/', os.sep)
try:
print "Processing output '%s'" % path
suite, errors = readers.process_output(path)
except:
raise RuntimeError('Processing output failed: %s'
% utils.get_error_message())
setter = BuiltIn().set_suite_variable
setter('$SUITE', process_suite(suite))
setter('$STATISTICS', Statistics(suite))
setter('$ERRORS', process_errors(errors))
def get_test_from_suite(self, suite, name):
tests = self.get_tests_from_suite(suite, name)
if len(tests) == 1:
return tests[0]
elif len(tests) == 0:
err = "No test '%s' found from suite '%s'"
else:
err = "More than one test '%s' found from suite '%s'"
raise RuntimeError(err % (name, suite.name))
def get_tests_from_suite(self, suite, name=None):
tests = [ test for test in suite.tests
if name is None or utils.eq(test.name, name) ]
for subsuite in suite.suites:
tests.extend(self.get_tests_from_suite(subsuite, name))
return tests
def get_suite_from_suite(self, suite, name):
suites = self.get_suites_from_suite(suite, name)
if len(suites) == 1:
return suites[0]
elif len(suites) == 0:
err = "No suite '%s' found from suite '%s'"
else:
err = "More than one suite '%s' found from suite '%s'"
raise RuntimeError(err % (name, suite.name))
def get_suites_from_suite(self, suite, name):
suites = utils.eq(suite.name, name) and [ suite ] or []
for subsuite in suite.suites:
suites.extend(self.get_suites_from_suite(subsuite, name))
return suites
def check_test_status(self, test, status=None, message=None):
"""Verifies that test's status and message are as expected.
Expected status and message can be given as parameters. If expected
status is not given, expected status and message are read from test's
documentation. If documentation doesn't contain any of PASS, FAIL or
ERROR, test's status is expected to be PASS. If status is given that is
used. Expected message is documentation after given status. Expected
message can also be regular expression. In that case expected match
starts with REGEXP: , which is ignored in the regexp match.
"""
if status is not None:
test.exp_status = status
if message is not None:
test.exp_message = message
if test.exp_status != test.status:
if test.exp_status == 'PASS':
msg = "Test was expected to PASS but it FAILED. "
msg += "Error message:\n" + test.message
else:
msg = "Test was expected to FAIL but it PASSED. "
msg += "Expected message:\n" + test.exp_message
raise AssertionError(msg)
if test.exp_message == test.message:
return
if test.exp_message.startswith('REGEXP:'):
pattern = test.exp_message.replace('REGEXP:', '', 1).strip()
if re.match('^%s$' % pattern, test.message, re.DOTALL):
return
if test.exp_message.startswith('STARTS:'):
start = test.exp_message.replace('STARTS:', '', 1).strip()
if start == '':
raise RuntimeError("Empty 'STARTS:' is not allowed")
if test.message.startswith(start):
return
raise AssertionError("Wrong message\n\n"
"Expected:\n%s\n\nActual:\n%s\n"
% (test.exp_message, test.message))
def check_suite_contains_tests(self, suite, *expected_names):
actual_tests = [ test for test in self.get_tests_from_suite(suite) ]
tests_msg = """
Expected tests : %s
Actual tests : %s""" % (str(list(expected_names)), str(actual_tests))
expected_names = [ utils.normalize(name) for name in expected_names ]
if len(actual_tests) != len(expected_names):
raise AssertionError("Wrong number of tests." + tests_msg)
for test in actual_tests:
if utils.eq_any(test.name, expected_names):
print "Verifying test '%s'" % test.name
self.check_test_status(test)
expected_names.remove(utils.normalize(test.name))
else:
raise AssertionError("Test '%s' was not expected to be run.%s"
% (test.name, tests_msg))
if len(expected_names) != 0:
raise Exception("Bug in test library")
def get_node(self, file_path, node_path=None):
dom = utils.DomWrapper(file_path)
return dom.get_node(node_path) if node_path else dom
def get_nodes(self, file_path, node_path):
return utils.DomWrapper(file_path).get_nodes(node_path)
def process_suite(suite):
for subsuite in suite.suites:
process_suite(subsuite)
for test in suite.tests:
process_test(test)
suite.test_count = suite.get_test_count()
process_keyword(suite.setup)
process_keyword(suite.teardown)
return suite
def process_test(test):
if 'FAIL' in test.doc:
test.exp_status = 'FAIL'
test.exp_message = test.doc.split('FAIL', 1)[1].lstrip()
else:
test.exp_status = 'PASS'
test.exp_message = ''
test.kws = test.keywords
test.keyword_count = test.kw_count = len(test.keywords)
for kw in test.keywords:
process_keyword(kw)
process_keyword(test.setup)
process_keyword(test.teardown)
def process_keyword(kw):
if kw is None:
return
kw.kws = kw.keywords
kw.msgs = kw.messages
kw.message_count = kw.msg_count = len(kw.messages)
kw.keyword_count = kw.kw_count = len(kw.keywords)
for subkw in kw.keywords:
process_keyword(subkw)
def process_errors(errors):
errors.msgs = errors.messages
errors.message_count = errors.msg_count = len(errors.messages)
return errors
| ajibawa-2023/Python-Code-Large/train/row_99803 | 111 | 165 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99803:Import_L1_C0", "label": "os import os", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0061, 0.0061, 0, 0.66, 0.0, 688, 0, 1, 0, 0, 688, 0, 0], "semantic": {"name": "os", "arg_names": [], "import_names": ["os"], "rhs_call_name": "", "annotation": ""}, "snippet": "import os"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99803:Import_L2_C0", "label": "re import re", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0121, 0.0061, 0, 0.66, 0.1, 540, 0, 1, 0, 0, 540, 0, 0], "semantic": {"name": "re", "arg_names": [], "import_names": ["re"], "rhs_call_name": "", "annotation": ""}, "snippet": "import re"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99803:ImportFrom_L4_C0", "label": "from robot import utils", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0242, 0.0061, 0, 0.66, 0.2, 735, 0, 1, 0, 0, 735, 0, 0], "semantic": {"name": "robot", "arg_names": [], "import_names": ["utils"], "rhs_call_name": "", "annotation": ""}, "snippet": "from robot import utils"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99803:ImportFrom_L5_C0", "label": "from robot.output import readers", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0303, 0.0061, 0, 0.66, 0.3, 596, 0, 1, 0, 0, 596, 0, 0], "semantic": {"name": "robot.output", "arg_names": [], "import_names": ["readers"], "rhs_call_name": "", "annotation": ""}, "snippet": "from robot.output import readers"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99803:ImportFrom_L6_C0", "label": "from robot.common import Statistics", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.0364, 0.0061, 0, 0.66, 0.4, 355, 0, 1, 0, 0, 355, 0, 0], "semantic": {"name": "robot.common", "arg_names": [], "import_names": ["Statistics"], "rhs_call_name": "", "annotation": ""}, "snippet": "from robot.common import Statistics"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99803:ImportFrom_L7_C0", "label": "from robot.libraries.BuiltIn import BuiltIn", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.0424, 0.0061, 0, 0.66, 0.5, 588, 0, 1, 0, 0, 588, 0, 0], "semantic": {"name": "robot.libraries.BuiltIn", "arg_names": [], "import_names": ["BuiltIn"], "rhs_call_name": "", "annotation": ""}, "snippet": "from robot.libraries.BuiltIn import BuiltIn"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99803:ClassDef_L10_C0", "label": "TestCheckerLibrary", "type": "class", "loc": [10, 125], "level": 0, "parent": null, "vector": [3, 0, 0.4091, 0.703, 0, 0.66, 0.6, 770, 0, 9, 0, 0, 0, 0, 57], "semantic": {"name": "TestCheckerLibrary", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class TestCheckerLibrary:\n\n def process_output(self, path):\n path = path.replace('/', os.sep)\n try:\n print(\"Processing output '%s'\" % path)\n suite, errors = readers.process_output(path)\n except:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99803:FunctionDef_L12_C4", "label": "process_output", "type": "function", "loc": [12, 23], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99803:ClassDef_L10_C0", "vector": [2, 1, 0.1061, 0.0727, 1, 0.99, 0.0, 918, 0, 2, 0, 0, 0, 0, 12], "semantic": {"name": "process_output", "arg_names": ["self", "path"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def process_output(self, path):\n path = path.replace('/', os.sep)\n try:\n print(\"Processing output '%s'\" % path)\n suite, errors = readers.process_output(path)\n except:\n raise RuntimeError('Processing output failed: %s'\n % utils.get_error_message())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99803:Assign_L13_C8", "label": "path = replace()", "type": "assigned_variable", "loc": [13, 13], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99803:FunctionDef_L12_C4", "vector": [14, 2, 0.0788, 0.0061, 2, 0.95, 0.0, 358, 3, 2, 0, 0, 293, 10, 1], "semantic": {"name": "path", "arg_names": [], "import_names": [], "rhs_call_name": "replace", "annotation": ""}, "snippet": " path = path.replace('/', os.sep)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99803:Try_L14_C8", "label": "try", "type": "try", "loc": [14, 19], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99803:FunctionDef_L12_C4", "vector": [7, 2, 0.1, 0.0364, 2, 0.95, 0.2, 0, 0, 1, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n print(\"Processing output '%s'\" % path)\n suite, errors = readers.process_output(path)\n except:\n raise RuntimeError('Processing output failed: %s'\n % utils.get_error_message())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99803:Expr_L15_C12", "label": "print()", "type": "expression", "loc": [15, 15], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99803:Try_L14_C8", "vector": [8, 3, 0.0909, 0.0061, 3, 0.45, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"Processing output '%s'\" % path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99803:Assign_L16_C12", "label": "suite, errors = process_output()", "type": "assigned_variable", "loc": [16, 16], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99803:Try_L14_C8", "vector": [14, 3, 0.097, 0.0061, 3, 0.45, 1.0, 667, 3, 1, 0, 0, 918, 10, 1], "semantic": {"name": "suite, errors", "arg_names": [], "import_names": [], "rhs_call_name": "process_output", "annotation": ""}, "snippet": " suite, errors = readers.process_output(path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99803:Assign_L20_C8", "label": "setter =", "type": "assigned_variable", "loc": [20, 20], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99803:FunctionDef_L12_C4", "vector": [14, 2, 0.1212, 0.0061, 2, 0.95, 0.4, 235, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "setter", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " setter = BuiltIn().set_suite_variable"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99803:Expr_L21_C8", "label": "setter()", "type": "expression", "loc": [21, 21], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99803:FunctionDef_L12_C4", "vector": [8, 2, 0.1273, 0.0061, 2, 0.95, 0.6, 235, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "setter", "arg_names": [], "import_names": [], "rhs_call_name": "setter", "annotation": ""}, "snippet": " setter('$SUITE', process_suite(suite))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99803:Expr_L22_C8", "label": "setter()", "type": "expression", "loc": [22, 22], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99803:FunctionDef_L12_C4", "vector": [8, 2, 0.1333, 0.0061, 2, 0.95, 0.8, 235, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "setter", "arg_names": [], "import_names": [], "rhs_call_name": "setter", "annotation": ""}, "snippet": " setter('$STATISTICS', Statistics(suite))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99803:Expr_L23_C8", "label": "setter()", "type": "expression", "loc": [23, 23], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99803:FunctionDef_L12_C4", "vector": [8, 2, 0.1394, 0.0061, 2, 0.95, 1.0, 235, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "setter", "arg_names": [], "import_names": [], "rhs_call_name": "setter", "annotation": ""}, "snippet": " setter('$ERRORS', process_errors(errors))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99803:FunctionDef_L25_C4", "label": "get_test_from_suite", "type": "function", "loc": [25, 33], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99803:ClassDef_L10_C0", "vector": [2, 1, 0.1758, 0.0545, 1, 0.99, 0.125, 778, 0, 3, 1, 0, 0, 0, 4], "semantic": {"name": "get_test_from_suite", "arg_names": ["self", "suite", "name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_test_from_suite(self, suite, name):\n tests = self.get_tests_from_suite(suite, name)\n if len(tests) == 1:\n return tests[0]\n elif len(tests) == 0:\n err = \"No test '%s' found from suite '%s'\"\n else:\n err = \"More than one test '%s' found from suite '%s'\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99803:Assign_L26_C8", "label": "tests = get_tests_from_suite()", "type": "assigned_variable", "loc": [26, 26], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99803:FunctionDef_L25_C4", "vector": [14, 2, 0.1576, 0.0061, 2, 0.46, 0.0, 416, 3, 2, 0, 0, 828, 10, 1], "semantic": {"name": "tests", "arg_names": [], "import_names": [], "rhs_call_name": "get_tests_from_suite", "annotation": ""}, "snippet": " tests = self.get_tests_from_suite(suite, name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99803:If_L27_C8", "label": "if", "type": "if", "loc": [27, 32], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99803:FunctionDef_L25_C4", "vector": [4, 2, 0.1788, 0.0364, 2, 0.46, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(tests) == 1:\n return tests[0]\n elif len(tests) == 0:\n err = \"No test '%s' found from suite '%s'\"\n else:\n err = \"More than one test '%s' found from suite '%s'\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99803:Return_L28_C12", "label": "return", "type": "return", "loc": [28, 28], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99803:If_L27_C8", "vector": [13, 3, 0.1697, 0.0061, 3, 0.74, 0.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return tests[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99803:If_L29_C8", "label": "if", "type": "if", "loc": [29, 32], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99803:If_L27_C8", "vector": [4, 3, 0.1848, 0.0242, 3, 0.74, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif len(tests) == 0:\n err = \"No test '%s' found from suite '%s'\"\n else:\n err = \"More than one test '%s' found from suite '%s'\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99803:Assign_L30_C12", "label": "err =", "type": "assigned_variable", "loc": [30, 30], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99803:If_L29_C8", "vector": [14, 4, 0.1818, 0.0061, 4, 0.21, 0.0, 541, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "err", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " err = \"No test '%s' found from suite '%s'\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99803:Assign_L32_C12", "label": "err =", "type": "assigned_variable", "loc": [32, 32], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99803:If_L29_C8", "vector": [14, 4, 0.1939, 0.0061, 4, 0.21, 1.0, 541, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "err", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " err = \"More than one test '%s' found from suite '%s'\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99803:FunctionDef_L35_C4", "label": "get_tests_from_suite", "type": "function", "loc": [35, 40], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99803:ClassDef_L10_C0", "vector": [2, 1, 0.2273, 0.0364, 1, 0.99, 0.25, 828, 0, 3, 1, 0, 0, 0, 3], "semantic": {"name": "get_tests_from_suite", "arg_names": ["self", "suite", "name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_tests_from_suite(self, suite, name=None):\n tests = [ test for test in suite.tests\n if name is None or utils.eq(test.name, name) ]\n for subsuite in suite.suites:\n tests.extend(self.get_tests_from_suite(subsuite, name))\n return tests"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99803:Assign_L36_C8", "label": "tests =", "type": "assigned_variable", "loc": [36, 37], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99803:FunctionDef_L35_C4", "vector": [14, 2, 0.2212, 0.0121, 2, 0.89, 0.0, 416, 5, 0, 0, 0, 0, 0, 1], "semantic": {"name": "tests", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tests = [ test for test in suite.tests\n if name is None or utils.eq(test.name, name) ]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99803:For_L38_C8", "label": "for subsuite", "type": "for", "loc": [38, 39], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99803:FunctionDef_L35_C4", "vector": [6, 2, 0.2333, 0.0121, 2, 0.89, 0.5, 700, 7, 0, 0, 0, 0, 0, 2], "semantic": {"name": "subsuite", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for subsuite in suite.suites:\n tests.extend(self.get_tests_from_suite(subsuite, name))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99803:Expr_L39_C12", "label": "extend()", "type": "expression", "loc": [39, 39], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99803:For_L38_C8", "vector": [8, 3, 0.2364, 0.0061, 3, 0.01, 0.0, 660, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "extend", "arg_names": [], "import_names": [], "rhs_call_name": "extend", "annotation": ""}, "snippet": " tests.extend(self.get_tests_from_suite(subsuite, name))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99803:Return_L40_C8", "label": "return", "type": "return", "loc": [40, 40], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99803:FunctionDef_L35_C4", "vector": [13, 2, 0.2424, 0.0061, 2, 0.89, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return tests"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99803:FunctionDef_L42_C4", "label": "get_suite_from_suite", "type": "function", "loc": [42, 50], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99803:ClassDef_L10_C0", "vector": [2, 1, 0.2788, 0.0545, 1, 0.99, 0.375, 505, 0, 3, 1, 0, 0, 0, 4], "semantic": {"name": "get_suite_from_suite", "arg_names": ["self", "suite", "name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_suite_from_suite(self, suite, name):\n suites = self.get_suites_from_suite(suite, name)\n if len(suites) == 1:\n return suites[0]\n elif len(suites) == 0:\n err = \"No suite '%s' found from suite '%s'\"\n else:\n err = \"More than one suite '%s' found from suite '%s'\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99803:Assign_L43_C8", "label": "suites = get_suites_from_suite()", "type": "assigned_variable", "loc": [43, 43], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99803:FunctionDef_L42_C4", "vector": [14, 2, 0.2606, 0.0061, 2, 0.09, 0.0, 481, 3, 2, 0, 0, 711, 10, 1], "semantic": {"name": "suites", "arg_names": [], "import_names": [], "rhs_call_name": "get_suites_from_suite", "annotation": ""}, "snippet": " suites = self.get_suites_from_suite(suite, name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99803:If_L44_C8", "label": "if", "type": "if", "loc": [44, 49], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99803:FunctionDef_L42_C4", "vector": [4, 2, 0.2818, 0.0364, 2, 0.09, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(suites) == 1:\n return suites[0]\n elif len(suites) == 0:\n err = \"No suite '%s' found from suite '%s'\"\n else:\n err = \"More than one suite '%s' found from suite '%s'\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99803:Return_L45_C12", "label": "return", "type": "return", "loc": [45, 45], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99803:If_L44_C8", "vector": [13, 3, 0.2727, 0.0061, 3, 0.7, 0.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return suites[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99803:If_L46_C8", "label": "if", "type": "if", "loc": [46, 49], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99803:If_L44_C8", "vector": [4, 3, 0.2879, 0.0242, 3, 0.7, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif len(suites) == 0:\n err = \"No suite '%s' found from suite '%s'\"\n else:\n err = \"More than one suite '%s' found from suite '%s'\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99803:Assign_L47_C12", "label": "err =", "type": "assigned_variable", "loc": [47, 47], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99803:If_L46_C8", "vector": [14, 4, 0.2848, 0.0061, 4, 0.51, 0.0, 541, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "err", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " err = \"No suite '%s' found from suite '%s'\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99803:Assign_L49_C12", "label": "err =", "type": "assigned_variable", "loc": [49, 49], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99803:If_L46_C8", "vector": [14, 4, 0.297, 0.0061, 4, 0.51, 1.0, 541, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "err", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " err = \"More than one suite '%s' found from suite '%s'\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99803:FunctionDef_L52_C4", "label": "get_suites_from_suite", "type": "function", "loc": [52, 56], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99803:ClassDef_L10_C0", "vector": [2, 1, 0.3273, 0.0303, 1, 0.99, 0.5, 711, 0, 3, 1, 0, 0, 0, 3], "semantic": {"name": "get_suites_from_suite", "arg_names": ["self", "suite", "name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_suites_from_suite(self, suite, name):\n suites = utils.eq(suite.name, name) and [ suite ] or []\n for subsuite in suite.suites:\n suites.extend(self.get_suites_from_suite(subsuite, name))\n return suites"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99803:Assign_L53_C8", "label": "suites =", "type": "assigned_variable", "loc": [53, 53], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99803:FunctionDef_L52_C4", "vector": [14, 2, 0.3212, 0.0061, 2, 0.02, 0.0, 481, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "suites", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " suites = utils.eq(suite.name, name) and [ suite ] or []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99803:For_L54_C8", "label": "for subsuite", "type": "for", "loc": [54, 55], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99803:FunctionDef_L52_C4", "vector": [6, 2, 0.3303, 0.0121, 2, 0.02, 0.5, 700, 7, 0, 0, 0, 0, 0, 2], "semantic": {"name": "subsuite", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for subsuite in suite.suites:\n suites.extend(self.get_suites_from_suite(subsuite, name))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99803:Expr_L55_C12", "label": "extend()", "type": "expression", "loc": [55, 55], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99803:For_L54_C8", "vector": [8, 3, 0.3333, 0.0061, 3, 0.05, 0.0, 660, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "extend", "arg_names": [], "import_names": [], "rhs_call_name": "extend", "annotation": ""}, "snippet": " suites.extend(self.get_suites_from_suite(subsuite, name))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99803:Return_L56_C8", "label": "return", "type": "return", "loc": [56, 56], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99803:FunctionDef_L52_C4", "vector": [13, 2, 0.3394, 0.0061, 2, 0.02, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return suites"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99803:FunctionDef_L58_C4", "label": "check_test_status", "type": "function", "loc": [58, 98], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99803:ClassDef_L10_C0", "vector": [2, 1, 0.4727, 0.2485, 1, 0.99, 0.625, 515, 0, 4, 0, 0, 0, 0, 11], "semantic": {"name": "check_test_status", "arg_names": ["self", "test", "status", "message"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def check_test_status(self, test, status=None, message=None):\n \"\"\"Verifies that test's status and message are as expected.\n\n Expected status and message can be given as parameters. If expected\n status is not given, expected status and message are read from test's\n documentation. If documentation doesn't contain any of PASS, FAIL or\n ERROR, test's status is expected to be PASS. If status is given that is\n used. Expected message is documentation after given status. Expected"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99803:Expr_L59_C8", "label": "expression", "type": "expression", "loc": [59, 68], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99803:FunctionDef_L58_C4", "vector": [8, 2, 0.3848, 0.0606, 2, 0.92, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Verifies that test's status and message are as expected.\n\n Expected status and message can be given as parameters. If expected\n status is not given, expected status and message are read from test's\n documentation. If documentation doesn't contain any of PASS, FAIL or\n ERROR, test's status is expected to be PASS. If status is given that is\n used. Expected message is documentation after given status. Expected\n message can also be regular expression. In that case expected match"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99803:If_L69_C8", "label": "if", "type": "if", "loc": [69, 70], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99803:FunctionDef_L58_C4", "vector": [4, 2, 0.4212, 0.0121, 2, 0.92, 0.1667, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if status is not None:\n test.exp_status = status"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99803:Assign_L70_C12", "label": "test.exp_status =", "type": "assigned_variable", "loc": [70, 70], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99803:If_L69_C8", "vector": [14, 3, 0.4242, 0.0061, 3, 0.44, 0.0, 849, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "test.exp_status", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " test.exp_status = status"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99803:If_L71_C8", "label": "if", "type": "if", "loc": [71, 72], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99803:FunctionDef_L58_C4", "vector": [4, 2, 0.4333, 0.0121, 2, 0.92, 0.3333, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if message is not None:\n test.exp_message = message"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99803:Assign_L72_C12", "label": "test.exp_message =", "type": "assigned_variable", "loc": [72, 72], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99803:If_L71_C8", "vector": [14, 3, 0.4364, 0.0061, 3, 0.16, 0.0, 133, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "test.exp_message", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " test.exp_message = message"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99803:If_L74_C8", "label": "if", "type": "if", "loc": [74, 81], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99803:FunctionDef_L58_C4", "vector": [4, 2, 0.4697, 0.0485, 2, 0.92, 0.5, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if test.exp_status != test.status:\n if test.exp_status == 'PASS':\n msg = \"Test was expected to PASS but it FAILED. \"\n msg += \"Error message:\\n\" + test.message\n else:\n msg = \"Test was expected to FAIL but it PASSED. \"\n msg += \"Expected message:\\n\" + test.exp_message\n raise AssertionError(msg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99803:If_L75_C12", "label": "if", "type": "if", "loc": [75, 80], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99803:If_L74_C8", "vector": [4, 3, 0.4697, 0.0364, 3, 0.61, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if test.exp_status == 'PASS':\n msg = \"Test was expected to PASS but it FAILED. \"\n msg += \"Error message:\\n\" + test.message\n else:\n msg = \"Test was expected to FAIL but it PASSED. \"\n msg += \"Expected message:\\n\" + test.exp_message"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99803:Assign_L76_C16", "label": "msg =", "type": "assigned_variable", "loc": [76, 76], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99803:If_L75_C12", "vector": [14, 4, 0.4606, 0.0061, 4, 0.33, 0.0, 712, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "msg", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " msg = \"Test was expected to PASS but it FAILED. \""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99803:Assign_L79_C16", "label": "msg =", "type": "assigned_variable", "loc": [79, 79], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99803:If_L75_C12", "vector": [14, 4, 0.4788, 0.0061, 4, 0.33, 1.0, 712, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "msg", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " msg = \"Test was expected to FAIL but it PASSED. \""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99803:If_L83_C8", "label": "if", "type": "if", "loc": [83, 84], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99803:FunctionDef_L58_C4", "vector": [4, 2, 0.5061, 0.0121, 2, 0.92, 0.6667, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if test.exp_message == test.message:\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99803:Return_L84_C12", "label": "return", "type": "return", "loc": [84, 84], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99803:If_L83_C8", "vector": [13, 3, 0.5091, 0.0061, 3, 0.77, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99803:If_L85_C8", "label": "if", "type": "if", "loc": [85, 88], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99803:FunctionDef_L58_C4", "vector": [4, 2, 0.5242, 0.0242, 2, 0.92, 0.8333, 0, 3, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if test.exp_message.startswith('REGEXP:'):\n pattern = test.exp_message.replace('REGEXP:', '', 1).strip()\n if re.match('^%s$' % pattern, test.message, re.DOTALL):\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99803:Assign_L86_C12", "label": "pattern = strip()", "type": "assigned_variable", "loc": [86, 86], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99803:If_L85_C8", "vector": [14, 3, 0.5212, 0.0061, 3, 0.87, 0.0, 561, 3, 0, 0, 0, 973, 10, 2], "semantic": {"name": "pattern", "arg_names": [], "import_names": [], "rhs_call_name": "strip", "annotation": ""}, "snippet": " pattern = test.exp_message.replace('REGEXP:', '', 1).strip()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99803:If_L87_C12", "label": "if", "type": "if", "loc": [87, 88], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99803:If_L85_C8", "vector": [4, 3, 0.5303, 0.0121, 3, 0.87, 1.0, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if re.match('^%s$' % pattern, test.message, re.DOTALL):\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99803:Return_L88_C16", "label": "return", "type": "return", "loc": [88, 88], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99803:If_L87_C12", "vector": [13, 4, 0.5333, 0.0061, 4, 0.06, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99803:If_L89_C8", "label": "if", "type": "if", "loc": [89, 94], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99803:FunctionDef_L58_C4", "vector": [4, 2, 0.5545, 0.0364, 2, 0.92, 1.0, 0, 3, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if test.exp_message.startswith('STARTS:'):\n start = test.exp_message.replace('STARTS:', '', 1).strip()\n if start == '':\n raise RuntimeError(\"Empty 'STARTS:' is not allowed\")\n if test.message.startswith(start):\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99803:Assign_L90_C12", "label": "start = strip()", "type": "assigned_variable", "loc": [90, 90], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99803:If_L89_C8", "vector": [14, 3, 0.5455, 0.0061, 3, 0.96, 0.0, 511, 3, 0, 0, 0, 973, 10, 2], "semantic": {"name": "start", "arg_names": [], "import_names": [], "rhs_call_name": "strip", "annotation": ""}, "snippet": " start = test.exp_message.replace('STARTS:', '', 1).strip()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99803:If_L91_C12", "label": "if", "type": "if", "loc": [91, 92], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99803:If_L89_C8", "vector": [4, 3, 0.5545, 0.0121, 3, 0.96, 0.5, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if start == '':\n raise RuntimeError(\"Empty 'STARTS:' is not allowed\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99803:If_L93_C12", "label": "if", "type": "if", "loc": [93, 94], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99803:If_L89_C8", "vector": [4, 3, 0.5667, 0.0121, 3, 0.96, 1.0, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if test.message.startswith(start):\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99803:Return_L94_C16", "label": "return", "type": "return", "loc": [94, 94], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99803:If_L93_C12", "vector": [13, 4, 0.5697, 0.0061, 4, 0.77, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99803:FunctionDef_L101_C4", "label": "check_suite_contains_tests", "type": "function", "loc": [101, 118], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99803:ClassDef_L10_C0", "vector": [2, 1, 0.6636, 0.1091, 1, 0.99, 0.75, 551, 0, 3, 0, 0, 0, 0, 16], "semantic": {"name": "check_suite_contains_tests", "arg_names": ["self", "suite", "expected_names"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def check_suite_contains_tests(self, suite, *expected_names):\n actual_tests = [ test for test in self.get_tests_from_suite(suite) ]\n tests_msg = \"\"\"\nExpected tests : %s\nActual tests : %s\"\"\" % (str(list(expected_names)), str(actual_tests))\n expected_names = [ utils.normalize(name) for name in expected_names ]\n if len(actual_tests) != len(expected_names):\n raise AssertionError(\"Wrong number of tests.\" + tests_msg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99803:Assign_L102_C8", "label": "actual_tests =", "type": "assigned_variable", "loc": [102, 102], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99803:FunctionDef_L101_C4", "vector": [14, 2, 0.6182, 0.0061, 2, 0.13, 0.0, 655, 5, 0, 0, 0, 0, 0, 1], "semantic": {"name": "actual_tests", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " actual_tests = [ test for test in self.get_tests_from_suite(suite) ]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99803:Assign_L103_C8", "label": "tests_msg =", "type": "assigned_variable", "loc": [103, 105], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99803:FunctionDef_L101_C4", "vector": [14, 2, 0.6303, 0.0182, 2, 0.13, 0.2, 341, 4, 0, 0, 0, 0, 0, 3], "semantic": {"name": "tests_msg", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tests_msg = \"\"\"\nExpected tests : %s\nActual tests : %s\"\"\" % (str(list(expected_names)), str(actual_tests))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99803:Assign_L106_C8", "label": "expected_names =", "type": "assigned_variable", "loc": [106, 106], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99803:FunctionDef_L101_C4", "vector": [14, 2, 0.6424, 0.0061, 2, 0.13, 0.4, 658, 5, 0, 0, 0, 0, 0, 1], "semantic": {"name": "expected_names", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " expected_names = [ utils.normalize(name) for name in expected_names ]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99803:If_L107_C8", "label": "if", "type": "if", "loc": [107, 108], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99803:FunctionDef_L101_C4", "vector": [4, 2, 0.6515, 0.0121, 2, 0.13, 0.6, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(actual_tests) != len(expected_names):\n raise AssertionError(\"Wrong number of tests.\" + tests_msg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99803:For_L109_C8", "label": "for test", "type": "for", "loc": [109, 116], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99803:FunctionDef_L101_C4", "vector": [6, 2, 0.6818, 0.0485, 2, 0.13, 0.8, 224, 2, 0, 0, 0, 0, 0, 6], "semantic": {"name": "test", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for test in actual_tests:\n if utils.eq_any(test.name, expected_names):\n print(\"Verifying test '%s'\" % test.name)\n self.check_test_status(test)\n expected_names.remove(utils.normalize(test.name))\n else:\n raise AssertionError(\"Test '%s' was not expected to be run.%s\"\n % (test.name, tests_msg))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99803:If_L110_C12", "label": "if", "type": "if", "loc": [110, 116], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99803:For_L109_C8", "vector": [4, 3, 0.6848, 0.0424, 3, 0.84, 0.0, 0, 3, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if utils.eq_any(test.name, expected_names):\n print(\"Verifying test '%s'\" % test.name)\n self.check_test_status(test)\n expected_names.remove(utils.normalize(test.name))\n else:\n raise AssertionError(\"Test '%s' was not expected to be run.%s\"\n % (test.name, tests_msg))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99803:Expr_L111_C16", "label": "print()", "type": "expression", "loc": [111, 111], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99803:If_L110_C12", "vector": [8, 4, 0.6727, 0.0061, 4, 0.76, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"Verifying test '%s'\" % test.name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99803:Expr_L112_C16", "label": "check_test_status()", "type": "expression", "loc": [112, 112], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99803:If_L110_C12", "vector": [8, 4, 0.6788, 0.0061, 4, 0.76, 0.5, 515, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "check_test_status", "arg_names": [], "import_names": [], "rhs_call_name": "check_test_status", "annotation": ""}, "snippet": " self.check_test_status(test)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99803:Expr_L113_C16", "label": "remove()", "type": "expression", "loc": [113, 113], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99803:If_L110_C12", "vector": [8, 4, 0.6848, 0.0061, 4, 0.76, 1.0, 185, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "remove", "arg_names": [], "import_names": [], "rhs_call_name": "remove", "annotation": ""}, "snippet": " expected_names.remove(utils.normalize(test.name))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99803:If_L117_C8", "label": "if", "type": "if", "loc": [117, 118], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99803:FunctionDef_L101_C4", "vector": [4, 2, 0.7121, 0.0121, 2, 0.13, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(expected_names) != 0:\n raise Exception(\"Bug in test library\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99803:FunctionDef_L120_C4", "label": "get_node", "type": "function", "loc": [120, 122], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99803:ClassDef_L10_C0", "vector": [2, 1, 0.7333, 0.0182, 1, 0.99, 0.875, 37, 0, 3, 1, 0, 0, 0, 2], "semantic": {"name": "get_node", "arg_names": ["self", "file_path", "node_path"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_node(self, file_path, node_path=None):\n dom = utils.DomWrapper(file_path)\n return dom.get_node(node_path) if node_path else dom"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99803:Assign_L121_C8", "label": "dom = DomWrapper()", "type": "assigned_variable", "loc": [121, 121], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99803:FunctionDef_L120_C4", "vector": [14, 2, 0.7333, 0.0061, 2, 0.34, 0.0, 401, 3, 1, 0, 0, 409, 10, 1], "semantic": {"name": "dom", "arg_names": [], "import_names": [], "rhs_call_name": "DomWrapper", "annotation": ""}, "snippet": " dom = utils.DomWrapper(file_path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99803:Return_L122_C8", "label": "return", "type": "return", "loc": [122, 122], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99803:FunctionDef_L120_C4", "vector": [13, 2, 0.7394, 0.0061, 2, 0.34, 1.0, 0, 8, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return dom.get_node(node_path) if node_path else dom"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99803:FunctionDef_L124_C4", "label": "get_nodes", "type": "function", "loc": [124, 125], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99803:ClassDef_L10_C0", "vector": [2, 1, 0.7545, 0.0121, 1, 0.99, 1.0, 129, 0, 3, 1, 0, 0, 0, 2], "semantic": {"name": "get_nodes", "arg_names": ["self", "file_path", "node_path"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_nodes(self, file_path, node_path):\n return utils.DomWrapper(file_path).get_nodes(node_path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99803:Return_L125_C8", "label": "return", "type": "return", "loc": [125, 125], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99803:FunctionDef_L124_C4", "vector": [13, 2, 0.7576, 0.0061, 2, 0.62, 0.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return utils.DomWrapper(file_path).get_nodes(node_path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99803:FunctionDef_L128_C0", "label": "process_suite", "type": "function", "loc": [128, 136], "level": 0, "parent": null, "vector": [2, 0, 0.8, 0.0545, 0, 0.66, 0.7, 629, 0, 1, 1, 0, 0, 0, 5], "semantic": {"name": "process_suite", "arg_names": ["suite"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def process_suite(suite):\n for subsuite in suite.suites:\n process_suite(subsuite)\n for test in suite.tests:\n process_test(test)\n suite.test_count = suite.get_test_count()\n process_keyword(suite.setup)\n process_keyword(suite.teardown)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99803:For_L129_C4", "label": "for subsuite", "type": "for", "loc": [129, 130], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99803:FunctionDef_L128_C0", "vector": [6, 1, 0.7848, 0.0121, 1, 0.68, 0.0, 700, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "subsuite", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for subsuite in suite.suites:\n process_suite(subsuite)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99803:Expr_L130_C8", "label": "process_suite()", "type": "expression", "loc": [130, 130], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99803:For_L129_C4", "vector": [8, 2, 0.7879, 0.0061, 2, 0.77, 0.0, 629, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "process_suite", "arg_names": [], "import_names": [], "rhs_call_name": "process_suite", "annotation": ""}, "snippet": " process_suite(subsuite)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99803:For_L131_C4", "label": "for test", "type": "for", "loc": [131, 132], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99803:FunctionDef_L128_C0", "vector": [6, 1, 0.797, 0.0121, 1, 0.68, 0.2, 224, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "test", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for test in suite.tests:\n process_test(test)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99803:Expr_L132_C8", "label": "process_test()", "type": "expression", "loc": [132, 132], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99803:For_L131_C4", "vector": [8, 2, 0.8, 0.0061, 2, 0.0, 0.0, 871, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "process_test", "arg_names": [], "import_names": [], "rhs_call_name": "process_test", "annotation": ""}, "snippet": " process_test(test)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99803:Assign_L133_C4", "label": "suite.test_count = get_test_count()", "type": "assigned_variable", "loc": [133, 133], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99803:FunctionDef_L128_C0", "vector": [14, 1, 0.8061, 0.0061, 1, 0.68, 0.4, 270, 3, 0, 0, 0, 560, 10, 1], "semantic": {"name": "suite.test_count", "arg_names": [], "import_names": [], "rhs_call_name": "get_test_count", "annotation": ""}, "snippet": " suite.test_count = suite.get_test_count()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99803:Expr_L134_C4", "label": "process_keyword()", "type": "expression", "loc": [134, 134], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99803:FunctionDef_L128_C0", "vector": [8, 1, 0.8121, 0.0061, 1, 0.68, 0.6, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "process_keyword", "arg_names": [], "import_names": [], "rhs_call_name": "process_keyword", "annotation": ""}, "snippet": " process_keyword(suite.setup)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99803:Expr_L135_C4", "label": "process_keyword()", "type": "expression", "loc": [135, 135], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99803:FunctionDef_L128_C0", "vector": [8, 1, 0.8182, 0.0061, 1, 0.68, 0.8, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "process_keyword", "arg_names": [], "import_names": [], "rhs_call_name": "process_keyword", "annotation": ""}, "snippet": " process_keyword(suite.teardown)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99803:Return_L136_C4", "label": "return", "type": "return", "loc": [136, 136], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99803:FunctionDef_L128_C0", "vector": [13, 1, 0.8242, 0.0061, 1, 0.68, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return suite"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99803:FunctionDef_L138_C0", "label": "process_test", "type": "function", "loc": [138, 150], "level": 0, "parent": null, "vector": [2, 0, 0.8727, 0.0788, 0, 0.66, 0.8, 871, 0, 1, 0, 0, 0, 0, 6], "semantic": {"name": "process_test", "arg_names": ["test"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def process_test(test):\n if 'FAIL' in test.doc:\n test.exp_status = 'FAIL'\n test.exp_message = test.doc.split('FAIL', 1)[1].lstrip()\n else:\n test.exp_status = 'PASS'\n test.exp_message = ''\n test.kws = test.keywords"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99803:If_L139_C4", "label": "if", "type": "if", "loc": [139, 144], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99803:FunctionDef_L138_C0", "vector": [4, 1, 0.8576, 0.0364, 1, 0.86, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if 'FAIL' in test.doc:\n test.exp_status = 'FAIL'\n test.exp_message = test.doc.split('FAIL', 1)[1].lstrip()\n else:\n test.exp_status = 'PASS'\n test.exp_message = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99803:Assign_L140_C8", "label": "test.exp_status =", "type": "assigned_variable", "loc": [140, 140], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99803:If_L139_C4", "vector": [14, 2, 0.8485, 0.0061, 2, 0.01, 0.0, 849, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "test.exp_status", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " test.exp_status = 'FAIL'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99803:Assign_L141_C8", "label": "test.exp_message = lstrip()", "type": "assigned_variable", "loc": [141, 141], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99803:If_L139_C4", "vector": [14, 2, 0.8545, 0.0061, 2, 0.01, 0.3333, 133, 3, 0, 0, 0, 313, 10, 2], "semantic": {"name": "test.exp_message", "arg_names": [], "import_names": [], "rhs_call_name": "lstrip", "annotation": ""}, "snippet": " test.exp_message = test.doc.split('FAIL', 1)[1].lstrip()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99803:Assign_L143_C8", "label": "test.exp_status =", "type": "assigned_variable", "loc": [143, 143], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99803:If_L139_C4", "vector": [14, 2, 0.8667, 0.0061, 2, 0.01, 0.6667, 849, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "test.exp_status", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " test.exp_status = 'PASS'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99803:Assign_L144_C8", "label": "test.exp_message =", "type": "assigned_variable", "loc": [144, 144], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99803:If_L139_C4", "vector": [14, 2, 0.8727, 0.0061, 2, 0.01, 1.0, 133, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "test.exp_message", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " test.exp_message = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99803:Assign_L145_C4", "label": "test.kws =", "type": "assigned_variable", "loc": [145, 145], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99803:FunctionDef_L138_C0", "vector": [14, 1, 0.8788, 0.0061, 1, 0.86, 0.2, 170, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "test.kws", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " test.kws = test.keywords"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99803:Assign_L146_C4", "label": "test.keyword_count = len()", "type": "assigned_variable", "loc": [146, 146], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99803:FunctionDef_L138_C0", "vector": [14, 1, 0.8848, 0.0061, 1, 0.86, 0.4, 382, 3, 1, 0, 0, 890, 10, 1], "semantic": {"name": "test.keyword_count", "arg_names": [], "import_names": [], "rhs_call_name": "len", "annotation": ""}, "snippet": " test.keyword_count = test.kw_count = len(test.keywords)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99803:For_L147_C4", "label": "for kw", "type": "for", "loc": [147, 148], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99803:FunctionDef_L138_C0", "vector": [6, 1, 0.8939, 0.0121, 1, 0.86, 0.6, 755, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "kw", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for kw in test.keywords:\n process_keyword(kw)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99803:Expr_L148_C8", "label": "process_keyword()", "type": "expression", "loc": [148, 148], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99803:For_L147_C4", "vector": [8, 2, 0.897, 0.0061, 2, 0.62, 0.0, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "process_keyword", "arg_names": [], "import_names": [], "rhs_call_name": "process_keyword", "annotation": ""}, "snippet": " process_keyword(kw)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99803:Expr_L149_C4", "label": "process_keyword()", "type": "expression", "loc": [149, 149], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99803:FunctionDef_L138_C0", "vector": [8, 1, 0.903, 0.0061, 1, 0.86, 0.8, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "process_keyword", "arg_names": [], "import_names": [], "rhs_call_name": "process_keyword", "annotation": ""}, "snippet": " process_keyword(test.setup)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99803:Expr_L150_C4", "label": "process_keyword()", "type": "expression", "loc": [150, 150], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99803:FunctionDef_L138_C0", "vector": [8, 1, 0.9091, 0.0061, 1, 0.86, 1.0, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "process_keyword", "arg_names": [], "import_names": [], "rhs_call_name": "process_keyword", "annotation": ""}, "snippet": " process_keyword(test.teardown)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99803:FunctionDef_L152_C0", "label": "process_keyword", "type": "function", "loc": [152, 160], "level": 0, "parent": null, "vector": [2, 0, 0.9455, 0.0545, 0, 0.66, 0.9, 837, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "process_keyword", "arg_names": ["kw"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def process_keyword(kw):\n if kw is None:\n return\n kw.kws = kw.keywords\n kw.msgs = kw.messages\n kw.message_count = kw.msg_count = len(kw.messages)\n kw.keyword_count = kw.kw_count = len(kw.keywords)\n for subkw in kw.keywords:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99803:If_L153_C4", "label": "if", "type": "if", "loc": [153, 154], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99803:FunctionDef_L152_C0", "vector": [4, 1, 0.9303, 0.0121, 1, 0.96, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if kw is None:\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99803:Return_L154_C8", "label": "return", "type": "return", "loc": [154, 154], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99803:If_L153_C4", "vector": [13, 2, 0.9333, 0.0061, 2, 0.25, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99803:Assign_L155_C4", "label": "kw.kws =", "type": "assigned_variable", "loc": [155, 155], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99803:FunctionDef_L152_C0", "vector": [14, 1, 0.9394, 0.0061, 1, 0.96, 0.2, 939, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "kw.kws", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " kw.kws = kw.keywords"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99803:Assign_L156_C4", "label": "kw.msgs =", "type": "assigned_variable", "loc": [156, 156], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99803:FunctionDef_L152_C0", "vector": [14, 1, 0.9455, 0.0061, 1, 0.96, 0.4, 980, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "kw.msgs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " kw.msgs = kw.messages"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99803:Assign_L157_C4", "label": "kw.message_count = len()", "type": "assigned_variable", "loc": [157, 157], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99803:FunctionDef_L152_C0", "vector": [14, 1, 0.9515, 0.0061, 1, 0.96, 0.6, 487, 3, 1, 0, 0, 890, 10, 1], "semantic": {"name": "kw.message_count", "arg_names": [], "import_names": [], "rhs_call_name": "len", "annotation": ""}, "snippet": " kw.message_count = kw.msg_count = len(kw.messages)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99803:Assign_L158_C4", "label": "kw.keyword_count = len()", "type": "assigned_variable", "loc": [158, 158], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99803:FunctionDef_L152_C0", "vector": [14, 1, 0.9576, 0.0061, 1, 0.96, 0.8, 647, 3, 1, 0, 0, 890, 10, 1], "semantic": {"name": "kw.keyword_count", "arg_names": [], "import_names": [], "rhs_call_name": "len", "annotation": ""}, "snippet": " kw.keyword_count = kw.kw_count = len(kw.keywords)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99803:For_L159_C4", "label": "for subkw", "type": "for", "loc": [159, 160], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99803:FunctionDef_L152_C0", "vector": [6, 1, 0.9667, 0.0121, 1, 0.96, 1.0, 780, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "subkw", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for subkw in kw.keywords:\n process_keyword(subkw)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99803:Expr_L160_C8", "label": "process_keyword()", "type": "expression", "loc": [160, 160], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99803:For_L159_C4", "vector": [8, 2, 0.9697, 0.0061, 2, 0.87, 0.0, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "process_keyword", "arg_names": [], "import_names": [], "rhs_call_name": "process_keyword", "annotation": ""}, "snippet": " process_keyword(subkw)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99803:FunctionDef_L162_C0", "label": "process_errors", "type": "function", "loc": [162, 165], "level": 0, "parent": null, "vector": [2, 0, 0.9909, 0.0242, 0, 0.66, 1.0, 54, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "process_errors", "arg_names": ["errors"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def process_errors(errors):\n errors.msgs = errors.messages\n errors.message_count = errors.msg_count = len(errors.messages)\n return errors"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99803:Assign_L163_C4", "label": "errors.msgs =", "type": "assigned_variable", "loc": [163, 163], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99803:FunctionDef_L162_C0", "vector": [14, 1, 0.9879, 0.0061, 1, 0.38, 0.0, 152, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "errors.msgs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " errors.msgs = errors.messages"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99803:Assign_L164_C4", "label": "errors.message_count = len()", "type": "assigned_variable", "loc": [164, 164], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99803:FunctionDef_L162_C0", "vector": [14, 1, 0.9939, 0.0061, 1, 0.38, 0.5, 32, 3, 1, 0, 0, 890, 10, 1], "semantic": {"name": "errors.message_count", "arg_names": [], "import_names": [], "rhs_call_name": "len", "annotation": ""}, "snippet": " errors.message_count = errors.msg_count = len(errors.messages)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99803:Return_L165_C4", "label": "return", "type": "return", "loc": [165, 165], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99803:FunctionDef_L162_C0", "vector": [13, 1, 1.0, 0.0061, 1, 0.38, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return errors"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99803:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99803:FunctionDef_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99803:FunctionDef_L12_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99803:Assign_L13_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99803:FunctionDef_L12_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99803:Try_L14_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99803:Try_L14_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99803:Expr_L15_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99803:Try_L14_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99803:Assign_L16_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99803:FunctionDef_L12_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99803:Assign_L20_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99803:FunctionDef_L12_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99803:Expr_L21_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99803:FunctionDef_L12_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99803:Expr_L22_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99803:FunctionDef_L12_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99803:Expr_L23_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99803:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99803:FunctionDef_L25_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99803:FunctionDef_L25_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99803:Assign_L26_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99803:FunctionDef_L25_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99803:If_L27_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99803:If_L27_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99803:Return_L28_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99803:If_L27_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99803:If_L29_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99803:If_L29_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99803:Assign_L30_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99803:If_L29_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99803:Assign_L32_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99803:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99803:FunctionDef_L35_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99803:FunctionDef_L35_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99803:Assign_L36_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99803:FunctionDef_L35_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99803:For_L38_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99803:For_L38_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99803:Expr_L39_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99803:FunctionDef_L35_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99803:Return_L40_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99803:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99803:FunctionDef_L42_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99803:FunctionDef_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99803:Assign_L43_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99803:FunctionDef_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99803:If_L44_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99803:If_L44_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99803:Return_L45_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99803:If_L44_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99803:If_L46_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99803:If_L46_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99803:Assign_L47_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99803:If_L46_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99803:Assign_L49_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99803:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99803:FunctionDef_L52_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99803:FunctionDef_L52_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99803:Assign_L53_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99803:FunctionDef_L52_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99803:For_L54_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99803:For_L54_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99803:Expr_L55_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99803:FunctionDef_L52_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99803:Return_L56_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99803:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99803:FunctionDef_L58_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99803:FunctionDef_L58_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99803:Expr_L59_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99803:FunctionDef_L58_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99803:If_L69_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99803:If_L69_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99803:Assign_L70_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99803:FunctionDef_L58_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99803:If_L71_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99803:If_L71_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99803:Assign_L72_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99803:FunctionDef_L58_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99803:If_L74_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99803:If_L74_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99803:If_L75_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99803:If_L75_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99803:Assign_L76_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99803:If_L75_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99803:Assign_L79_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99803:FunctionDef_L58_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99803:If_L83_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99803:If_L83_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99803:Return_L84_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99803:FunctionDef_L58_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99803:If_L85_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99803:If_L85_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99803:Assign_L86_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99803:If_L85_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99803:If_L87_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99803:If_L87_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99803:Return_L88_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99803:FunctionDef_L58_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99803:If_L89_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99803:If_L89_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99803:Assign_L90_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99803:If_L89_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99803:If_L91_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99803:If_L89_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99803:If_L93_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99803:If_L93_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99803:Return_L94_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99803:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99803:FunctionDef_L101_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99803:FunctionDef_L101_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99803:Assign_L102_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99803:FunctionDef_L101_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99803:Assign_L103_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99803:FunctionDef_L101_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99803:Assign_L106_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99803:FunctionDef_L101_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99803:If_L107_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99803:FunctionDef_L101_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99803:For_L109_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99803:For_L109_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99803:If_L110_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99803:If_L110_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99803:Expr_L111_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99803:If_L110_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99803:Expr_L112_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99803:If_L110_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99803:Expr_L113_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99803:FunctionDef_L101_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99803:If_L117_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99803:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99803:FunctionDef_L120_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99803:FunctionDef_L120_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99803:Assign_L121_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99803:FunctionDef_L120_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99803:Return_L122_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99803:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99803:FunctionDef_L124_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99803:FunctionDef_L124_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99803:Return_L125_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99803:FunctionDef_L128_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99803:For_L129_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99803:For_L129_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99803:Expr_L130_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99803:FunctionDef_L128_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99803:For_L131_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99803:For_L131_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99803:Expr_L132_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99803:FunctionDef_L128_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99803:Assign_L133_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99803:FunctionDef_L128_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99803:Expr_L134_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99803:FunctionDef_L128_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99803:Expr_L135_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99803:FunctionDef_L128_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99803:Return_L136_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99803:FunctionDef_L138_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99803:If_L139_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99803:If_L139_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99803:Assign_L140_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99803:If_L139_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99803:Assign_L141_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99803:If_L139_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99803:Assign_L143_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99803:If_L139_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99803:Assign_L144_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99803:FunctionDef_L138_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99803:Assign_L145_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99803:FunctionDef_L138_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99803:Assign_L146_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99803:FunctionDef_L138_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99803:For_L147_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99803:For_L147_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99803:Expr_L148_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99803:FunctionDef_L138_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99803:Expr_L149_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99803:FunctionDef_L138_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99803:Expr_L150_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99803:FunctionDef_L152_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99803:If_L153_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99803:If_L153_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99803:Return_L154_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99803:FunctionDef_L152_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99803:Assign_L155_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99803:FunctionDef_L152_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99803:Assign_L156_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99803:FunctionDef_L152_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99803:Assign_L157_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99803:FunctionDef_L152_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99803:Assign_L158_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99803:FunctionDef_L152_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99803:For_L159_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99803:For_L159_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99803:Expr_L160_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99803:FunctionDef_L162_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99803:Assign_L163_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99803:FunctionDef_L162_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99803:Assign_L164_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99803:FunctionDef_L162_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99803:Return_L165_C4"}] |
import os.path
import robot
import tempfile
__all__ = ['robotpath', 'javatempdir', 'robotversion']
robotpath = os.path.abspath(os.path.dirname(robot.__file__))
javatempdir = tempfile.gettempdir() # Used to be different on OSX and elsewhere
robotversion = robot.version.get_version()
| ajibawa-2023/Python-Code-Large/train/row_99804 | 7 | 9 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99804:Import_L1_C0", "label": "os.path import os.path", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.1111, 0.1111, 0, 0.66, 0.0, 79, 0, 1, 0, 0, 79, 0, 0], "semantic": {"name": "os.path", "arg_names": [], "import_names": ["os.path"], "rhs_call_name": "", "annotation": ""}, "snippet": "import os.path"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99804:Import_L2_C0", "label": "robot import robot", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.2222, 0.1111, 0, 0.66, 0.1667, 735, 0, 1, 0, 0, 735, 0, 0], "semantic": {"name": "robot", "arg_names": [], "import_names": ["robot"], "rhs_call_name": "", "annotation": ""}, "snippet": "import robot"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99804:Import_L3_C0", "label": "tempfile import tempfile", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.3333, 0.1111, 0, 0.66, 0.3333, 516, 0, 1, 0, 0, 516, 0, 0], "semantic": {"name": "tempfile", "arg_names": [], "import_names": ["tempfile"], "rhs_call_name": "", "annotation": ""}, "snippet": "import tempfile"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99804:Assign_L5_C0", "label": "__all__ =", "type": "assigned_variable", "loc": [5, 5], "level": 0, "parent": null, "vector": [14, 0, 0.5556, 0.1111, 0, 0.66, 0.5, 272, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "__all__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "__all__ = ['robotpath', 'javatempdir', 'robotversion']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99804:Assign_L7_C0", "label": "robotpath = abspath()", "type": "assigned_variable", "loc": [7, 7], "level": 0, "parent": null, "vector": [14, 0, 0.7778, 0.1111, 0, 0.66, 0.6667, 605, 3, 1, 0, 0, 142, 10, 2], "semantic": {"name": "robotpath", "arg_names": [], "import_names": [], "rhs_call_name": "abspath", "annotation": ""}, "snippet": "robotpath = os.path.abspath(os.path.dirname(robot.__file__))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99804:Assign_L8_C0", "label": "javatempdir = gettempdir()", "type": "assigned_variable", "loc": [8, 8], "level": 0, "parent": null, "vector": [14, 0, 0.8889, 0.1111, 0, 0.66, 0.8333, 853, 3, 0, 0, 0, 435, 10, 1], "semantic": {"name": "javatempdir", "arg_names": [], "import_names": [], "rhs_call_name": "gettempdir", "annotation": ""}, "snippet": "javatempdir = tempfile.gettempdir() # Used to be different on OSX and elsewhere"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99804:Assign_L9_C0", "label": "robotversion = get_version()", "type": "assigned_variable", "loc": [9, 9], "level": 0, "parent": null, "vector": [14, 0, 1.0, 0.1111, 0, 0.66, 1.0, 917, 3, 0, 0, 0, 75, 10, 1], "semantic": {"name": "robotversion", "arg_names": [], "import_names": [], "rhs_call_name": "get_version", "annotation": ""}, "snippet": "robotversion = robot.version.get_version()"}] | [] |
message_list = [ u'Circle is 360\u00B0',
u'Hyv\u00E4\u00E4 \u00FC\u00F6t\u00E4',
u'\u0989\u09C4 \u09F0 \u09FA \u099F \u09EB \u09EA \u09B9' ]
message1 = message_list[0]
message2 = message_list[1]
message3 = message_list[2]
messages = ', '.join(message_list)
sect = unichr(167)
auml = unichr(228)
ouml = unichr(246)
uuml = unichr(252)
yuml = unichr(255)
| ajibawa-2023/Python-Code-Large/train/row_99805 | 10 | 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_99805:Assign_L1_C0", "label": "message_list =", "type": "assigned_variable", "loc": [1, 3], "level": 0, "parent": null, "vector": [14, 0, 0.1333, 0.2, 0, 0.66, 0.0, 656, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "message_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "message_list = [ u'Circle is 360\\u00B0',\n u'Hyv\\u00E4\\u00E4 \\u00FC\\u00F6t\\u00E4',\n u'\\u0989\\u09C4 \\u09F0 \\u09FA \\u099F \\u09EB \\u09EA \\u09B9' ]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99805:Assign_L5_C0", "label": "message1 =", "type": "assigned_variable", "loc": [5, 5], "level": 0, "parent": null, "vector": [14, 0, 0.3333, 0.0667, 0, 0.66, 0.1111, 880, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "message1", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "message1 = message_list[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99805:Assign_L6_C0", "label": "message2 =", "type": "assigned_variable", "loc": [6, 6], "level": 0, "parent": null, "vector": [14, 0, 0.4, 0.0667, 0, 0.66, 0.2222, 538, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "message2", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "message2 = message_list[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99805:Assign_L7_C0", "label": "message3 =", "type": "assigned_variable", "loc": [7, 7], "level": 0, "parent": null, "vector": [14, 0, 0.4667, 0.0667, 0, 0.66, 0.3333, 44, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "message3", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "message3 = message_list[2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99805:Assign_L9_C0", "label": "messages = join()", "type": "assigned_variable", "loc": [9, 9], "level": 0, "parent": null, "vector": [14, 0, 0.6, 0.0667, 0, 0.66, 0.4444, 312, 3, 1, 0, 0, 933, 10, 1], "semantic": {"name": "messages", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": "messages = ', '.join(message_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99805:Assign_L11_C0", "label": "sect = unichr()", "type": "assigned_variable", "loc": [11, 11], "level": 0, "parent": null, "vector": [14, 0, 0.7333, 0.0667, 0, 0.66, 0.5556, 480, 3, 1, 0, 0, 842, 10, 1], "semantic": {"name": "sect", "arg_names": [], "import_names": [], "rhs_call_name": "unichr", "annotation": ""}, "snippet": "sect = unichr(167)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99805:Assign_L12_C0", "label": "auml = unichr()", "type": "assigned_variable", "loc": [12, 12], "level": 0, "parent": null, "vector": [14, 0, 0.8, 0.0667, 0, 0.66, 0.6667, 144, 3, 1, 0, 0, 842, 10, 1], "semantic": {"name": "auml", "arg_names": [], "import_names": [], "rhs_call_name": "unichr", "annotation": ""}, "snippet": "auml = unichr(228)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99805:Assign_L13_C0", "label": "ouml = unichr()", "type": "assigned_variable", "loc": [13, 13], "level": 0, "parent": null, "vector": [14, 0, 0.8667, 0.0667, 0, 0.66, 0.7778, 604, 3, 1, 0, 0, 842, 10, 1], "semantic": {"name": "ouml", "arg_names": [], "import_names": [], "rhs_call_name": "unichr", "annotation": ""}, "snippet": "ouml = unichr(246)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99805:Assign_L14_C0", "label": "uuml = unichr()", "type": "assigned_variable", "loc": [14, 14], "level": 0, "parent": null, "vector": [14, 0, 0.9333, 0.0667, 0, 0.66, 0.8889, 545, 3, 1, 0, 0, 842, 10, 1], "semantic": {"name": "uuml", "arg_names": [], "import_names": [], "rhs_call_name": "unichr", "annotation": ""}, "snippet": "uuml = unichr(252)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99805:Assign_L15_C0", "label": "yuml = unichr()", "type": "assigned_variable", "loc": [15, 15], "level": 0, "parent": null, "vector": [14, 0, 1.0, 0.0667, 0, 0.66, 1.0, 209, 3, 1, 0, 0, 842, 10, 1], "semantic": {"name": "yuml", "arg_names": [], "import_names": [], "rhs_call_name": "unichr", "annotation": ""}, "snippet": "yuml = unichr(255)"}] | [] |
from xml.dom.minidom import parse
def parse_xunit(path):
return parse(path)
def get_root_element_name(dom):
return dom.documentElement.tagName
def get_element_count_by_name(dom, name):
return len(get_elements_by_name(dom, name))
def get_elements_by_name(dom, name):
return dom.getElementsByTagName(name) | ajibawa-2023/Python-Code-Large/train/row_99806 | 9 | 13 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99806:ImportFrom_L1_C0", "label": "from xml.dom.minidom import parse", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0769, 0.0769, 0, 0.66, 0.0, 770, 0, 1, 0, 0, 770, 0, 0], "semantic": {"name": "xml.dom.minidom", "arg_names": [], "import_names": ["parse"], "rhs_call_name": "", "annotation": ""}, "snippet": "from xml.dom.minidom import parse"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99806:FunctionDef_L3_C0", "label": "parse_xunit", "type": "function", "loc": [3, 4], "level": 0, "parent": null, "vector": [2, 0, 0.2692, 0.1538, 0, 0.66, 0.25, 889, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "parse_xunit", "arg_names": ["path"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def parse_xunit(path):\n return parse(path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99806:Return_L4_C4", "label": "return", "type": "return", "loc": [4, 4], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99806:FunctionDef_L3_C0", "vector": [13, 1, 0.3077, 0.0769, 1, 0.39, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return parse(path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99806:FunctionDef_L6_C0", "label": "get_root_element_name", "type": "function", "loc": [6, 7], "level": 0, "parent": null, "vector": [2, 0, 0.5, 0.1538, 0, 0.66, 0.5, 16, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "get_root_element_name", "arg_names": ["dom"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def get_root_element_name(dom):\n return dom.documentElement.tagName"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99806:Return_L7_C4", "label": "return", "type": "return", "loc": [7, 7], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99806:FunctionDef_L6_C0", "vector": [13, 1, 0.5385, 0.0769, 1, 0.57, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return dom.documentElement.tagName"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99806:FunctionDef_L9_C0", "label": "get_element_count_by_name", "type": "function", "loc": [9, 10], "level": 0, "parent": null, "vector": [2, 0, 0.7308, 0.1538, 0, 0.66, 0.75, 54, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "get_element_count_by_name", "arg_names": ["dom", "name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def get_element_count_by_name(dom, name):\n return len(get_elements_by_name(dom, name))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99806:Return_L10_C4", "label": "return", "type": "return", "loc": [10, 10], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99806:FunctionDef_L9_C0", "vector": [13, 1, 0.7692, 0.0769, 1, 0.37, 0.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return len(get_elements_by_name(dom, name))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99806:FunctionDef_L12_C0", "label": "get_elements_by_name", "type": "function", "loc": [12, 13], "level": 0, "parent": null, "vector": [2, 0, 0.9615, 0.1538, 0, 0.66, 1.0, 136, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "get_elements_by_name", "arg_names": ["dom", "name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def get_elements_by_name(dom, name):\n return dom.getElementsByTagName(name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99806:Return_L13_C4", "label": "return", "type": "return", "loc": [13, 13], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99806:FunctionDef_L12_C0", "vector": [13, 1, 1.0, 0.0769, 1, 0.82, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return dom.getElementsByTagName(name)"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99806:FunctionDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99806:Return_L4_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99806:FunctionDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99806:Return_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99806:FunctionDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99806:Return_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99806:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99806:Return_L13_C4"}] |
import os
import sys
from stat import S_IREAD, S_IWRITE
class TestHelper:
def set_read_only(self, path):
os.chmod(path, S_IREAD)
def set_read_write(self, path):
os.chmod(path, S_IREAD | S_IWRITE)
def get_output_name(self, *datasources):
if not datasources:
raise RuntimeError('One or more data sources must be given!')
if len(datasources) == 1:
return self._get_name(datasources[0])
return '_'.join(self._get_name(source) for source in datasources)
def _get_name(self, path):
return os.path.splitext(os.path.basename(path))[0]
def should_contain_item_x_times(self, string, item, count):
if string.count(item) != int(count):
raise AssertionError("'%s' does not contain '%s' '%s' "
"times!" % (string, item, count))
def get_splitted_full_name(self, full_name, splitlevel):
splitlevel = int(splitlevel)
parts = full_name.split('.')
if splitlevel > 0 and splitlevel <= len(parts):
parts = parts[splitlevel:]
return '.'.join(parts)
def running_on_jython(self, interpreter):
return 'jython' in interpreter
def running_on_python(self, interpreter):
return not self.running_on_jython(interpreter)
def running_on_linux(self):
return 'linux' in sys.platform | ajibawa-2023/Python-Code-Large/train/row_99807 | 29 | 43 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99807:Import_L1_C0", "label": "os import os", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0233, 0.0233, 0, 0.66, 0.0, 688, 0, 1, 0, 0, 688, 0, 0], "semantic": {"name": "os", "arg_names": [], "import_names": ["os"], "rhs_call_name": "", "annotation": ""}, "snippet": "import os"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99807:Import_L2_C0", "label": "sys import sys", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0465, 0.0233, 0, 0.66, 0.3333, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sys"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99807:ImportFrom_L3_C0", "label": "from stat import S_IREAD, S_IWRITE", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0698, 0.0233, 0, 0.66, 0.6667, 48, 0, 2, 0, 0, 48, 0, 0], "semantic": {"name": "stat", "arg_names": [], "import_names": ["S_IREAD", "S_IWRITE"], "rhs_call_name": "", "annotation": ""}, "snippet": "from stat import S_IREAD, S_IWRITE"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99807:ClassDef_L6_C0", "label": "TestHelper", "type": "class", "loc": [6, 43], "level": 0, "parent": null, "vector": [3, 0, 0.5698, 0.8837, 0, 0.66, 1.0, 811, 0, 9, 0, 0, 0, 0, 17], "semantic": {"name": "TestHelper", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class TestHelper:\n \n def set_read_only(self, path):\n os.chmod(path, S_IREAD)\n\n def set_read_write(self, path):\n os.chmod(path, S_IREAD | S_IWRITE)\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99807:FunctionDef_L8_C4", "label": "set_read_only", "type": "function", "loc": [8, 9], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99807:ClassDef_L6_C0", "vector": [2, 1, 0.1977, 0.0465, 1, 0.69, 0.0, 185, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "set_read_only", "arg_names": ["self", "path"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def set_read_only(self, path):\n os.chmod(path, S_IREAD)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99807:Expr_L9_C8", "label": "chmod()", "type": "expression", "loc": [9, 9], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99807:FunctionDef_L8_C4", "vector": [8, 2, 0.2093, 0.0233, 2, 0.25, 0.0, 408, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "chmod", "arg_names": [], "import_names": [], "rhs_call_name": "chmod", "annotation": ""}, "snippet": " os.chmod(path, S_IREAD)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99807:FunctionDef_L11_C4", "label": "set_read_write", "type": "function", "loc": [11, 12], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99807:ClassDef_L6_C0", "vector": [2, 1, 0.2674, 0.0465, 1, 0.69, 0.125, 873, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "set_read_write", "arg_names": ["self", "path"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def set_read_write(self, path):\n os.chmod(path, S_IREAD | S_IWRITE)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99807:Expr_L12_C8", "label": "chmod()", "type": "expression", "loc": [12, 12], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99807:FunctionDef_L11_C4", "vector": [8, 2, 0.2791, 0.0233, 2, 0.1, 0.0, 408, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "chmod", "arg_names": [], "import_names": [], "rhs_call_name": "chmod", "annotation": ""}, "snippet": " os.chmod(path, S_IREAD | S_IWRITE)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99807:FunctionDef_L14_C4", "label": "get_output_name", "type": "function", "loc": [14, 19], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99807:ClassDef_L6_C0", "vector": [2, 1, 0.3837, 0.1395, 1, 0.69, 0.25, 779, 0, 2, 1, 0, 0, 0, 5], "semantic": {"name": "get_output_name", "arg_names": ["self", "datasources"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_output_name(self, *datasources):\n if not datasources:\n raise RuntimeError('One or more data sources must be given!')\n if len(datasources) == 1:\n return self._get_name(datasources[0])\n return '_'.join(self._get_name(source) for source in datasources)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99807:If_L15_C8", "label": "if", "type": "if", "loc": [15, 16], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99807:FunctionDef_L14_C4", "vector": [4, 2, 0.3605, 0.0465, 2, 0.94, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not datasources:\n raise RuntimeError('One or more data sources must be given!')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99807:If_L17_C8", "label": "if", "type": "if", "loc": [17, 18], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99807:FunctionDef_L14_C4", "vector": [4, 2, 0.407, 0.0465, 2, 0.94, 0.5, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(datasources) == 1:\n return self._get_name(datasources[0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99807:Return_L18_C12", "label": "return", "type": "return", "loc": [18, 18], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99807:If_L17_C8", "vector": [13, 3, 0.4186, 0.0233, 3, 0.79, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._get_name(datasources[0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99807:Return_L19_C8", "label": "return", "type": "return", "loc": [19, 19], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99807:FunctionDef_L14_C4", "vector": [13, 2, 0.4419, 0.0233, 2, 0.94, 1.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return '_'.join(self._get_name(source) for source in datasources)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99807:FunctionDef_L21_C4", "label": "_get_name", "type": "function", "loc": [21, 22], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99807:ClassDef_L6_C0", "vector": [2, 1, 0.5, 0.0465, 1, 0.69, 0.375, 340, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "_get_name", "arg_names": ["self", "path"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _get_name(self, path):\n return os.path.splitext(os.path.basename(path))[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99807:Return_L22_C8", "label": "return", "type": "return", "loc": [22, 22], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99807:FunctionDef_L21_C4", "vector": [13, 2, 0.5116, 0.0233, 2, 0.5, 0.0, 0, 6, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return os.path.splitext(os.path.basename(path))[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99807:FunctionDef_L24_C4", "label": "should_contain_item_x_times", "type": "function", "loc": [24, 27], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99807:ClassDef_L6_C0", "vector": [2, 1, 0.593, 0.093, 1, 0.69, 0.5, 596, 0, 4, 0, 0, 0, 0, 3], "semantic": {"name": "should_contain_item_x_times", "arg_names": ["self", "string", "item", "count"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def should_contain_item_x_times(self, string, item, count):\n if string.count(item) != int(count):\n raise AssertionError(\"'%s' does not contain '%s' '%s' \"\n \"times!\" % (string, item, count))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99807:If_L25_C8", "label": "if", "type": "if", "loc": [25, 27], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99807:FunctionDef_L24_C4", "vector": [4, 2, 0.6047, 0.0698, 2, 0.02, 0.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if string.count(item) != int(count):\n raise AssertionError(\"'%s' does not contain '%s' '%s' \"\n \"times!\" % (string, item, count))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99807:FunctionDef_L29_C4", "label": "get_splitted_full_name", "type": "function", "loc": [29, 34], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99807:ClassDef_L6_C0", "vector": [2, 1, 0.7326, 0.1395, 1, 0.69, 0.625, 715, 0, 3, 1, 0, 0, 0, 4], "semantic": {"name": "get_splitted_full_name", "arg_names": ["self", "full_name", "splitlevel"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_splitted_full_name(self, full_name, splitlevel):\n splitlevel = int(splitlevel)\n parts = full_name.split('.')\n if splitlevel > 0 and splitlevel <= len(parts):\n parts = parts[splitlevel:]\n return '.'.join(parts)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99807:Assign_L30_C8", "label": "splitlevel = int()", "type": "assigned_variable", "loc": [30, 30], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99807:FunctionDef_L29_C4", "vector": [14, 2, 0.6977, 0.0233, 2, 0.33, 0.0, 407, 3, 1, 0, 0, 901, 10, 1], "semantic": {"name": "splitlevel", "arg_names": [], "import_names": [], "rhs_call_name": "int", "annotation": ""}, "snippet": " splitlevel = int(splitlevel)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99807:Assign_L31_C8", "label": "parts = split()", "type": "assigned_variable", "loc": [31, 31], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99807:FunctionDef_L29_C4", "vector": [14, 2, 0.7209, 0.0233, 2, 0.33, 0.3333, 13, 3, 1, 0, 0, 908, 10, 1], "semantic": {"name": "parts", "arg_names": [], "import_names": [], "rhs_call_name": "split", "annotation": ""}, "snippet": " parts = full_name.split('.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99807:If_L32_C8", "label": "if", "type": "if", "loc": [32, 33], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99807:FunctionDef_L29_C4", "vector": [4, 2, 0.7558, 0.0465, 2, 0.33, 0.6667, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if splitlevel > 0 and splitlevel <= len(parts):\n parts = parts[splitlevel:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99807:Assign_L33_C12", "label": "parts =", "type": "assigned_variable", "loc": [33, 33], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99807:If_L32_C8", "vector": [14, 3, 0.7674, 0.0233, 3, 0.86, 0.0, 13, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "parts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " parts = parts[splitlevel:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99807:Return_L34_C8", "label": "return", "type": "return", "loc": [34, 34], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99807:FunctionDef_L29_C4", "vector": [13, 2, 0.7907, 0.0233, 2, 0.33, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return '.'.join(parts)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99807:FunctionDef_L36_C4", "label": "running_on_jython", "type": "function", "loc": [36, 37], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99807:ClassDef_L6_C0", "vector": [2, 1, 0.8488, 0.0465, 1, 0.69, 0.75, 337, 0, 2, 1, 0, 0, 0, 0], "semantic": {"name": "running_on_jython", "arg_names": ["self", "interpreter"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def running_on_jython(self, interpreter):\n return 'jython' in interpreter"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99807:Return_L37_C8", "label": "return", "type": "return", "loc": [37, 37], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99807:FunctionDef_L36_C4", "vector": [13, 2, 0.8605, 0.0233, 2, 0.3, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 'jython' in interpreter"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99807:FunctionDef_L39_C4", "label": "running_on_python", "type": "function", "loc": [39, 40], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99807:ClassDef_L6_C0", "vector": [2, 1, 0.9186, 0.0465, 1, 0.69, 0.875, 653, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "running_on_python", "arg_names": ["self", "interpreter"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def running_on_python(self, interpreter):\n return not self.running_on_jython(interpreter)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99807:Return_L40_C8", "label": "return", "type": "return", "loc": [40, 40], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99807:FunctionDef_L39_C4", "vector": [13, 2, 0.9302, 0.0233, 2, 0.5, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return not self.running_on_jython(interpreter)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99807:FunctionDef_L42_C4", "label": "running_on_linux", "type": "function", "loc": [42, 43], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99807:ClassDef_L6_C0", "vector": [2, 1, 0.9884, 0.0465, 1, 0.69, 1.0, 78, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "running_on_linux", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def running_on_linux(self):\n return 'linux' in sys.platform"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99807:Return_L43_C8", "label": "return", "type": "return", "loc": [43, 43], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99807:FunctionDef_L42_C4", "vector": [13, 2, 1.0, 0.0233, 2, 0.98, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 'linux' in sys.platform"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99807:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99807:FunctionDef_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99807:FunctionDef_L8_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99807:Expr_L9_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99807:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99807:FunctionDef_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99807:FunctionDef_L11_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99807:Expr_L12_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99807:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99807:FunctionDef_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99807:FunctionDef_L14_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99807:If_L15_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99807:FunctionDef_L14_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99807:If_L17_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99807:If_L17_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99807:Return_L18_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99807:FunctionDef_L14_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99807:Return_L19_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99807:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99807:FunctionDef_L21_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99807:FunctionDef_L21_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99807:Return_L22_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99807:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99807:FunctionDef_L24_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99807:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99807:If_L25_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99807:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99807:FunctionDef_L29_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99807:FunctionDef_L29_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99807:Assign_L30_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99807:FunctionDef_L29_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99807:Assign_L31_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99807:FunctionDef_L29_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99807:If_L32_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99807:If_L32_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99807:Assign_L33_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99807:FunctionDef_L29_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99807:Return_L34_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99807:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99807:FunctionDef_L36_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99807:FunctionDef_L36_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99807:Return_L37_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99807:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99807:FunctionDef_L39_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99807:FunctionDef_L39_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99807:Return_L40_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99807:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99807:FunctionDef_L42_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99807:FunctionDef_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99807:Return_L43_C8"}] |
#!/usr/bin/env python
"""Script to generate atest runners based on data files.
Usage: %s path/to/data.file
"""
from __future__ import with_statement
import sys, os
if len(sys.argv) != 2:
print __doc__ % os.path.basename(sys.argv[0])
sys.exit(1)
inpath = os.path.abspath(sys.argv[1])
outpath = inpath.replace(os.path.join('atest', 'testdata'),
os.path.join('atest', 'robot'))
dirname = os.path.dirname(outpath)
if not os.path.exists(dirname):
os.mkdir(dirname)
with open(inpath) as input:
tests = []
process = False
for line in input.readlines():
line = line.rstrip()
if line.startswith('*'):
name = line.replace('*', '').replace(' ', '').upper()
process = name in ('TESTCASE', 'TESTCASES')
elif process and line and line[0] != ' ':
tests.append(line.split(' ')[0])
with open(outpath, 'w') as output:
path = inpath.split(os.path.join('atest', 'testdata'))[1][1:]
output.write("""*** Settings ***
Suite Setup Run Tests ${EMPTY} %s
Force Tags regression pybot jybot
Resource atest_resource.txt
*** Test Cases ***
""" % path.replace(os.sep, '/'))
for test in tests:
output.write(test + '\n Check Test Case ${TESTNAME}\n\n')
print outpath
| ajibawa-2023/Python-Code-Large/train/row_99808 | 25 | 47 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99808:Expr_L3_C0", "label": "expression", "type": "expression", "loc": [3, 6], "level": 0, "parent": null, "vector": [8, 0, 0.0957, 0.0851, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\"\"\"Script to generate atest runners based on data files.\n\nUsage: %s path/to/data.file\n\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99808:ImportFrom_L8_C0", "label": "from __future__ import with_statement", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.1702, 0.0213, 0, 0.66, 0.125, 777, 0, 1, 0, 0, 777, 0, 0], "semantic": {"name": "__future__", "arg_names": [], "import_names": ["with_statement"], "rhs_call_name": "", "annotation": ""}, "snippet": "from __future__ import with_statement"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99808:Import_L9_C0", "label": "sys import sys, os", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.1915, 0.0213, 0, 0.66, 0.25, 509, 0, 2, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys", "os"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sys, os"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99808:If_L11_C0", "label": "if", "type": "if", "loc": [11, 13], "level": 0, "parent": null, "vector": [4, 0, 0.2553, 0.0638, 0, 0.66, 0.375, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if len(sys.argv) != 2:\n print(__doc__ % os.path.basename(sys.argv[0]))\n sys.exit(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99808:Expr_L12_C4", "label": "print()", "type": "expression", "loc": [12, 12], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99808:If_L11_C0", "vector": [8, 1, 0.2553, 0.0213, 1, 0.88, 0.0, 535, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(__doc__ % os.path.basename(sys.argv[0]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99808:Expr_L13_C4", "label": "exit()", "type": "expression", "loc": [13, 13], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99808:If_L11_C0", "vector": [8, 1, 0.2766, 0.0213, 1, 0.88, 1.0, 436, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "exit", "arg_names": [], "import_names": [], "rhs_call_name": "exit", "annotation": ""}, "snippet": " sys.exit(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99808:Assign_L15_C0", "label": "inpath = abspath()", "type": "assigned_variable", "loc": [15, 15], "level": 0, "parent": null, "vector": [14, 0, 0.3191, 0.0213, 0, 0.66, 0.5, 95, 3, 1, 0, 0, 142, 10, 1], "semantic": {"name": "inpath", "arg_names": [], "import_names": [], "rhs_call_name": "abspath", "annotation": ""}, "snippet": "inpath = os.path.abspath(sys.argv[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99808:Assign_L16_C0", "label": "outpath = replace()", "type": "assigned_variable", "loc": [16, 17], "level": 0, "parent": null, "vector": [14, 0, 0.3511, 0.0426, 0, 0.66, 0.625, 74, 3, 2, 0, 0, 293, 10, 3], "semantic": {"name": "outpath", "arg_names": [], "import_names": [], "rhs_call_name": "replace", "annotation": ""}, "snippet": "outpath = inpath.replace(os.path.join('atest', 'testdata'), \n os.path.join('atest', 'robot'))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99808:Assign_L19_C0", "label": "dirname = dirname()", "type": "assigned_variable", "loc": [19, 19], "level": 0, "parent": null, "vector": [14, 0, 0.4043, 0.0213, 0, 0.66, 0.75, 959, 3, 1, 0, 0, 959, 10, 1], "semantic": {"name": "dirname", "arg_names": [], "import_names": [], "rhs_call_name": "dirname", "annotation": ""}, "snippet": "dirname = os.path.dirname(outpath)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99808:If_L20_C0", "label": "if", "type": "if", "loc": [20, 21], "level": 0, "parent": null, "vector": [4, 0, 0.4362, 0.0426, 0, 0.66, 0.875, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if not os.path.exists(dirname):\n os.mkdir(dirname)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99808:Expr_L21_C4", "label": "mkdir()", "type": "expression", "loc": [21, 21], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99808:If_L20_C0", "vector": [8, 1, 0.4468, 0.0213, 1, 0.71, 0.0, 853, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "mkdir", "arg_names": [], "import_names": [], "rhs_call_name": "mkdir", "annotation": ""}, "snippet": " os.mkdir(dirname)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99808:Assign_L24_C4", "label": "tests =", "type": "assigned_variable", "loc": [24, 24], "level": 0, "parent": null, "vector": [14, 0, 0.5106, 0.0213, 0, 0.66, 0.0, 416, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "tests", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tests = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99808:Assign_L25_C4", "label": "process =", "type": "assigned_variable", "loc": [25, 25], "level": 0, "parent": null, "vector": [14, 0, 0.5319, 0.0213, 0, 0.66, 0.5, 712, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "process", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " process = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99808:For_L26_C4", "label": "for line", "type": "for", "loc": [26, 32], "level": 0, "parent": null, "vector": [6, 0, 0.617, 0.1489, 0, 0.66, 1.0, 373, 3, 0, 0, 0, 0, 0, 8], "semantic": {"name": "line", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for line in input.readlines():\n line = line.rstrip()\n if line.startswith('*'):\n name = line.replace('*', '').replace(' ', '').upper()\n process = name in ('TESTCASE', 'TESTCASES')\n elif process and line and line[0] != ' ':\n tests.append(line.split(' ')[0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99808:Assign_L27_C8", "label": "line = rstrip()", "type": "assigned_variable", "loc": [27, 27], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99808:For_L26_C4", "vector": [14, 1, 0.5745, 0.0213, 1, 0.67, 0.0, 373, 3, 0, 0, 0, 807, 10, 1], "semantic": {"name": "line", "arg_names": [], "import_names": [], "rhs_call_name": "rstrip", "annotation": ""}, "snippet": " line = line.rstrip()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99808:If_L28_C8", "label": "if", "type": "if", "loc": [28, 32], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99808:For_L26_C4", "vector": [4, 1, 0.6383, 0.1064, 1, 0.67, 1.0, 0, 3, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if line.startswith('*'):\n name = line.replace('*', '').replace(' ', '').upper()\n process = name in ('TESTCASE', 'TESTCASES')\n elif process and line and line[0] != ' ':\n tests.append(line.split(' ')[0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99808:Assign_L29_C12", "label": "name = upper()", "type": "assigned_variable", "loc": [29, 29], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99808:If_L28_C8", "vector": [14, 2, 0.617, 0.0213, 2, 0.14, 0.0, 57, 3, 0, 0, 0, 347, 10, 3], "semantic": {"name": "name", "arg_names": [], "import_names": [], "rhs_call_name": "upper", "annotation": ""}, "snippet": " name = line.replace('*', '').replace(' ', '').upper()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99808:Assign_L30_C12", "label": "process =", "type": "assigned_variable", "loc": [30, 30], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99808:If_L28_C8", "vector": [14, 2, 0.6383, 0.0213, 2, 0.14, 0.5, 712, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "process", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " process = name in ('TESTCASE', 'TESTCASES')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99808:If_L31_C8", "label": "if", "type": "if", "loc": [31, 32], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99808:If_L28_C8", "vector": [4, 2, 0.6702, 0.0426, 2, 0.14, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif process and line and line[0] != ' ':\n tests.append(line.split(' ')[0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99808:Expr_L32_C12", "label": "append()", "type": "expression", "loc": [32, 32], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99808:If_L31_C8", "vector": [8, 3, 0.6809, 0.0213, 3, 0.22, 0.0, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " tests.append(line.split(' ')[0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99808:Assign_L35_C4", "label": "path =", "type": "assigned_variable", "loc": [35, 35], "level": 0, "parent": null, "vector": [14, 0, 0.7447, 0.0213, 0, 0.66, 0.0, 358, 6, 0, 0, 0, 0, 0, 2], "semantic": {"name": "path", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " path = inpath.split(os.path.join('atest', 'testdata'))[1][1:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99808:Expr_L36_C4", "label": "write()", "type": "expression", "loc": [36, 43], "level": 0, "parent": null, "vector": [8, 0, 0.8404, 0.1702, 0, 0.66, 0.5, 837, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " output.write(\"\"\"*** Settings ***\nSuite Setup Run Tests ${EMPTY} %s\nForce Tags regression pybot jybot\nResource atest_resource.txt\n\n*** Test Cases ***\n\n\"\"\" % path.replace(os.sep, '/'))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99808:For_L44_C4", "label": "for test", "type": "for", "loc": [44, 45], "level": 0, "parent": null, "vector": [6, 0, 0.9468, 0.0426, 0, 0.66, 1.0, 224, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "test", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for test in tests:\n output.write(test + '\\n Check Test Case ${TESTNAME}\\n\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99808:Expr_L45_C8", "label": "write()", "type": "expression", "loc": [45, 45], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99808:For_L44_C4", "vector": [8, 1, 0.9574, 0.0213, 1, 0.18, 0.0, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " output.write(test + '\\n Check Test Case ${TESTNAME}\\n\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99808:Expr_L47_C0", "label": "print()", "type": "expression", "loc": [47, 47], "level": 0, "parent": null, "vector": [8, 0, 1.0, 0.0213, 0, 0.66, 1.25, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "print(outpath)"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99808:If_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99808:Expr_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99808:If_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99808:Expr_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99808:If_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99808:Expr_L21_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99808:For_L26_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99808:Assign_L27_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99808:For_L26_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99808:If_L28_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99808:If_L28_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99808:Assign_L29_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99808:If_L28_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99808:Assign_L30_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99808:If_L28_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99808:If_L31_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99808:If_L31_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99808:Expr_L32_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99808:For_L44_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99808:Expr_L45_C8"}] |
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import inspect
import sys
from robot import utils
from robot.errors import DataError
from outputcapture import OutputCapturer
from runkwregister import RUN_KW_REGISTER
from keywords import Keywords, Keyword
from arguments import (PythonKeywordArguments, JavaKeywordArguments,
DynamicKeywordArguments, RunKeywordArguments,
PythonInitArguments, JavaInitArguments)
from signalhandler import STOP_SIGNAL_MONITOR
if utils.is_jython:
from org.python.core import PyReflectedFunction, PyReflectedConstructor
def _is_java_init(init):
return isinstance(init, PyReflectedConstructor)
def _is_java_method(method):
return hasattr(method, 'im_func') \
and isinstance(method.im_func, PyReflectedFunction)
else:
_is_java_init = _is_java_method = lambda item: False
def Handler(library, name, method):
if RUN_KW_REGISTER.is_run_keyword(library.orig_name, name):
return _RunKeywordHandler(library, name, method)
if _is_java_method(method):
return _JavaHandler(library, name, method)
else:
return _PythonHandler(library, name, method)
def DynamicHandler(library, name, method, doc, argspec):
if RUN_KW_REGISTER.is_run_keyword(library.orig_name, name):
return _DynamicRunKeywordHandler(library, name, method, doc, argspec)
return _DynamicHandler(library, name, method, doc, argspec)
def InitHandler(library, method):
if method is None:
method = lambda: None
Init = _PythonInitHandler if not _is_java_init(method) else _JavaInitHandler
return Init(library, '__init__', method)
class _BaseHandler(object):
type = 'library'
doc = ''
def __init__(self, library, handler_name, handler_method):
self.library = library
self.name = utils.printable_name(handler_name, code_style=True)
self.arguments = self._parse_arguments(handler_method)
def _parse_arguments(self, handler_method):
raise NotImplementedError(self.__class__.__name__)
@property
def longname(self):
return '%s.%s' % (self.library.name, self.name)
@property
def shortdoc(self):
return self.doc.splitlines()[0] if self.doc else ''
class _RunnableHandler(_BaseHandler):
def __init__(self, library, handler_name, handler_method):
_BaseHandler.__init__(self, library, handler_name, handler_method)
self._handler_name = handler_name
self._method = self._get_initial_handler(library, handler_name,
handler_method)
def _get_initial_handler(self, library, name, method):
if library.scope == 'GLOBAL':
return self._get_global_handler(method, name)
return None
def init_keyword(self, varz):
pass
def run(self, context, args):
if context.dry_run:
return self._dry_run(context, args)
return self._run(context, args)
def _dry_run(self, context, args):
self.arguments.check_arg_limits_for_dry_run(args)
return None
def _run(self, context, args):
output = context.output
positional, named = \
self.arguments.resolve(args, context.get_current_vars(), output)
runner = self._runner_for(self._current_handler(), output, positional,
named, self._get_timeout(context.namespace))
return self._run_with_output_captured_and_signal_monitor(runner, context)
def _runner_for(self, handler, output, positional, named, timeout):
if timeout and timeout.active:
output.debug(timeout.get_message())
return lambda: timeout.run(handler, args=positional, kwargs=named)
return lambda: handler(*positional, **named)
def _run_with_output_captured_and_signal_monitor(self, runner, context):
capturer = OutputCapturer()
try:
return self._run_with_signal_monitoring(runner, context)
finally:
stdout, stderr = capturer.release()
context.output.log_output(stdout)
context.output.log_output(stderr)
if stderr:
sys.__stderr__.write(stderr+'\n')
def _run_with_signal_monitoring(self, runner, context):
try:
STOP_SIGNAL_MONITOR.start_running_keyword(context.teardown)
return runner()
finally:
STOP_SIGNAL_MONITOR.stop_running_keyword()
def _current_handler(self):
if self._method:
return self._method
return self._get_handler(self.library.get_instance(),
self._handler_name)
def _get_global_handler(self, method, name):
return method
def _get_handler(self, lib_instance, handler_name):
return getattr(lib_instance, handler_name)
def _get_timeout(self, namespace):
timeoutable = self._get_timeoutable_items(namespace)
if timeoutable:
return min(item.timeout for item in timeoutable)
return None
def _get_timeoutable_items(self, namespace):
items = namespace.uk_handlers[:]
if self._test_running_and_not_in_teardown(namespace.test):
items.append(namespace.test)
return items
def _test_running_and_not_in_teardown(self, test):
return test and test.status == 'RUNNING'
class _PythonHandler(_RunnableHandler):
def __init__(self, library, handler_name, handler_method):
_RunnableHandler.__init__(self, library, handler_name, handler_method)
self.doc = inspect.getdoc(handler_method) or ''
def _parse_arguments(self, handler_method):
return PythonKeywordArguments(handler_method, self.longname)
class _JavaHandler(_RunnableHandler):
def _parse_arguments(self, handler_method):
return JavaKeywordArguments(handler_method, self.longname)
class _DynamicHandler(_RunnableHandler):
def __init__(self, library, handler_name, handler_method, doc='',
argspec=None):
self._argspec = argspec
_RunnableHandler.__init__(self, library, handler_name, handler_method)
self._run_keyword_method_name = handler_method.__name__
self.doc = doc is not None and utils.unic(doc) or ''
def _parse_arguments(self, handler_method):
return DynamicKeywordArguments(self._argspec, self.longname)
def _get_handler(self, lib_instance, handler_name):
runner = getattr(lib_instance, self._run_keyword_method_name)
return self._get_dynamic_handler(runner, handler_name)
def _get_global_handler(self, method, name):
return self._get_dynamic_handler(method, name)
def _get_dynamic_handler(self, runner, name):
def handler(*args):
return runner(name, list(args))
return handler
class _RunKeywordHandler(_PythonHandler):
def __init__(self, library, handler_name, handler_method):
_PythonHandler.__init__(self, library, handler_name, handler_method)
self._handler_method = handler_method
def _run_with_signal_monitoring(self, runner, context):
# With run keyword variants, only the keyword to be run can fail
# and therefore monitoring should not raise exception yet.
return runner()
def _parse_arguments(self, handler_method):
arg_index = RUN_KW_REGISTER.get_args_to_process(self.library.orig_name,
self.name)
return RunKeywordArguments(handler_method, self.longname, arg_index)
def _get_timeout(self, namespace):
return None
def _dry_run(self, context, args):
_RunnableHandler._dry_run(self, context, args)
keywords = self._get_runnable_keywords(context, args)
keywords.run(context)
def _get_runnable_keywords(self, context, args):
keywords = Keywords([])
for keyword in self._get_keywords(args):
if self._variable_syntax_in(keyword.name, context):
continue
keywords.add_keyword(keyword)
return keywords
def _get_keywords(self, args):
arg_names = self.arguments.names
if 'name' in arg_names:
name_index = arg_names.index('name')
return [ Keyword(args[name_index], args[name_index+1:]) ]
elif self.arguments.varargs == 'names':
return [ Keyword(name, []) for name in args[len(arg_names):] ]
return []
def _variable_syntax_in(self, kw_name, context):
try:
resolved = context.namespace.variables.replace_string(kw_name)
#Variable can contain value, but it might be wrong,
#therefore it cannot be returned
return resolved != kw_name
except DataError:
return True
class _XTimesHandler(_RunKeywordHandler):
def __init__(self, handler, name):
_RunKeywordHandler.__init__(self, handler.library, handler.name,
handler._handler_method)
self.name = name
self.doc = "*DEPRECATED* Replace X times syntax with 'Repeat Keyword'."
def run(self, context, args):
resolved_times = context.namespace.variables.replace_string(self.name)
_RunnableHandler.run(self, context, [resolved_times] + args)
@property
def longname(self):
return self.name
class _DynamicRunKeywordHandler(_DynamicHandler, _RunKeywordHandler):
_parse_arguments = _RunKeywordHandler._parse_arguments
_get_timeout = _RunKeywordHandler._get_timeout
class _PythonInitHandler(_PythonHandler):
def _parse_arguments(self, handler_method):
return PythonInitArguments(handler_method, self.library.name)
class _JavaInitHandler(_BaseHandler):
def _parse_arguments(self, handler_method):
return JavaInitArguments(handler_method, self.library.name)
| ajibawa-2023/Python-Code-Large/train/row_99810 | 183 | 292 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99810:Import_L15_C0", "label": "inspect import inspect", "type": "import", "loc": [15, 15], "level": 0, "parent": null, "vector": [1, 0, 0.0514, 0.0034, 0, 0.66, 0.0, 878, 0, 1, 0, 0, 878, 0, 0], "semantic": {"name": "inspect", "arg_names": [], "import_names": ["inspect"], "rhs_call_name": "", "annotation": ""}, "snippet": "import inspect"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:Import_L16_C0", "label": "sys import sys", "type": "import", "loc": [16, 16], "level": 0, "parent": null, "vector": [1, 0, 0.0548, 0.0034, 0, 0.66, 0.0455, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sys"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:ImportFrom_L18_C0", "label": "from robot import utils", "type": "import", "loc": [18, 18], "level": 0, "parent": null, "vector": [1, 0, 0.0616, 0.0034, 0, 0.66, 0.0909, 735, 0, 1, 0, 0, 735, 0, 0], "semantic": {"name": "robot", "arg_names": [], "import_names": ["utils"], "rhs_call_name": "", "annotation": ""}, "snippet": "from robot import utils"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:ImportFrom_L19_C0", "label": "from robot.errors import DataError", "type": "import", "loc": [19, 19], "level": 0, "parent": null, "vector": [1, 0, 0.0651, 0.0034, 0, 0.66, 0.1364, 299, 0, 1, 0, 0, 299, 0, 0], "semantic": {"name": "robot.errors", "arg_names": [], "import_names": ["DataError"], "rhs_call_name": "", "annotation": ""}, "snippet": "from robot.errors import DataError"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:ImportFrom_L21_C0", "label": "from outputcapture import OutputCapturer", "type": "import", "loc": [21, 21], "level": 0, "parent": null, "vector": [1, 0, 0.0719, 0.0034, 0, 0.66, 0.1818, 467, 0, 1, 0, 0, 467, 0, 0], "semantic": {"name": "outputcapture", "arg_names": [], "import_names": ["OutputCapturer"], "rhs_call_name": "", "annotation": ""}, "snippet": "from outputcapture import OutputCapturer"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:ImportFrom_L22_C0", "label": "from runkwregister import RUN_KW_REGISTER", "type": "import", "loc": [22, 22], "level": 0, "parent": null, "vector": [1, 0, 0.0753, 0.0034, 0, 0.66, 0.2273, 661, 0, 1, 0, 0, 661, 0, 0], "semantic": {"name": "runkwregister", "arg_names": [], "import_names": ["RUN_KW_REGISTER"], "rhs_call_name": "", "annotation": ""}, "snippet": "from runkwregister import RUN_KW_REGISTER"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:ImportFrom_L23_C0", "label": "from keywords import Keywords, Keyword", "type": "import", "loc": [23, 23], "level": 0, "parent": null, "vector": [1, 0, 0.0788, 0.0034, 0, 0.66, 0.2727, 211, 0, 2, 0, 0, 211, 0, 0], "semantic": {"name": "keywords", "arg_names": [], "import_names": ["Keywords", "Keyword"], "rhs_call_name": "", "annotation": ""}, "snippet": "from keywords import Keywords, Keyword"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:ImportFrom_L24_C0", "label": "from arguments import PythonKeywordArguments, JavaKeywordArguments, DynamicKeywordArguments\u2026", "type": "import", "loc": [24, 26], "level": 0, "parent": null, "vector": [1, 0, 0.0856, 0.0103, 0, 0.66, 0.3182, 426, 0, 6, 0, 0, 426, 0, 0], "semantic": {"name": "arguments", "arg_names": [], "import_names": ["PythonKeywordArguments", "JavaKeywordArguments", "DynamicKeywordArguments", "RunKeywordArguments", "PythonInitArguments", "JavaInitArguments"], "rhs_call_name": "", "annotation": ""}, "snippet": "from arguments import (PythonKeywordArguments, JavaKeywordArguments,\n DynamicKeywordArguments, RunKeywordArguments,\n PythonInitArguments, JavaInitArguments)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:ImportFrom_L27_C0", "label": "from signalhandler import STOP_SIGNAL_MONITOR", "type": "import", "loc": [27, 27], "level": 0, "parent": null, "vector": [1, 0, 0.0925, 0.0034, 0, 0.66, 0.3636, 831, 0, 1, 0, 0, 831, 0, 0], "semantic": {"name": "signalhandler", "arg_names": [], "import_names": ["STOP_SIGNAL_MONITOR"], "rhs_call_name": "", "annotation": ""}, "snippet": "from signalhandler import STOP_SIGNAL_MONITOR"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:If_L30_C0", "label": "if", "type": "if", "loc": [30, 39], "level": 0, "parent": null, "vector": [4, 0, 0.1182, 0.0342, 0, 0.66, 0.4091, 0, 7, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if utils.is_jython:\n from org.python.core import PyReflectedFunction, PyReflectedConstructor\n\n def _is_java_init(init):\n return isinstance(init, PyReflectedConstructor)\n def _is_java_method(method):\n return hasattr(method, 'im_func') \\\n and isinstance(method.im_func, PyReflectedFunction)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:ImportFrom_L31_C4", "label": "from org.python.core import PyReflectedFunction, PyReflectedConstructor", "type": "import", "loc": [31, 31], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:If_L30_C0", "vector": [1, 1, 0.1062, 0.0034, 1, 0.11, 0.0, 919, 0, 2, 0, 0, 919, 0, 0], "semantic": {"name": "org.python.core", "arg_names": [], "import_names": ["PyReflectedFunction", "PyReflectedConstructor"], "rhs_call_name": "", "annotation": ""}, "snippet": " from org.python.core import PyReflectedFunction, PyReflectedConstructor"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L33_C4", "label": "_is_java_init", "type": "function", "loc": [33, 34], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:If_L30_C0", "vector": [2, 1, 0.1147, 0.0068, 1, 0.11, 0.3333, 249, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "_is_java_init", "arg_names": ["init"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _is_java_init(init):\n return isinstance(init, PyReflectedConstructor)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:Return_L34_C8", "label": "return", "type": "return", "loc": [34, 34], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L33_C4", "vector": [13, 2, 0.1164, 0.0034, 2, 0.11, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return isinstance(init, PyReflectedConstructor)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L35_C4", "label": "_is_java_method", "type": "function", "loc": [35, 37], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:If_L30_C0", "vector": [2, 1, 0.1233, 0.0103, 1, 0.11, 0.6667, 95, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "_is_java_method", "arg_names": ["method"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _is_java_method(method):\n return hasattr(method, 'im_func') \\\n and isinstance(method.im_func, PyReflectedFunction)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:Return_L36_C8", "label": "return", "type": "return", "loc": [36, 37], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L35_C4", "vector": [13, 2, 0.125, 0.0068, 2, 0.82, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return hasattr(method, 'im_func') \\\n and isinstance(method.im_func, PyReflectedFunction)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:Assign_L39_C4", "label": "_is_java_init =", "type": "assigned_variable", "loc": [39, 39], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:If_L30_C0", "vector": [14, 1, 0.1336, 0.0034, 1, 0.11, 1.0, 249, 9, 0, 0, 0, 0, 0, 0], "semantic": {"name": "_is_java_init", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " _is_java_init = _is_java_method = lambda item: False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L42_C0", "label": "Handler", "type": "function", "loc": [42, 48], "level": 0, "parent": null, "vector": [2, 0, 0.1541, 0.024, 0, 0.66, 0.4545, 284, 0, 3, 1, 0, 0, 0, 5], "semantic": {"name": "Handler", "arg_names": ["library", "name", "method"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def Handler(library, name, method):\n if RUN_KW_REGISTER.is_run_keyword(library.orig_name, name):\n return _RunKeywordHandler(library, name, method)\n if _is_java_method(method):\n return _JavaHandler(library, name, method)\n else:\n return _PythonHandler(library, name, method)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:If_L43_C4", "label": "if", "type": "if", "loc": [43, 44], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L42_C0", "vector": [4, 1, 0.149, 0.0068, 1, 0.84, 0.0, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if RUN_KW_REGISTER.is_run_keyword(library.orig_name, name):\n return _RunKeywordHandler(library, name, method)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:Return_L44_C8", "label": "return", "type": "return", "loc": [44, 44], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:If_L43_C4", "vector": [13, 2, 0.1507, 0.0034, 2, 0.3, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return _RunKeywordHandler(library, name, method)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:If_L45_C4", "label": "if", "type": "if", "loc": [45, 48], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L42_C0", "vector": [4, 1, 0.1592, 0.0137, 1, 0.84, 1.0, 0, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if _is_java_method(method):\n return _JavaHandler(library, name, method)\n else:\n return _PythonHandler(library, name, method)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:Return_L46_C8", "label": "return", "type": "return", "loc": [46, 46], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:If_L45_C4", "vector": [13, 2, 0.1575, 0.0034, 2, 0.23, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return _JavaHandler(library, name, method)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:Return_L48_C8", "label": "return", "type": "return", "loc": [48, 48], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:If_L45_C4", "vector": [13, 2, 0.1644, 0.0034, 2, 0.23, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return _PythonHandler(library, name, method)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L51_C0", "label": "DynamicHandler", "type": "function", "loc": [51, 54], "level": 0, "parent": null, "vector": [2, 0, 0.1798, 0.0137, 0, 0.66, 0.5, 644, 0, 5, 1, 0, 0, 0, 3], "semantic": {"name": "DynamicHandler", "arg_names": ["library", "name", "method", "doc", "argspec"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def DynamicHandler(library, name, method, doc, argspec):\n if RUN_KW_REGISTER.is_run_keyword(library.orig_name, name):\n return _DynamicRunKeywordHandler(library, name, method, doc, argspec)\n return _DynamicHandler(library, name, method, doc, argspec)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:If_L52_C4", "label": "if", "type": "if", "loc": [52, 53], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L51_C0", "vector": [4, 1, 0.1798, 0.0068, 1, 0.78, 0.0, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if RUN_KW_REGISTER.is_run_keyword(library.orig_name, name):\n return _DynamicRunKeywordHandler(library, name, method, doc, argspec)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:Return_L53_C8", "label": "return", "type": "return", "loc": [53, 53], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:If_L52_C4", "vector": [13, 2, 0.1815, 0.0034, 2, 0.11, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return _DynamicRunKeywordHandler(library, name, method, doc, argspec)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:Return_L54_C4", "label": "return", "type": "return", "loc": [54, 54], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L51_C0", "vector": [13, 1, 0.1849, 0.0034, 1, 0.78, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return _DynamicHandler(library, name, method, doc, argspec)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L57_C0", "label": "InitHandler", "type": "function", "loc": [57, 61], "level": 0, "parent": null, "vector": [2, 0, 0.2021, 0.0171, 0, 0.66, 0.5455, 806, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "InitHandler", "arg_names": ["library", "method"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def InitHandler(library, method):\n if method is None:\n method = lambda: None\n Init = _PythonInitHandler if not _is_java_init(method) else _JavaInitHandler\n return Init(library, '__init__', method)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:If_L58_C4", "label": "if", "type": "if", "loc": [58, 59], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L57_C0", "vector": [4, 1, 0.2003, 0.0068, 1, 0.89, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if method is None:\n method = lambda: None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:Assign_L59_C8", "label": "method =", "type": "assigned_variable", "loc": [59, 59], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:If_L58_C4", "vector": [14, 2, 0.2021, 0.0034, 2, 0.89, 0.0, 445, 9, 0, 0, 0, 0, 0, 0], "semantic": {"name": "method", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " method = lambda: None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:Assign_L60_C4", "label": "Init =", "type": "assigned_variable", "loc": [60, 60], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L57_C0", "vector": [14, 1, 0.2055, 0.0034, 1, 0.89, 0.5, 44, 8, 0, 0, 0, 0, 0, 1], "semantic": {"name": "Init", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " Init = _PythonInitHandler if not _is_java_init(method) else _JavaInitHandler"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:Return_L61_C4", "label": "return", "type": "return", "loc": [61, 61], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L57_C0", "vector": [13, 1, 0.2089, 0.0034, 1, 0.89, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return Init(library, '__init__', method)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:ClassDef_L64_C0", "label": "_BaseHandler", "type": "class", "loc": [64, 82], "level": 0, "parent": null, "vector": [3, 0, 0.25, 0.0651, 0, 0.66, 0.5909, 132, 0, 4, 0, 0, 186, 0, 4], "semantic": {"name": "_BaseHandler", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class _BaseHandler(object):\n type = 'library'\n doc = ''\n\n def __init__(self, library, handler_name, handler_method):\n self.library = library\n self.name = utils.printable_name(handler_name, code_style=True)\n self.arguments = self._parse_arguments(handler_method)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:Assign_L65_C4", "label": "type =", "type": "assigned_variable", "loc": [65, 65], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:ClassDef_L64_C0", "vector": [14, 1, 0.2226, 0.0034, 1, 0.87, 0.0, 801, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "type", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " type = 'library'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:Assign_L66_C4", "label": "doc =", "type": "assigned_variable", "loc": [66, 66], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:ClassDef_L64_C0", "vector": [14, 1, 0.226, 0.0034, 1, 0.87, 0.2, 555, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "doc", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " doc = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L68_C4", "label": "__init__", "type": "function", "loc": [68, 71], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:ClassDef_L64_C0", "vector": [2, 1, 0.238, 0.0137, 1, 0.87, 0.4, 555, 0, 4, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": ["self", "library", "handler_name", "handler_method"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, library, handler_name, handler_method):\n self.library = library\n self.name = utils.printable_name(handler_name, code_style=True)\n self.arguments = self._parse_arguments(handler_method)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:Assign_L69_C8", "label": "self.library =", "type": "assigned_variable", "loc": [69, 69], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L68_C4", "vector": [14, 2, 0.2363, 0.0034, 2, 0.09, 0.0, 581, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.library", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.library = library"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:Assign_L70_C8", "label": "self.name = printable_name()", "type": "assigned_variable", "loc": [70, 70], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L68_C4", "vector": [14, 2, 0.2397, 0.0034, 2, 0.09, 0.5, 689, 3, 2, 0, 0, 934, 10, 1], "semantic": {"name": "self.name", "arg_names": [], "import_names": [], "rhs_call_name": "printable_name", "annotation": ""}, "snippet": " self.name = utils.printable_name(handler_name, code_style=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:Assign_L71_C8", "label": "self.arguments = _parse_arguments()", "type": "assigned_variable", "loc": [71, 71], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L68_C4", "vector": [14, 2, 0.2432, 0.0034, 2, 0.09, 1.0, 585, 3, 1, 0, 0, 436, 10, 1], "semantic": {"name": "self.arguments", "arg_names": [], "import_names": [], "rhs_call_name": "_parse_arguments", "annotation": ""}, "snippet": " self.arguments = self._parse_arguments(handler_method)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L73_C4", "label": "_parse_arguments", "type": "function", "loc": [73, 74], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:ClassDef_L64_C0", "vector": [2, 1, 0.2517, 0.0068, 1, 0.87, 0.6, 436, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "_parse_arguments", "arg_names": ["self", "handler_method"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _parse_arguments(self, handler_method):\n raise NotImplementedError(self.__class__.__name__)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L77_C4", "label": "longname", "type": "function", "loc": [77, 78], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:ClassDef_L64_C0", "vector": [2, 1, 0.2654, 0.0068, 1, 0.87, 0.8, 573, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "longname", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def longname(self):\n return '%s.%s' % (self.library.name, self.name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:Return_L78_C8", "label": "return", "type": "return", "loc": [78, 78], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L77_C4", "vector": [13, 2, 0.2671, 0.0034, 2, 0.8, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return '%s.%s' % (self.library.name, self.name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L81_C4", "label": "shortdoc", "type": "function", "loc": [81, 82], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:ClassDef_L64_C0", "vector": [2, 1, 0.2791, 0.0068, 1, 0.87, 1.0, 883, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "shortdoc", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def shortdoc(self):\n return self.doc.splitlines()[0] if self.doc else ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:Return_L82_C8", "label": "return", "type": "return", "loc": [82, 82], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L81_C4", "vector": [13, 2, 0.2808, 0.0034, 2, 0.31, 0.0, 0, 8, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.doc.splitlines()[0] if self.doc else ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:ClassDef_L85_C0", "label": "_RunnableHandler", "type": "class", "loc": [85, 167], "level": 0, "parent": null, "vector": [3, 0, 0.4315, 0.2842, 0, 0.66, 0.6364, 598, 0, 15, 0, 0, 132, 0, 32], "semantic": {"name": "_RunnableHandler", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class _RunnableHandler(_BaseHandler):\n\n def __init__(self, library, handler_name, handler_method):\n _BaseHandler.__init__(self, library, handler_name, handler_method)\n self._handler_name = handler_name\n self._method = self._get_initial_handler(library, handler_name,\n handler_method)\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L87_C4", "label": "__init__", "type": "function", "loc": [87, 91], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:ClassDef_L85_C0", "vector": [2, 1, 0.3048, 0.0171, 1, 0.92, 0.0, 555, 0, 4, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": ["self", "library", "handler_name", "handler_method"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, library, handler_name, handler_method):\n _BaseHandler.__init__(self, library, handler_name, handler_method)\n self._handler_name = handler_name\n self._method = self._get_initial_handler(library, handler_name,\n handler_method)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:Expr_L88_C8", "label": "__init__()", "type": "expression", "loc": [88, 88], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L87_C4", "vector": [8, 2, 0.3014, 0.0034, 2, 0.34, 0.0, 555, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " _BaseHandler.__init__(self, library, handler_name, handler_method)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:Assign_L89_C8", "label": "self._handler_name =", "type": "assigned_variable", "loc": [89, 89], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L87_C4", "vector": [14, 2, 0.3048, 0.0034, 2, 0.34, 0.5, 825, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._handler_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._handler_name = handler_name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:Assign_L90_C8", "label": "self._method = _get_initial_handler()", "type": "assigned_variable", "loc": [90, 91], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L87_C4", "vector": [14, 2, 0.3099, 0.0068, 2, 0.34, 1.0, 910, 3, 3, 0, 0, 865, 10, 1], "semantic": {"name": "self._method", "arg_names": [], "import_names": [], "rhs_call_name": "_get_initial_handler", "annotation": ""}, "snippet": " self._method = self._get_initial_handler(library, handler_name,\n handler_method)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L93_C4", "label": "_get_initial_handler", "type": "function", "loc": [93, 96], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:ClassDef_L85_C0", "vector": [2, 1, 0.3236, 0.0137, 1, 0.92, 0.0714, 865, 0, 4, 1, 0, 0, 0, 1], "semantic": {"name": "_get_initial_handler", "arg_names": ["self", "library", "name", "method"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _get_initial_handler(self, library, name, method):\n if library.scope == 'GLOBAL':\n return self._get_global_handler(method, name)\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:If_L94_C8", "label": "if", "type": "if", "loc": [94, 95], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L93_C4", "vector": [4, 2, 0.3236, 0.0068, 2, 0.76, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if library.scope == 'GLOBAL':\n return self._get_global_handler(method, name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:Return_L95_C12", "label": "return", "type": "return", "loc": [95, 95], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:If_L94_C8", "vector": [13, 3, 0.3253, 0.0034, 3, 0.33, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._get_global_handler(method, name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:Return_L96_C8", "label": "return", "type": "return", "loc": [96, 96], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L93_C4", "vector": [13, 2, 0.3288, 0.0034, 2, 0.76, 1.0, 0, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L98_C4", "label": "init_keyword", "type": "function", "loc": [98, 99], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:ClassDef_L85_C0", "vector": [2, 1, 0.3373, 0.0068, 1, 0.92, 0.1429, 747, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "init_keyword", "arg_names": ["self", "varz"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def init_keyword(self, varz):\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L101_C4", "label": "run", "type": "function", "loc": [101, 104], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:ClassDef_L85_C0", "vector": [2, 1, 0.351, 0.0137, 1, 0.92, 0.2143, 679, 0, 3, 1, 0, 0, 0, 2], "semantic": {"name": "run", "arg_names": ["self", "context", "args"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def run(self, context, args):\n if context.dry_run:\n return self._dry_run(context, args)\n return self._run(context, args)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:If_L102_C8", "label": "if", "type": "if", "loc": [102, 103], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L101_C4", "vector": [4, 2, 0.351, 0.0068, 2, 0.68, 0.0, 0, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if context.dry_run:\n return self._dry_run(context, args)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:Return_L103_C12", "label": "return", "type": "return", "loc": [103, 103], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:If_L102_C8", "vector": [13, 3, 0.3527, 0.0034, 3, 0.4, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._dry_run(context, args)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:Return_L104_C8", "label": "return", "type": "return", "loc": [104, 104], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L101_C4", "vector": [13, 2, 0.3562, 0.0034, 2, 0.68, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._run(context, args)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L106_C4", "label": "_dry_run", "type": "function", "loc": [106, 108], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:ClassDef_L85_C0", "vector": [2, 1, 0.3664, 0.0103, 1, 0.92, 0.2857, 18, 0, 3, 1, 0, 0, 0, 1], "semantic": {"name": "_dry_run", "arg_names": ["self", "context", "args"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _dry_run(self, context, args):\n self.arguments.check_arg_limits_for_dry_run(args)\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:Expr_L107_C8", "label": "check_arg_limits_for_dry_run()", "type": "expression", "loc": [107, 107], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L106_C4", "vector": [8, 2, 0.3664, 0.0034, 2, 0.66, 0.0, 100, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "check_arg_limits_for_dry_run", "arg_names": [], "import_names": [], "rhs_call_name": "check_arg_limits_for_dry_run", "annotation": ""}, "snippet": " self.arguments.check_arg_limits_for_dry_run(args)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:Return_L108_C8", "label": "return", "type": "return", "loc": [108, 108], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L106_C4", "vector": [13, 2, 0.3699, 0.0034, 2, 0.66, 1.0, 0, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L110_C4", "label": "_run", "type": "function", "loc": [110, 116], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:ClassDef_L85_C0", "vector": [2, 1, 0.387, 0.024, 1, 0.92, 0.3571, 736, 0, 3, 1, 0, 0, 0, 6], "semantic": {"name": "_run", "arg_names": ["self", "context", "args"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _run(self, context, args):\n output = context.output\n positional, named = \\\n self.arguments.resolve(args, context.get_current_vars(), output)\n runner = self._runner_for(self._current_handler(), output, positional,\n named, self._get_timeout(context.namespace))\n return self._run_with_output_captured_and_signal_monitor(runner, context)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:Assign_L111_C8", "label": "output =", "type": "assigned_variable", "loc": [111, 111], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L110_C4", "vector": [14, 2, 0.3801, 0.0034, 2, 0.62, 0.0, 886, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "output", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " output = context.output"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:Assign_L112_C8", "label": "positional, named = resolve()", "type": "assigned_variable", "loc": [112, 113], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L110_C4", "vector": [14, 2, 0.3853, 0.0068, 2, 0.62, 0.3333, 437, 3, 3, 0, 0, 675, 10, 2], "semantic": {"name": "positional, named", "arg_names": [], "import_names": [], "rhs_call_name": "resolve", "annotation": ""}, "snippet": " positional, named = \\\n self.arguments.resolve(args, context.get_current_vars(), output)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:Assign_L114_C8", "label": "runner = _runner_for()", "type": "assigned_variable", "loc": [114, 115], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L110_C4", "vector": [14, 2, 0.3921, 0.0068, 2, 0.62, 0.6667, 180, 3, 5, 0, 0, 700, 10, 3], "semantic": {"name": "runner", "arg_names": [], "import_names": [], "rhs_call_name": "_runner_for", "annotation": ""}, "snippet": " runner = self._runner_for(self._current_handler(), output, positional,\n named, self._get_timeout(context.namespace))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:Return_L116_C8", "label": "return", "type": "return", "loc": [116, 116], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L110_C4", "vector": [13, 2, 0.3973, 0.0034, 2, 0.62, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._run_with_output_captured_and_signal_monitor(runner, context)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L118_C4", "label": "_runner_for", "type": "function", "loc": [118, 122], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:ClassDef_L85_C0", "vector": [2, 1, 0.411, 0.0171, 1, 0.92, 0.4286, 700, 0, 6, 1, 0, 0, 0, 4], "semantic": {"name": "_runner_for", "arg_names": ["self", "handler", "output", "positional", "named", "timeout"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _runner_for(self, handler, output, positional, named, timeout):\n if timeout and timeout.active:\n output.debug(timeout.get_message())\n return lambda: timeout.run(handler, args=positional, kwargs=named)\n return lambda: handler(*positional, **named)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:If_L119_C8", "label": "if", "type": "if", "loc": [119, 121], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L118_C4", "vector": [4, 2, 0.411, 0.0103, 2, 0.58, 0.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if timeout and timeout.active:\n output.debug(timeout.get_message())\n return lambda: timeout.run(handler, args=positional, kwargs=named)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:Expr_L120_C12", "label": "debug()", "type": "expression", "loc": [120, 120], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:If_L119_C8", "vector": [8, 3, 0.411, 0.0034, 3, 0.32, 0.0, 924, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "debug", "arg_names": [], "import_names": [], "rhs_call_name": "debug", "annotation": ""}, "snippet": " output.debug(timeout.get_message())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:Return_L121_C12", "label": "return", "type": "return", "loc": [121, 121], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:If_L119_C8", "vector": [13, 3, 0.4144, 0.0034, 3, 0.32, 1.0, 0, 9, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return lambda: timeout.run(handler, args=positional, kwargs=named)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:Return_L122_C8", "label": "return", "type": "return", "loc": [122, 122], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L118_C4", "vector": [13, 2, 0.4178, 0.0034, 2, 0.58, 1.0, 0, 9, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return lambda: handler(*positional, **named)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L124_C4", "label": "_run_with_output_captured_and_signal_monitor", "type": "function", "loc": [124, 133], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:ClassDef_L85_C0", "vector": [2, 1, 0.4401, 0.0342, 1, 0.92, 0.5, 717, 0, 3, 1, 0, 0, 0, 6], "semantic": {"name": "_run_with_output_captured_and_signal_monitor", "arg_names": ["self", "runner", "context"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _run_with_output_captured_and_signal_monitor(self, runner, context):\n capturer = OutputCapturer()\n try:\n return self._run_with_signal_monitoring(runner, context)\n finally:\n stdout, stderr = capturer.release()\n context.output.log_output(stdout)\n context.output.log_output(stderr)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:Assign_L125_C8", "label": "capturer = OutputCapturer()", "type": "assigned_variable", "loc": [125, 125], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L124_C4", "vector": [14, 2, 0.4281, 0.0034, 2, 0.33, 0.0, 471, 3, 0, 0, 0, 527, 10, 1], "semantic": {"name": "capturer", "arg_names": [], "import_names": [], "rhs_call_name": "OutputCapturer", "annotation": ""}, "snippet": " capturer = OutputCapturer()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:Try_L126_C8", "label": "try", "type": "try", "loc": [126, 133], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L124_C4", "vector": [7, 2, 0.4435, 0.0274, 2, 0.33, 1.0, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n return self._run_with_signal_monitoring(runner, context)\n finally:\n stdout, stderr = capturer.release()\n context.output.log_output(stdout)\n context.output.log_output(stderr)\n if stderr:\n sys.__stderr__.write(stderr+'\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:Return_L127_C12", "label": "return", "type": "return", "loc": [127, 127], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:Try_L126_C8", "vector": [13, 3, 0.4349, 0.0034, 3, 0.63, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._run_with_signal_monitoring(runner, context)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:Assign_L129_C12", "label": "stdout, stderr = release()", "type": "assigned_variable", "loc": [129, 129], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:Try_L126_C8", "vector": [14, 3, 0.4418, 0.0034, 3, 0.63, 0.25, 616, 3, 0, 0, 0, 784, 10, 1], "semantic": {"name": "stdout, stderr", "arg_names": [], "import_names": [], "rhs_call_name": "release", "annotation": ""}, "snippet": " stdout, stderr = capturer.release()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:Expr_L130_C12", "label": "log_output()", "type": "expression", "loc": [130, 130], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:Try_L126_C8", "vector": [8, 3, 0.4452, 0.0034, 3, 0.63, 0.5, 414, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "log_output", "arg_names": [], "import_names": [], "rhs_call_name": "log_output", "annotation": ""}, "snippet": " context.output.log_output(stdout)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:Expr_L131_C12", "label": "log_output()", "type": "expression", "loc": [131, 131], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:Try_L126_C8", "vector": [8, 3, 0.4486, 0.0034, 3, 0.63, 0.75, 414, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "log_output", "arg_names": [], "import_names": [], "rhs_call_name": "log_output", "annotation": ""}, "snippet": " context.output.log_output(stderr)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:If_L132_C12", "label": "if", "type": "if", "loc": [132, 133], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:Try_L126_C8", "vector": [4, 3, 0.4538, 0.0068, 3, 0.63, 1.0, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if stderr:\n sys.__stderr__.write(stderr+'\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:Expr_L133_C16", "label": "write()", "type": "expression", "loc": [133, 133], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:If_L132_C12", "vector": [8, 4, 0.4555, 0.0034, 4, 0.25, 0.0, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " sys.__stderr__.write(stderr+'\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L135_C4", "label": "_run_with_signal_monitoring", "type": "function", "loc": [135, 140], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:ClassDef_L85_C0", "vector": [2, 1, 0.4709, 0.0205, 1, 0.92, 0.5714, 411, 0, 3, 1, 0, 0, 0, 3], "semantic": {"name": "_run_with_signal_monitoring", "arg_names": ["self", "runner", "context"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _run_with_signal_monitoring(self, runner, context):\n try:\n STOP_SIGNAL_MONITOR.start_running_keyword(context.teardown)\n return runner()\n finally:\n STOP_SIGNAL_MONITOR.stop_running_keyword()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:Try_L136_C8", "label": "try", "type": "try", "loc": [136, 140], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L135_C4", "vector": [7, 2, 0.4726, 0.0171, 2, 0.56, 0.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n STOP_SIGNAL_MONITOR.start_running_keyword(context.teardown)\n return runner()\n finally:\n STOP_SIGNAL_MONITOR.stop_running_keyword()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:Expr_L137_C12", "label": "start_running_keyword()", "type": "expression", "loc": [137, 137], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:Try_L136_C8", "vector": [8, 3, 0.4692, 0.0034, 3, 0.25, 0.0, 471, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "start_running_keyword", "arg_names": [], "import_names": [], "rhs_call_name": "start_running_keyword", "annotation": ""}, "snippet": " STOP_SIGNAL_MONITOR.start_running_keyword(context.teardown)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:Return_L138_C12", "label": "return", "type": "return", "loc": [138, 138], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:Try_L136_C8", "vector": [13, 3, 0.4726, 0.0034, 3, 0.25, 0.5, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return runner()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:Expr_L140_C12", "label": "stop_running_keyword()", "type": "expression", "loc": [140, 140], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:Try_L136_C8", "vector": [8, 3, 0.4795, 0.0034, 3, 0.25, 1.0, 181, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "stop_running_keyword", "arg_names": [], "import_names": [], "rhs_call_name": "stop_running_keyword", "annotation": ""}, "snippet": " STOP_SIGNAL_MONITOR.stop_running_keyword()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L142_C4", "label": "_current_handler", "type": "function", "loc": [142, 146], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:ClassDef_L85_C0", "vector": [2, 1, 0.4932, 0.0171, 1, 0.92, 0.6429, 82, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "_current_handler", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _current_handler(self):\n if self._method:\n return self._method\n return self._get_handler(self.library.get_instance(),\n self._handler_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:If_L143_C8", "label": "if", "type": "if", "loc": [143, 144], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L142_C4", "vector": [4, 2, 0.4914, 0.0068, 2, 0.54, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self._method:\n return self._method"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:Return_L144_C12", "label": "return", "type": "return", "loc": [144, 144], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:If_L143_C8", "vector": [13, 3, 0.4932, 0.0034, 3, 0.82, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._method"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:Return_L145_C8", "label": "return", "type": "return", "loc": [145, 146], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L142_C4", "vector": [13, 2, 0.4983, 0.0068, 2, 0.54, 1.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._get_handler(self.library.get_instance(),\n self._handler_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L148_C4", "label": "_get_global_handler", "type": "function", "loc": [148, 149], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:ClassDef_L85_C0", "vector": [2, 1, 0.5086, 0.0068, 1, 0.92, 0.7143, 881, 0, 3, 1, 0, 0, 0, 0], "semantic": {"name": "_get_global_handler", "arg_names": ["self", "method", "name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _get_global_handler(self, method, name):\n return method"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:Return_L149_C8", "label": "return", "type": "return", "loc": [149, 149], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L148_C4", "vector": [13, 2, 0.5103, 0.0034, 2, 0.68, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return method"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L151_C4", "label": "_get_handler", "type": "function", "loc": [151, 152], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:ClassDef_L85_C0", "vector": [2, 1, 0.5188, 0.0068, 1, 0.92, 0.7857, 342, 0, 3, 1, 0, 0, 0, 1], "semantic": {"name": "_get_handler", "arg_names": ["self", "lib_instance", "handler_name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _get_handler(self, lib_instance, handler_name):\n return getattr(lib_instance, handler_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:Return_L152_C8", "label": "return", "type": "return", "loc": [152, 152], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L151_C4", "vector": [13, 2, 0.5205, 0.0034, 2, 0.58, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return getattr(lib_instance, handler_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L154_C4", "label": "_get_timeout", "type": "function", "loc": [154, 158], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:ClassDef_L85_C0", "vector": [2, 1, 0.5342, 0.0171, 1, 0.92, 0.8571, 534, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "_get_timeout", "arg_names": ["self", "namespace"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _get_timeout(self, namespace):\n timeoutable = self._get_timeoutable_items(namespace)\n if timeoutable:\n return min(item.timeout for item in timeoutable)\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:Assign_L155_C8", "label": "timeoutable = _get_timeoutable_items()", "type": "assigned_variable", "loc": [155, 155], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L154_C4", "vector": [14, 2, 0.5308, 0.0034, 2, 0.03, 0.0, 637, 3, 1, 0, 0, 746, 10, 1], "semantic": {"name": "timeoutable", "arg_names": [], "import_names": [], "rhs_call_name": "_get_timeoutable_items", "annotation": ""}, "snippet": " timeoutable = self._get_timeoutable_items(namespace)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:If_L156_C8", "label": "if", "type": "if", "loc": [156, 157], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L154_C4", "vector": [4, 2, 0.536, 0.0068, 2, 0.03, 0.5, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if timeoutable:\n return min(item.timeout for item in timeoutable)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:Return_L157_C12", "label": "return", "type": "return", "loc": [157, 157], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:If_L156_C8", "vector": [13, 3, 0.5377, 0.0034, 3, 0.15, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return min(item.timeout for item in timeoutable)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:Return_L158_C8", "label": "return", "type": "return", "loc": [158, 158], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L154_C4", "vector": [13, 2, 0.5411, 0.0034, 2, 0.03, 1.0, 0, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L160_C4", "label": "_get_timeoutable_items", "type": "function", "loc": [160, 164], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:ClassDef_L85_C0", "vector": [2, 1, 0.5548, 0.0171, 1, 0.92, 0.9286, 746, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "_get_timeoutable_items", "arg_names": ["self", "namespace"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _get_timeoutable_items(self, namespace):\n items = namespace.uk_handlers[:]\n if self._test_running_and_not_in_teardown(namespace.test):\n items.append(namespace.test)\n return items"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:Assign_L161_C8", "label": "items =", "type": "assigned_variable", "loc": [161, 161], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L160_C4", "vector": [14, 2, 0.5514, 0.0034, 2, 0.02, 0.0, 339, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "items", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " items = namespace.uk_handlers[:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:If_L162_C8", "label": "if", "type": "if", "loc": [162, 163], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L160_C4", "vector": [4, 2, 0.5565, 0.0068, 2, 0.02, 0.5, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self._test_running_and_not_in_teardown(namespace.test):\n items.append(namespace.test)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:Expr_L163_C12", "label": "append()", "type": "expression", "loc": [163, 163], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:If_L162_C8", "vector": [8, 3, 0.5582, 0.0034, 3, 0.19, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " items.append(namespace.test)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:Return_L164_C8", "label": "return", "type": "return", "loc": [164, 164], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L160_C4", "vector": [13, 2, 0.5616, 0.0034, 2, 0.02, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return items"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L166_C4", "label": "_test_running_and_not_in_teardown", "type": "function", "loc": [166, 167], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:ClassDef_L85_C0", "vector": [2, 1, 0.5702, 0.0068, 1, 0.92, 1.0, 366, 0, 2, 1, 0, 0, 0, 0], "semantic": {"name": "_test_running_and_not_in_teardown", "arg_names": ["self", "test"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _test_running_and_not_in_teardown(self, test):\n return test and test.status == 'RUNNING'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:Return_L167_C8", "label": "return", "type": "return", "loc": [167, 167], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L166_C4", "vector": [13, 2, 0.5719, 0.0034, 2, 0.85, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return test and test.status == 'RUNNING'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:ClassDef_L170_C0", "label": "_PythonHandler", "type": "class", "loc": [170, 177], "level": 0, "parent": null, "vector": [3, 0, 0.5942, 0.0274, 0, 0.66, 0.6818, 729, 0, 2, 0, 0, 598, 0, 3], "semantic": {"name": "_PythonHandler", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class _PythonHandler(_RunnableHandler):\n\n def __init__(self, library, handler_name, handler_method):\n _RunnableHandler.__init__(self, library, handler_name, handler_method)\n self.doc = inspect.getdoc(handler_method) or ''\n\n def _parse_arguments(self, handler_method):\n return PythonKeywordArguments(handler_method, self.longname)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L172_C4", "label": "__init__", "type": "function", "loc": [172, 174], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:ClassDef_L170_C0", "vector": [2, 1, 0.5925, 0.0103, 1, 0.55, 0.0, 555, 0, 4, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": ["self", "library", "handler_name", "handler_method"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, library, handler_name, handler_method):\n _RunnableHandler.__init__(self, library, handler_name, handler_method)\n self.doc = inspect.getdoc(handler_method) or ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:Expr_L173_C8", "label": "__init__()", "type": "expression", "loc": [173, 173], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L172_C4", "vector": [8, 2, 0.5925, 0.0034, 2, 0.92, 0.0, 555, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " _RunnableHandler.__init__(self, library, handler_name, handler_method)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:Assign_L174_C8", "label": "self.doc =", "type": "assigned_variable", "loc": [174, 174], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L172_C4", "vector": [14, 2, 0.5959, 0.0034, 2, 0.92, 1.0, 114, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self.doc", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.doc = inspect.getdoc(handler_method) or ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L176_C4", "label": "_parse_arguments", "type": "function", "loc": [176, 177], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:ClassDef_L170_C0", "vector": [2, 1, 0.6045, 0.0068, 1, 0.55, 1.0, 436, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "_parse_arguments", "arg_names": ["self", "handler_method"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _parse_arguments(self, handler_method):\n return PythonKeywordArguments(handler_method, self.longname)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:Return_L177_C8", "label": "return", "type": "return", "loc": [177, 177], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L176_C4", "vector": [13, 2, 0.6062, 0.0034, 2, 0.98, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return PythonKeywordArguments(handler_method, self.longname)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:ClassDef_L180_C0", "label": "_JavaHandler", "type": "class", "loc": [180, 183], "level": 0, "parent": null, "vector": [3, 0, 0.6216, 0.0137, 0, 0.66, 0.7273, 905, 0, 1, 0, 0, 598, 0, 1], "semantic": {"name": "_JavaHandler", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class _JavaHandler(_RunnableHandler):\n\n def _parse_arguments(self, handler_method):\n return JavaKeywordArguments(handler_method, self.longname)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L182_C4", "label": "_parse_arguments", "type": "function", "loc": [182, 183], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:ClassDef_L180_C0", "vector": [2, 1, 0.625, 0.0068, 1, 0.01, 0.0, 436, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "_parse_arguments", "arg_names": ["self", "handler_method"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _parse_arguments(self, handler_method):\n return JavaKeywordArguments(handler_method, self.longname)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:Return_L183_C8", "label": "return", "type": "return", "loc": [183, 183], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L182_C4", "vector": [13, 2, 0.6267, 0.0034, 2, 0.64, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return JavaKeywordArguments(handler_method, self.longname)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:ClassDef_L186_C0", "label": "_DynamicHandler", "type": "class", "loc": [186, 208], "level": 0, "parent": null, "vector": [3, 0, 0.6747, 0.0788, 0, 0.66, 0.7727, 820, 0, 6, 0, 0, 598, 0, 8], "semantic": {"name": "_DynamicHandler", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class _DynamicHandler(_RunnableHandler):\n\n def __init__(self, library, handler_name, handler_method, doc='',\n argspec=None):\n self._argspec = argspec\n _RunnableHandler.__init__(self, library, handler_name, handler_method)\n self._run_keyword_method_name = handler_method.__name__\n self.doc = doc is not None and utils.unic(doc) or ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L188_C4", "label": "__init__", "type": "function", "loc": [188, 193], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:ClassDef_L186_C0", "vector": [2, 1, 0.6524, 0.0205, 1, 0.92, 0.0, 555, 0, 6, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": ["self", "library", "handler_name", "handler_method", "doc", "argspec"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, library, handler_name, handler_method, doc='',\n argspec=None):\n self._argspec = argspec\n _RunnableHandler.__init__(self, library, handler_name, handler_method)\n self._run_keyword_method_name = handler_method.__name__\n self.doc = doc is not None and utils.unic(doc) or ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:Assign_L190_C8", "label": "self._argspec =", "type": "assigned_variable", "loc": [190, 190], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L188_C4", "vector": [14, 2, 0.6507, 0.0034, 2, 0.9, 0.0, 832, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._argspec", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._argspec = argspec"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:Expr_L191_C8", "label": "__init__()", "type": "expression", "loc": [191, 191], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L188_C4", "vector": [8, 2, 0.6541, 0.0034, 2, 0.9, 0.3333, 555, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " _RunnableHandler.__init__(self, library, handler_name, handler_method)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:Assign_L192_C8", "label": "self._run_keyword_method_name =", "type": "assigned_variable", "loc": [192, 192], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L188_C4", "vector": [14, 2, 0.6575, 0.0034, 2, 0.9, 0.6667, 339, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._run_keyword_method_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._run_keyword_method_name = handler_method.__name__"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:Assign_L193_C8", "label": "self.doc =", "type": "assigned_variable", "loc": [193, 193], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L188_C4", "vector": [14, 2, 0.661, 0.0034, 2, 0.9, 1.0, 114, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self.doc", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.doc = doc is not None and utils.unic(doc) or ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L195_C4", "label": "_parse_arguments", "type": "function", "loc": [195, 196], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:ClassDef_L186_C0", "vector": [2, 1, 0.6695, 0.0068, 1, 0.92, 0.25, 436, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "_parse_arguments", "arg_names": ["self", "handler_method"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _parse_arguments(self, handler_method):\n return DynamicKeywordArguments(self._argspec, self.longname)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:Return_L196_C8", "label": "return", "type": "return", "loc": [196, 196], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L195_C4", "vector": [13, 2, 0.6712, 0.0034, 2, 0.23, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return DynamicKeywordArguments(self._argspec, self.longname)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L198_C4", "label": "_get_handler", "type": "function", "loc": [198, 200], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:ClassDef_L186_C0", "vector": [2, 1, 0.6815, 0.0103, 1, 0.92, 0.5, 342, 0, 3, 1, 0, 0, 0, 2], "semantic": {"name": "_get_handler", "arg_names": ["self", "lib_instance", "handler_name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _get_handler(self, lib_instance, handler_name):\n runner = getattr(lib_instance, self._run_keyword_method_name)\n return self._get_dynamic_handler(runner, handler_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:Assign_L199_C8", "label": "runner = getattr()", "type": "assigned_variable", "loc": [199, 199], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L198_C4", "vector": [14, 2, 0.6815, 0.0034, 2, 0.93, 0.0, 180, 3, 2, 0, 0, 121, 10, 1], "semantic": {"name": "runner", "arg_names": [], "import_names": [], "rhs_call_name": "getattr", "annotation": ""}, "snippet": " runner = getattr(lib_instance, self._run_keyword_method_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:Return_L200_C8", "label": "return", "type": "return", "loc": [200, 200], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L198_C4", "vector": [13, 2, 0.6849, 0.0034, 2, 0.93, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._get_dynamic_handler(runner, handler_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L202_C4", "label": "_get_global_handler", "type": "function", "loc": [202, 203], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:ClassDef_L186_C0", "vector": [2, 1, 0.6935, 0.0068, 1, 0.92, 0.75, 881, 0, 3, 1, 0, 0, 0, 1], "semantic": {"name": "_get_global_handler", "arg_names": ["self", "method", "name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _get_global_handler(self, method, name):\n return self._get_dynamic_handler(method, name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:Return_L203_C8", "label": "return", "type": "return", "loc": [203, 203], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L202_C4", "vector": [13, 2, 0.6952, 0.0034, 2, 0.8, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._get_dynamic_handler(method, name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L205_C4", "label": "_get_dynamic_handler", "type": "function", "loc": [205, 208], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:ClassDef_L186_C0", "vector": [2, 1, 0.7072, 0.0137, 1, 0.92, 1.0, 555, 0, 3, 1, 0, 0, 0, 2], "semantic": {"name": "_get_dynamic_handler", "arg_names": ["self", "runner", "name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _get_dynamic_handler(self, runner, name):\n def handler(*args):\n return runner(name, list(args))\n return handler"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L206_C8", "label": "handler", "type": "function", "loc": [206, 207], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L205_C4", "vector": [2, 2, 0.7072, 0.0068, 2, 0.12, 0.0, 388, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "handler", "arg_names": ["args"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def handler(*args):\n return runner(name, list(args))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:Return_L207_C12", "label": "return", "type": "return", "loc": [207, 207], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L206_C8", "vector": [13, 3, 0.7089, 0.0034, 3, 0.35, 0.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return runner(name, list(args))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:Return_L208_C8", "label": "return", "type": "return", "loc": [208, 208], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L205_C4", "vector": [13, 2, 0.7123, 0.0034, 2, 0.12, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return handler"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:ClassDef_L211_C0", "label": "_RunKeywordHandler", "type": "class", "loc": [211, 259], "level": 0, "parent": null, "vector": [3, 0, 0.8048, 0.1678, 0, 0.66, 0.8182, 503, 0, 8, 0, 0, 729, 0, 16], "semantic": {"name": "_RunKeywordHandler", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class _RunKeywordHandler(_PythonHandler):\n\n def __init__(self, library, handler_name, handler_method):\n _PythonHandler.__init__(self, library, handler_name, handler_method)\n self._handler_method = handler_method\n\n def _run_with_signal_monitoring(self, runner, context):\n # With run keyword variants, only the keyword to be run can fail"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L213_C4", "label": "__init__", "type": "function", "loc": [213, 215], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:ClassDef_L211_C0", "vector": [2, 1, 0.7329, 0.0103, 1, 0.82, 0.0, 555, 0, 4, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": ["self", "library", "handler_name", "handler_method"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, library, handler_name, handler_method):\n _PythonHandler.__init__(self, library, handler_name, handler_method)\n self._handler_method = handler_method"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:Expr_L214_C8", "label": "__init__()", "type": "expression", "loc": [214, 214], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L213_C4", "vector": [8, 2, 0.7329, 0.0034, 2, 0.82, 0.0, 555, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " _PythonHandler.__init__(self, library, handler_name, handler_method)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:Assign_L215_C8", "label": "self._handler_method =", "type": "assigned_variable", "loc": [215, 215], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L213_C4", "vector": [14, 2, 0.7363, 0.0034, 2, 0.82, 1.0, 248, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._handler_method", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._handler_method = handler_method"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L217_C4", "label": "_run_with_signal_monitoring", "type": "function", "loc": [217, 220], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:ClassDef_L211_C0", "vector": [2, 1, 0.7483, 0.0137, 1, 0.82, 0.1429, 411, 0, 3, 1, 0, 0, 0, 1], "semantic": {"name": "_run_with_signal_monitoring", "arg_names": ["self", "runner", "context"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _run_with_signal_monitoring(self, runner, context):\n # With run keyword variants, only the keyword to be run can fail\n # and therefore monitoring should not raise exception yet.\n return runner()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:Return_L220_C8", "label": "return", "type": "return", "loc": [220, 220], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L217_C4", "vector": [13, 2, 0.7534, 0.0034, 2, 0.12, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return runner()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L222_C4", "label": "_parse_arguments", "type": "function", "loc": [222, 225], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:ClassDef_L211_C0", "vector": [2, 1, 0.7654, 0.0137, 1, 0.82, 0.2857, 436, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "_parse_arguments", "arg_names": ["self", "handler_method"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _parse_arguments(self, handler_method):\n arg_index = RUN_KW_REGISTER.get_args_to_process(self.library.orig_name,\n self.name)\n return RunKeywordArguments(handler_method, self.longname, arg_index)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:Assign_L223_C8", "label": "arg_index = get_args_to_process()", "type": "assigned_variable", "loc": [223, 224], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L222_C4", "vector": [14, 2, 0.7654, 0.0068, 2, 0.09, 0.0, 94, 3, 2, 0, 0, 548, 10, 1], "semantic": {"name": "arg_index", "arg_names": [], "import_names": [], "rhs_call_name": "get_args_to_process", "annotation": ""}, "snippet": " arg_index = RUN_KW_REGISTER.get_args_to_process(self.library.orig_name,\n self.name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:Return_L225_C8", "label": "return", "type": "return", "loc": [225, 225], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L222_C4", "vector": [13, 2, 0.7705, 0.0034, 2, 0.09, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return RunKeywordArguments(handler_method, self.longname, arg_index)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L227_C4", "label": "_get_timeout", "type": "function", "loc": [227, 228], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:ClassDef_L211_C0", "vector": [2, 1, 0.7791, 0.0068, 1, 0.82, 0.4286, 534, 0, 2, 1, 0, 0, 0, 0], "semantic": {"name": "_get_timeout", "arg_names": ["self", "namespace"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _get_timeout(self, namespace):\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:Return_L228_C8", "label": "return", "type": "return", "loc": [228, 228], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L227_C4", "vector": [13, 2, 0.7808, 0.0034, 2, 0.9, 0.0, 0, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L230_C4", "label": "_dry_run", "type": "function", "loc": [230, 233], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:ClassDef_L211_C0", "vector": [2, 1, 0.7928, 0.0137, 1, 0.82, 0.5714, 18, 0, 3, 0, 0, 0, 0, 3], "semantic": {"name": "_dry_run", "arg_names": ["self", "context", "args"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _dry_run(self, context, args):\n _RunnableHandler._dry_run(self, context, args)\n keywords = self._get_runnable_keywords(context, args)\n keywords.run(context)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:Expr_L231_C8", "label": "_dry_run()", "type": "expression", "loc": [231, 231], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L230_C4", "vector": [8, 2, 0.7911, 0.0034, 2, 0.86, 0.0, 18, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "_dry_run", "arg_names": [], "import_names": [], "rhs_call_name": "_dry_run", "annotation": ""}, "snippet": " _RunnableHandler._dry_run(self, context, args)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:Assign_L232_C8", "label": "keywords = _get_runnable_keywords()", "type": "assigned_variable", "loc": [232, 232], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L230_C4", "vector": [14, 2, 0.7945, 0.0034, 2, 0.86, 0.5, 211, 3, 2, 0, 0, 617, 10, 1], "semantic": {"name": "keywords", "arg_names": [], "import_names": [], "rhs_call_name": "_get_runnable_keywords", "annotation": ""}, "snippet": " keywords = self._get_runnable_keywords(context, args)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:Expr_L233_C8", "label": "run()", "type": "expression", "loc": [233, 233], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L230_C4", "vector": [8, 2, 0.7979, 0.0034, 2, 0.86, 1.0, 679, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "run", "arg_names": [], "import_names": [], "rhs_call_name": "run", "annotation": ""}, "snippet": " keywords.run(context)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L235_C4", "label": "_get_runnable_keywords", "type": "function", "loc": [235, 241], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:ClassDef_L211_C0", "vector": [2, 1, 0.8151, 0.024, 1, 0.82, 0.7143, 617, 0, 3, 1, 0, 0, 0, 4], "semantic": {"name": "_get_runnable_keywords", "arg_names": ["self", "context", "args"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _get_runnable_keywords(self, context, args):\n keywords = Keywords([])\n for keyword in self._get_keywords(args):\n if self._variable_syntax_in(keyword.name, context):\n continue\n keywords.add_keyword(keyword)\n return keywords"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:Assign_L236_C8", "label": "keywords = Keywords()", "type": "assigned_variable", "loc": [236, 236], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L235_C4", "vector": [14, 2, 0.8082, 0.0034, 2, 0.15, 0.0, 211, 3, 1, 0, 0, 426, 10, 1], "semantic": {"name": "keywords", "arg_names": [], "import_names": [], "rhs_call_name": "Keywords", "annotation": ""}, "snippet": " keywords = Keywords([])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:For_L237_C8", "label": "for keyword", "type": "for", "loc": [237, 240], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L235_C4", "vector": [6, 2, 0.8168, 0.0137, 2, 0.15, 0.5, 454, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "keyword", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for keyword in self._get_keywords(args):\n if self._variable_syntax_in(keyword.name, context):\n continue\n keywords.add_keyword(keyword)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:If_L238_C12", "label": "if", "type": "if", "loc": [238, 239], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:For_L237_C8", "vector": [4, 3, 0.8168, 0.0068, 3, 0.7, 0.0, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self._variable_syntax_in(keyword.name, context):\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:Expr_L240_C12", "label": "add_keyword()", "type": "expression", "loc": [240, 240], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:For_L237_C8", "vector": [8, 3, 0.8219, 0.0034, 3, 0.7, 1.0, 693, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "add_keyword", "arg_names": [], "import_names": [], "rhs_call_name": "add_keyword", "annotation": ""}, "snippet": " keywords.add_keyword(keyword)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:Return_L241_C8", "label": "return", "type": "return", "loc": [241, 241], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L235_C4", "vector": [13, 2, 0.8253, 0.0034, 2, 0.15, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return keywords"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L243_C4", "label": "_get_keywords", "type": "function", "loc": [243, 250], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:ClassDef_L211_C0", "vector": [2, 1, 0.8442, 0.0274, 1, 0.82, 0.8571, 49, 0, 2, 1, 0, 0, 0, 4], "semantic": {"name": "_get_keywords", "arg_names": ["self", "args"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _get_keywords(self, args):\n arg_names = self.arguments.names\n if 'name' in arg_names:\n name_index = arg_names.index('name')\n return [ Keyword(args[name_index], args[name_index+1:]) ]\n elif self.arguments.varargs == 'names':\n return [ Keyword(name, []) for name in args[len(arg_names):] ]\n return []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:Assign_L244_C8", "label": "arg_names =", "type": "assigned_variable", "loc": [244, 244], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L243_C4", "vector": [14, 2, 0.8356, 0.0034, 2, 0.46, 0.0, 545, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "arg_names", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " arg_names = self.arguments.names"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:If_L245_C8", "label": "if", "type": "if", "loc": [245, 249], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L243_C4", "vector": [4, 2, 0.8459, 0.0171, 2, 0.46, 0.5, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if 'name' in arg_names:\n name_index = arg_names.index('name')\n return [ Keyword(args[name_index], args[name_index+1:]) ]\n elif self.arguments.varargs == 'names':\n return [ Keyword(name, []) for name in args[len(arg_names):] ]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:Assign_L246_C12", "label": "name_index = index()", "type": "assigned_variable", "loc": [246, 246], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:If_L245_C8", "vector": [14, 3, 0.8425, 0.0034, 3, 0.8, 0.0, 209, 3, 1, 0, 0, 780, 10, 1], "semantic": {"name": "name_index", "arg_names": [], "import_names": [], "rhs_call_name": "index", "annotation": ""}, "snippet": " name_index = arg_names.index('name')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:Return_L247_C12", "label": "return", "type": "return", "loc": [247, 247], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:If_L245_C8", "vector": [13, 3, 0.8459, 0.0034, 3, 0.8, 0.5, 0, 0, 0, 0, 0, 0, 5, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return [ Keyword(args[name_index], args[name_index+1:]) ]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:If_L248_C8", "label": "if", "type": "if", "loc": [248, 249], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:If_L245_C8", "vector": [4, 3, 0.851, 0.0068, 3, 0.8, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif self.arguments.varargs == 'names':\n return [ Keyword(name, []) for name in args[len(arg_names):] ]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:Return_L249_C12", "label": "return", "type": "return", "loc": [249, 249], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:If_L248_C8", "vector": [13, 4, 0.8527, 0.0034, 4, 0.32, 0.0, 0, 5, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return [ Keyword(name, []) for name in args[len(arg_names):] ]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:Return_L250_C8", "label": "return", "type": "return", "loc": [250, 250], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L243_C4", "vector": [13, 2, 0.8562, 0.0034, 2, 0.46, 1.0, 0, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L252_C4", "label": "_variable_syntax_in", "type": "function", "loc": [252, 259], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:ClassDef_L211_C0", "vector": [2, 1, 0.875, 0.0274, 1, 0.82, 1.0, 926, 0, 3, 1, 0, 0, 0, 1], "semantic": {"name": "_variable_syntax_in", "arg_names": ["self", "kw_name", "context"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _variable_syntax_in(self, kw_name, context):\n try:\n resolved = context.namespace.variables.replace_string(kw_name)\n #Variable can contain value, but it might be wrong, \n #therefore it cannot be returned\n return resolved != kw_name\n except DataError:\n return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:Try_L253_C8", "label": "try", "type": "try", "loc": [253, 259], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L252_C4", "vector": [7, 2, 0.8767, 0.024, 2, 0.5, 0.0, 0, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n resolved = context.namespace.variables.replace_string(kw_name)\n #Variable can contain value, but it might be wrong, \n #therefore it cannot be returned\n return resolved != kw_name\n except DataError:\n return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:Assign_L254_C12", "label": "resolved = replace_string()", "type": "assigned_variable", "loc": [254, 254], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:Try_L253_C8", "vector": [14, 3, 0.8699, 0.0034, 3, 0.21, 0.0, 276, 3, 1, 0, 0, 720, 10, 1], "semantic": {"name": "resolved", "arg_names": [], "import_names": [], "rhs_call_name": "replace_string", "annotation": ""}, "snippet": " resolved = context.namespace.variables.replace_string(kw_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:Return_L257_C12", "label": "return", "type": "return", "loc": [257, 257], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:Try_L253_C8", "vector": [13, 3, 0.8801, 0.0034, 3, 0.21, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return resolved != kw_name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:Return_L259_C12", "label": "return", "type": "return", "loc": [259, 259], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:Try_L253_C8", "vector": [13, 3, 0.887, 0.0034, 3, 0.21, 0.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:ClassDef_L261_C0", "label": "_XTimesHandler", "type": "class", "loc": [261, 275], "level": 0, "parent": null, "vector": [3, 0, 0.9178, 0.0514, 0, 0.66, 0.8636, 24, 0, 3, 0, 0, 503, 0, 3], "semantic": {"name": "_XTimesHandler", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class _XTimesHandler(_RunKeywordHandler):\n\n def __init__(self, handler, name):\n _RunKeywordHandler.__init__(self, handler.library, handler.name, \n handler._handler_method)\n self.name = name\n self.doc = \"*DEPRECATED* Replace X times syntax with 'Repeat Keyword'.\"\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L263_C4", "label": "__init__", "type": "function", "loc": [263, 267], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:ClassDef_L261_C0", "vector": [2, 1, 0.9075, 0.0171, 1, 0.52, 0.0, 555, 0, 3, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": ["self", "handler", "name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, handler, name):\n _RunKeywordHandler.__init__(self, handler.library, handler.name, \n handler._handler_method)\n self.name = name\n self.doc = \"*DEPRECATED* Replace X times syntax with 'Repeat Keyword'.\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:Expr_L264_C8", "label": "__init__()", "type": "expression", "loc": [264, 265], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L263_C4", "vector": [8, 2, 0.9058, 0.0068, 2, 0.79, 0.0, 555, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " _RunKeywordHandler.__init__(self, handler.library, handler.name, \n handler._handler_method)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:Assign_L266_C8", "label": "self.name =", "type": "assigned_variable", "loc": [266, 266], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L263_C4", "vector": [14, 2, 0.911, 0.0034, 2, 0.79, 0.5, 689, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.name = name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:Assign_L267_C8", "label": "self.doc =", "type": "assigned_variable", "loc": [267, 267], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L263_C4", "vector": [14, 2, 0.9144, 0.0034, 2, 0.79, 1.0, 114, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "self.doc", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.doc = \"*DEPRECATED* Replace X times syntax with 'Repeat Keyword'.\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L269_C4", "label": "run", "type": "function", "loc": [269, 271], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:ClassDef_L261_C0", "vector": [2, 1, 0.9247, 0.0103, 1, 0.52, 0.5, 679, 0, 3, 0, 0, 0, 0, 2], "semantic": {"name": "run", "arg_names": ["self", "context", "args"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def run(self, context, args):\n resolved_times = context.namespace.variables.replace_string(self.name)\n _RunnableHandler.run(self, context, [resolved_times] + args)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:Assign_L270_C8", "label": "resolved_times = replace_string()", "type": "assigned_variable", "loc": [270, 270], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L269_C4", "vector": [14, 2, 0.9247, 0.0034, 2, 0.58, 0.0, 223, 3, 1, 0, 0, 720, 10, 1], "semantic": {"name": "resolved_times", "arg_names": [], "import_names": [], "rhs_call_name": "replace_string", "annotation": ""}, "snippet": " resolved_times = context.namespace.variables.replace_string(self.name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:Expr_L271_C8", "label": "run()", "type": "expression", "loc": [271, 271], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L269_C4", "vector": [8, 2, 0.9281, 0.0034, 2, 0.58, 1.0, 679, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "run", "arg_names": [], "import_names": [], "rhs_call_name": "run", "annotation": ""}, "snippet": " _RunnableHandler.run(self, context, [resolved_times] + args)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L274_C4", "label": "longname", "type": "function", "loc": [274, 275], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:ClassDef_L261_C0", "vector": [2, 1, 0.9401, 0.0068, 1, 0.52, 1.0, 573, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "longname", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def longname(self):\n return self.name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:Return_L275_C8", "label": "return", "type": "return", "loc": [275, 275], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L274_C4", "vector": [13, 2, 0.9418, 0.0034, 2, 0.06, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:ClassDef_L278_C0", "label": "_DynamicRunKeywordHandler", "type": "class", "loc": [278, 280], "level": 0, "parent": null, "vector": [3, 0, 0.9555, 0.0103, 0, 0.66, 0.9091, 478, 0, 0, 0, 0, 820, 0, 0], "semantic": {"name": "_DynamicRunKeywordHandler", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class _DynamicRunKeywordHandler(_DynamicHandler, _RunKeywordHandler):\n _parse_arguments = _RunKeywordHandler._parse_arguments\n _get_timeout = _RunKeywordHandler._get_timeout"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:Assign_L279_C4", "label": "_parse_arguments =", "type": "assigned_variable", "loc": [279, 279], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:ClassDef_L278_C0", "vector": [14, 1, 0.9555, 0.0034, 1, 0.13, 0.0, 436, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "_parse_arguments", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " _parse_arguments = _RunKeywordHandler._parse_arguments"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:Assign_L280_C4", "label": "_get_timeout =", "type": "assigned_variable", "loc": [280, 280], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:ClassDef_L278_C0", "vector": [14, 1, 0.9589, 0.0034, 1, 0.13, 1.0, 534, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "_get_timeout", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " _get_timeout = _RunKeywordHandler._get_timeout"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:ClassDef_L283_C0", "label": "_PythonInitHandler", "type": "class", "loc": [283, 286], "level": 0, "parent": null, "vector": [3, 0, 0.9743, 0.0137, 0, 0.66, 0.9545, 768, 0, 1, 0, 0, 729, 0, 1], "semantic": {"name": "_PythonInitHandler", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class _PythonInitHandler(_PythonHandler):\n\n def _parse_arguments(self, handler_method):\n return PythonInitArguments(handler_method, self.library.name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L285_C4", "label": "_parse_arguments", "type": "function", "loc": [285, 286], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:ClassDef_L283_C0", "vector": [2, 1, 0.9777, 0.0068, 1, 0.36, 0.0, 436, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "_parse_arguments", "arg_names": ["self", "handler_method"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _parse_arguments(self, handler_method):\n return PythonInitArguments(handler_method, self.library.name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:Return_L286_C8", "label": "return", "type": "return", "loc": [286, 286], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L285_C4", "vector": [13, 2, 0.9795, 0.0034, 2, 0.85, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return PythonInitArguments(handler_method, self.library.name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:ClassDef_L289_C0", "label": "_JavaInitHandler", "type": "class", "loc": [289, 292], "level": 0, "parent": null, "vector": [3, 0, 0.9949, 0.0137, 0, 0.66, 1.0, 822, 0, 1, 0, 0, 132, 0, 1], "semantic": {"name": "_JavaInitHandler", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class _JavaInitHandler(_BaseHandler):\n\n def _parse_arguments(self, handler_method):\n return JavaInitArguments(handler_method, self.library.name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L291_C4", "label": "_parse_arguments", "type": "function", "loc": [291, 292], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:ClassDef_L289_C0", "vector": [2, 1, 0.9983, 0.0068, 1, 0.44, 0.0, 436, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "_parse_arguments", "arg_names": ["self", "handler_method"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _parse_arguments(self, handler_method):\n return JavaInitArguments(handler_method, self.library.name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99810:Return_L292_C8", "label": "return", "type": "return", "loc": [292, 292], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L291_C4", "vector": [13, 2, 1.0, 0.0034, 2, 0.88, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return JavaInitArguments(handler_method, self.library.name)"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99810:If_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:ImportFrom_L31_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:If_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L33_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L33_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:Return_L34_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:If_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L35_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L35_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:Return_L36_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:If_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:Assign_L39_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L42_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:If_L43_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:If_L43_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:Return_L44_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L42_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:If_L45_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:If_L45_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:Return_L46_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:If_L45_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:Return_L48_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L51_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:If_L52_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:If_L52_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:Return_L53_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L51_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:Return_L54_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L57_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:If_L58_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:If_L58_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:Assign_L59_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L57_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:Assign_L60_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L57_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:Return_L61_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:ClassDef_L64_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:Assign_L65_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:ClassDef_L64_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:Assign_L66_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:ClassDef_L64_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L68_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L68_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:Assign_L69_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L68_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:Assign_L70_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L68_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:Assign_L71_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:ClassDef_L64_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L73_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:ClassDef_L64_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L77_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L77_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:Return_L78_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:ClassDef_L64_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L81_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L81_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:Return_L82_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:ClassDef_L85_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L87_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L87_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:Expr_L88_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L87_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:Assign_L89_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L87_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:Assign_L90_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:ClassDef_L85_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L93_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L93_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:If_L94_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:If_L94_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:Return_L95_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L93_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:Return_L96_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:ClassDef_L85_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L98_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:ClassDef_L85_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L101_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L101_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:If_L102_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:If_L102_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:Return_L103_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L101_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:Return_L104_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:ClassDef_L85_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L106_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L106_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:Expr_L107_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L106_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:Return_L108_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:ClassDef_L85_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L110_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L110_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:Assign_L111_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L110_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:Assign_L112_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L110_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:Assign_L114_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L110_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:Return_L116_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:ClassDef_L85_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L118_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L118_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:If_L119_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:If_L119_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:Expr_L120_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:If_L119_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:Return_L121_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L118_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:Return_L122_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:ClassDef_L85_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L124_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L124_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:Assign_L125_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L124_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:Try_L126_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:Try_L126_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:Return_L127_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:Try_L126_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:Assign_L129_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:Try_L126_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:Expr_L130_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:Try_L126_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:Expr_L131_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:Try_L126_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:If_L132_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:If_L132_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:Expr_L133_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:ClassDef_L85_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L135_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L135_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:Try_L136_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:Try_L136_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:Expr_L137_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:Try_L136_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:Return_L138_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:Try_L136_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:Expr_L140_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:ClassDef_L85_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L142_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L142_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:If_L143_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:If_L143_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:Return_L144_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L142_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:Return_L145_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:ClassDef_L85_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L148_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L148_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:Return_L149_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:ClassDef_L85_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L151_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L151_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:Return_L152_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:ClassDef_L85_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L154_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L154_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:Assign_L155_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L154_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:If_L156_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:If_L156_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:Return_L157_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L154_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:Return_L158_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:ClassDef_L85_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L160_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L160_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:Assign_L161_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L160_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:If_L162_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:If_L162_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:Expr_L163_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L160_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:Return_L164_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:ClassDef_L85_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L166_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L166_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:Return_L167_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:ClassDef_L170_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L172_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L172_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:Expr_L173_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L172_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:Assign_L174_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:ClassDef_L170_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L176_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L176_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:Return_L177_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:ClassDef_L180_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L182_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L182_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:Return_L183_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:ClassDef_L186_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L188_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L188_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:Assign_L190_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L188_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:Expr_L191_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L188_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:Assign_L192_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L188_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:Assign_L193_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:ClassDef_L186_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L195_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L195_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:Return_L196_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:ClassDef_L186_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L198_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L198_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:Assign_L199_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L198_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:Return_L200_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:ClassDef_L186_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L202_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L202_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:Return_L203_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:ClassDef_L186_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L205_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L205_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L206_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L206_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:Return_L207_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L205_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:Return_L208_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:ClassDef_L211_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L213_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L213_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:Expr_L214_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L213_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:Assign_L215_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:ClassDef_L211_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L217_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L217_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:Return_L220_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:ClassDef_L211_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L222_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L222_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:Assign_L223_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L222_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:Return_L225_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:ClassDef_L211_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L227_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L227_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:Return_L228_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:ClassDef_L211_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L230_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L230_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:Expr_L231_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L230_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:Assign_L232_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L230_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:Expr_L233_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:ClassDef_L211_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L235_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L235_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:Assign_L236_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L235_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:For_L237_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:For_L237_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:If_L238_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:For_L237_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:Expr_L240_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L235_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:Return_L241_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:ClassDef_L211_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L243_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L243_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:Assign_L244_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L243_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:If_L245_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:If_L245_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:Assign_L246_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:If_L245_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:Return_L247_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:If_L245_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:If_L248_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:If_L248_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:Return_L249_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L243_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:Return_L250_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:ClassDef_L211_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L252_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L252_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:Try_L253_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:Try_L253_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:Assign_L254_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:Try_L253_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:Return_L257_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:Try_L253_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:Return_L259_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:ClassDef_L261_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L263_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L263_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:Expr_L264_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L263_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:Assign_L266_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L263_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:Assign_L267_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:ClassDef_L261_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L269_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L269_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:Assign_L270_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L269_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:Expr_L271_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:ClassDef_L261_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L274_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L274_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:Return_L275_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:ClassDef_L278_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:Assign_L279_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:ClassDef_L278_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:Assign_L280_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:ClassDef_L283_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L285_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L285_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:Return_L286_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:ClassDef_L289_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L291_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99810:FunctionDef_L291_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99810:Return_L292_C8"}] |
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
class SuiteRunErrors(object):
_NO_ERROR = None
_exit_on_failure_error = ('Critical failure occurred and ExitOnFailure '
'option is in use')
_exit_on_fatal_error = 'Test execution is stopped due to a fatal error'
_parent_suite_init_error = 'Initialization of the parent suite failed.'
_parent_suite_setup_error = 'Setup of the parent suite failed.'
def __init__(self, run_mode_is_exit_on_failure=False, run_mode_skip_teardowns_on_exit=False):
self._run_mode_is_exit_on_failure = run_mode_is_exit_on_failure
self._run_mode_skip_teardowns_on_exit = run_mode_skip_teardowns_on_exit
self._earlier_init_errors = []
self._earlier_setup_errors = []
self._earlier_suite_setup_executions = []
self._init_current_errors()
self._exit_runmode = self._exit_fatal = False
self._current_suite_setup_executed = False
@property
def exit(self):
return self._exit_fatal or self._exit_runmode
def _init_current_errors(self):
self._current_init_err = self._current_setup_err = self._NO_ERROR
def start_suite(self):
self._earlier_init_errors.append(self._current_init_err)
self._earlier_setup_errors.append(self._current_setup_err)
self._earlier_suite_setup_executions.append(self._current_suite_setup_executed)
self._init_current_errors()
self._current_suite_setup_executed = False
def end_suite(self):
self._current_setup_err = self._earlier_setup_errors.pop()
self._current_init_err = self._earlier_init_errors.pop()
self._current_suite_setup_executed = self._earlier_suite_setup_executions.pop()
def is_suite_setup_allowed(self):
return self._current_init_err is self._NO_ERROR and \
not self._earlier_errors()
def is_suite_teardown_allowed(self):
if not self.is_test_teardown_allowed():
return False
if self._current_suite_setup_executed:
return True
return self._current_init_err is self._NO_ERROR and \
not self._earlier_errors()
def is_test_teardown_allowed(self):
if not self._run_mode_skip_teardowns_on_exit:
return True
return not (self._exit_fatal or self._exit_runmode)
def _earlier_errors(self):
if self._exit_runmode or self._exit_fatal:
return True
for err in self._earlier_setup_errors + self._earlier_init_errors:
if err is not self._NO_ERROR:
return True
return False
def suite_init_err(self, error_message):
self._current_init_err = error_message
def setup_executed(self):
self._current_suite_setup_executed = True
def suite_setup_err(self, err):
if err.exit:
self._exit_fatal = True
self._current_setup_err = unicode(err)
def suite_error(self):
if self._earlier_init_erros_occurred():
return self._parent_suite_init_error
if self._earlier_setup_errors_occurred():
return self._parent_suite_setup_error
if self._current_init_err:
return self._current_init_err
if self._current_setup_err:
return 'Suite setup failed:\n%s' % self._current_setup_err
return ''
def _earlier_init_erros_occurred(self):
return any(self._earlier_init_errors)
def _earlier_setup_errors_occurred(self):
return any(self._earlier_setup_errors)
def child_error(self):
if self._current_init_err or self._earlier_init_erros_occurred():
return self._parent_suite_init_error
if self._current_setup_err or self._earlier_setup_errors_occurred():
return self._parent_suite_setup_error
if self._exit_runmode:
return self._exit_on_failure_error
if self._exit_fatal:
return self._exit_on_fatal_error
return None
def test_failed(self, exit=False, critical=False):
if critical and self._run_mode_is_exit_on_failure:
self._exit_runmode = True
if exit:
self._exit_fatal = True
class TestRunErrors(object):
def __init__(self, err):
self._parent_err = err.child_error() if err else None
self._init_err = None
self._setup_err = None
self._kw_err = None
self._teardown_err = None
def is_allowed_to_run(self):
return not bool(self._parent_err or self._init_err)
def init_err(self, err):
self._init_err = err
def setup_err(self, err):
self._setup_err = err
def setup_failed(self):
return bool(self._setup_err)
def kw_err(self, error):
self._kw_err = error
def teardown_err(self, err):
self._teardown_err = err
def teardown_failed(self):
return bool(self._teardown_err)
def get_message(self):
if self._setup_err:
return 'Setup failed:\n%s' % self._setup_err
return self._kw_err
def get_teardown_message(self, message):
# TODO: This API is really in need of cleanup
if message == '':
return 'Teardown failed:\n%s' % self._teardown_err
return '%s\n\nAlso teardown failed:\n%s' % (message, self._teardown_err)
def parent_or_init_error(self):
return self._parent_err or self._init_err
class KeywordRunErrors(object):
def __init__(self):
self.teardown_error = None
def get_message(self):
if not self._teardown_err:
return self._kw_err
if not self._kw_err:
return 'Keyword teardown failed:\n%s' % self._teardown_err
return '%s\n\nAlso keyword teardown failed:\n%s' % (self._kw_err,
self._teardown_err)
def teardown_err(self, err):
self.teardown_error = err
| ajibawa-2023/Python-Code-Large/train/row_99811 | 127 | 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_99811:ClassDef_L15_C0", "label": "SuiteRunErrors", "type": "class", "loc": [15, 120], "level": 0, "parent": null, "vector": [3, 0, 0.3649, 0.573, 0, 0.66, 0.0, 239, 0, 17, 0, 0, 186, 0, 18], "semantic": {"name": "SuiteRunErrors", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class SuiteRunErrors(object):\n _NO_ERROR = None\n _exit_on_failure_error = ('Critical failure occurred and ExitOnFailure '\n 'option is in use')\n _exit_on_fatal_error = 'Test execution is stopped due to a fatal error'\n _parent_suite_init_error = 'Initialization of the parent suite failed.'\n _parent_suite_setup_error = 'Setup of the parent suite failed.'\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99811:Assign_L16_C4", "label": "_NO_ERROR =", "type": "assigned_variable", "loc": [16, 16], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99811:ClassDef_L15_C0", "vector": [14, 1, 0.0865, 0.0054, 1, 0.37, 0.0, 1, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "_NO_ERROR", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " _NO_ERROR = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99811:Assign_L17_C4", "label": "_exit_on_failure_error =", "type": "assigned_variable", "loc": [17, 18], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99811:ClassDef_L15_C0", "vector": [14, 1, 0.0946, 0.0108, 1, 0.37, 0.0476, 16, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "_exit_on_failure_error", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " _exit_on_failure_error = ('Critical failure occurred and ExitOnFailure '\n 'option is in use')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99811:Assign_L19_C4", "label": "_exit_on_fatal_error =", "type": "assigned_variable", "loc": [19, 19], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99811:ClassDef_L15_C0", "vector": [14, 1, 0.1027, 0.0054, 1, 0.37, 0.0952, 56, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "_exit_on_fatal_error", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " _exit_on_fatal_error = 'Test execution is stopped due to a fatal error'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99811:Assign_L20_C4", "label": "_parent_suite_init_error =", "type": "assigned_variable", "loc": [20, 20], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99811:ClassDef_L15_C0", "vector": [14, 1, 0.1081, 0.0054, 1, 0.37, 0.1429, 805, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "_parent_suite_init_error", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " _parent_suite_init_error = 'Initialization of the parent suite failed.'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99811:Assign_L21_C4", "label": "_parent_suite_setup_error =", "type": "assigned_variable", "loc": [21, 21], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99811:ClassDef_L15_C0", "vector": [14, 1, 0.1135, 0.0054, 1, 0.37, 0.1905, 947, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "_parent_suite_setup_error", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " _parent_suite_setup_error = 'Setup of the parent suite failed.'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L23_C4", "label": "__init__", "type": "function", "loc": [23, 31], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99811:ClassDef_L15_C0", "vector": [2, 1, 0.1459, 0.0486, 1, 0.37, 0.2381, 555, 0, 3, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": ["self", "run_mode_is_exit_on_failure", "run_mode_skip_teardowns_on_exit"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, run_mode_is_exit_on_failure=False, run_mode_skip_teardowns_on_exit=False):\n self._run_mode_is_exit_on_failure = run_mode_is_exit_on_failure\n self._run_mode_skip_teardowns_on_exit = run_mode_skip_teardowns_on_exit\n self._earlier_init_errors = []\n self._earlier_setup_errors = []\n self._earlier_suite_setup_executions = []\n self._init_current_errors()\n self._exit_runmode = self._exit_fatal = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99811:Assign_L24_C8", "label": "self._run_mode_is_exit_on_failure =", "type": "assigned_variable", "loc": [24, 24], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L23_C4", "vector": [14, 2, 0.1297, 0.0054, 2, 0.08, 0.0, 603, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._run_mode_is_exit_on_failure", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._run_mode_is_exit_on_failure = run_mode_is_exit_on_failure"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99811:Assign_L25_C8", "label": "self._run_mode_skip_teardowns_on_exit =", "type": "assigned_variable", "loc": [25, 25], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L23_C4", "vector": [14, 2, 0.1351, 0.0054, 2, 0.08, 0.1429, 519, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._run_mode_skip_teardowns_on_exit", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._run_mode_skip_teardowns_on_exit = run_mode_skip_teardowns_on_exit"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99811:Assign_L26_C8", "label": "self._earlier_init_errors =", "type": "assigned_variable", "loc": [26, 26], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L23_C4", "vector": [14, 2, 0.1405, 0.0054, 2, 0.08, 0.2857, 574, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self._earlier_init_errors", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._earlier_init_errors = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99811:Assign_L27_C8", "label": "self._earlier_setup_errors =", "type": "assigned_variable", "loc": [27, 27], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L23_C4", "vector": [14, 2, 0.1459, 0.0054, 2, 0.08, 0.4286, 752, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self._earlier_setup_errors", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._earlier_setup_errors = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99811:Assign_L28_C8", "label": "self._earlier_suite_setup_executions =", "type": "assigned_variable", "loc": [28, 28], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L23_C4", "vector": [14, 2, 0.1514, 0.0054, 2, 0.08, 0.5714, 825, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self._earlier_suite_setup_executions", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._earlier_suite_setup_executions = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99811:Expr_L29_C8", "label": "_init_current_errors()", "type": "expression", "loc": [29, 29], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L23_C4", "vector": [8, 2, 0.1568, 0.0054, 2, 0.08, 0.7143, 972, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_init_current_errors", "arg_names": [], "import_names": [], "rhs_call_name": "_init_current_errors", "annotation": ""}, "snippet": " self._init_current_errors()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99811:Assign_L30_C8", "label": "self._exit_runmode =", "type": "assigned_variable", "loc": [30, 30], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L23_C4", "vector": [14, 2, 0.1622, 0.0054, 2, 0.08, 0.8571, 792, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self._exit_runmode", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._exit_runmode = self._exit_fatal = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99811:Assign_L31_C8", "label": "self._current_suite_setup_executed =", "type": "assigned_variable", "loc": [31, 31], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L23_C4", "vector": [14, 2, 0.1676, 0.0054, 2, 0.08, 1.0, 166, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self._current_suite_setup_executed", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._current_suite_setup_executed = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L34_C4", "label": "exit", "type": "function", "loc": [34, 35], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99811:ClassDef_L15_C0", "vector": [2, 1, 0.1865, 0.0108, 1, 0.37, 0.2857, 436, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "exit", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def exit(self):\n return self._exit_fatal or self._exit_runmode"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99811:Return_L35_C8", "label": "return", "type": "return", "loc": [35, 35], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L34_C4", "vector": [13, 2, 0.1892, 0.0054, 2, 0.86, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._exit_fatal or self._exit_runmode"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L37_C4", "label": "_init_current_errors", "type": "function", "loc": [37, 38], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99811:ClassDef_L15_C0", "vector": [2, 1, 0.2027, 0.0108, 1, 0.37, 0.3333, 972, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "_init_current_errors", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _init_current_errors(self):\n self._current_init_err = self._current_setup_err = self._NO_ERROR"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99811:Assign_L38_C8", "label": "self._current_init_err =", "type": "assigned_variable", "loc": [38, 38], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L37_C4", "vector": [14, 2, 0.2054, 0.0054, 2, 0.24, 0.0, 31, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._current_init_err", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._current_init_err = self._current_setup_err = self._NO_ERROR"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L40_C4", "label": "start_suite", "type": "function", "loc": [40, 45], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99811:ClassDef_L15_C0", "vector": [2, 1, 0.2297, 0.0324, 1, 0.37, 0.381, 38, 0, 1, 0, 0, 0, 0, 4], "semantic": {"name": "start_suite", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def start_suite(self):\n self._earlier_init_errors.append(self._current_init_err)\n self._earlier_setup_errors.append(self._current_setup_err)\n self._earlier_suite_setup_executions.append(self._current_suite_setup_executed)\n self._init_current_errors()\n self._current_suite_setup_executed = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99811:Expr_L41_C8", "label": "append()", "type": "expression", "loc": [41, 41], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L40_C4", "vector": [8, 2, 0.2216, 0.0054, 2, 0.28, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self._earlier_init_errors.append(self._current_init_err)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99811:Expr_L42_C8", "label": "append()", "type": "expression", "loc": [42, 42], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L40_C4", "vector": [8, 2, 0.227, 0.0054, 2, 0.28, 0.25, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self._earlier_setup_errors.append(self._current_setup_err)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99811:Expr_L43_C8", "label": "append()", "type": "expression", "loc": [43, 43], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L40_C4", "vector": [8, 2, 0.2324, 0.0054, 2, 0.28, 0.5, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self._earlier_suite_setup_executions.append(self._current_suite_setup_executed)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99811:Expr_L44_C8", "label": "_init_current_errors()", "type": "expression", "loc": [44, 44], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L40_C4", "vector": [8, 2, 0.2378, 0.0054, 2, 0.28, 0.75, 972, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_init_current_errors", "arg_names": [], "import_names": [], "rhs_call_name": "_init_current_errors", "annotation": ""}, "snippet": " self._init_current_errors()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99811:Assign_L45_C8", "label": "self._current_suite_setup_executed =", "type": "assigned_variable", "loc": [45, 45], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L40_C4", "vector": [14, 2, 0.2432, 0.0054, 2, 0.28, 1.0, 166, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self._current_suite_setup_executed", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._current_suite_setup_executed = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L47_C4", "label": "end_suite", "type": "function", "loc": [47, 50], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99811:ClassDef_L15_C0", "vector": [2, 1, 0.2622, 0.0216, 1, 0.37, 0.4286, 81, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "end_suite", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def end_suite(self):\n self._current_setup_err = self._earlier_setup_errors.pop()\n self._current_init_err = self._earlier_init_errors.pop()\n self._current_suite_setup_executed = self._earlier_suite_setup_executions.pop()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99811:Assign_L48_C8", "label": "self._current_setup_err = pop()", "type": "assigned_variable", "loc": [48, 48], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L47_C4", "vector": [14, 2, 0.2595, 0.0054, 2, 0.13, 0.0, 443, 3, 0, 0, 0, 969, 10, 1], "semantic": {"name": "self._current_setup_err", "arg_names": [], "import_names": [], "rhs_call_name": "pop", "annotation": ""}, "snippet": " self._current_setup_err = self._earlier_setup_errors.pop()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99811:Assign_L49_C8", "label": "self._current_init_err = pop()", "type": "assigned_variable", "loc": [49, 49], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L47_C4", "vector": [14, 2, 0.2649, 0.0054, 2, 0.13, 0.5, 31, 3, 0, 0, 0, 969, 10, 1], "semantic": {"name": "self._current_init_err", "arg_names": [], "import_names": [], "rhs_call_name": "pop", "annotation": ""}, "snippet": " self._current_init_err = self._earlier_init_errors.pop()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99811:Assign_L50_C8", "label": "self._current_suite_setup_executed = pop()", "type": "assigned_variable", "loc": [50, 50], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L47_C4", "vector": [14, 2, 0.2703, 0.0054, 2, 0.13, 1.0, 166, 3, 0, 0, 0, 969, 10, 1], "semantic": {"name": "self._current_suite_setup_executed", "arg_names": [], "import_names": [], "rhs_call_name": "pop", "annotation": ""}, "snippet": " self._current_suite_setup_executed = self._earlier_suite_setup_executions.pop()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L52_C4", "label": "is_suite_setup_allowed", "type": "function", "loc": [52, 54], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99811:ClassDef_L15_C0", "vector": [2, 1, 0.2865, 0.0162, 1, 0.37, 0.4762, 651, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "is_suite_setup_allowed", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def is_suite_setup_allowed(self):\n return self._current_init_err is self._NO_ERROR and \\\n not self._earlier_errors()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99811:Return_L53_C8", "label": "return", "type": "return", "loc": [53, 54], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L52_C4", "vector": [13, 2, 0.2892, 0.0108, 2, 0.65, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._current_init_err is self._NO_ERROR and \\\n not self._earlier_errors()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L56_C4", "label": "is_suite_teardown_allowed", "type": "function", "loc": [56, 62], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99811:ClassDef_L15_C0", "vector": [2, 1, 0.3189, 0.0378, 1, 0.37, 0.5238, 946, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "is_suite_teardown_allowed", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def is_suite_teardown_allowed(self):\n if not self.is_test_teardown_allowed():\n return False\n if self._current_suite_setup_executed:\n return True\n return self._current_init_err is self._NO_ERROR and \\\n not self._earlier_errors()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99811:If_L57_C8", "label": "if", "type": "if", "loc": [57, 58], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L56_C4", "vector": [4, 2, 0.3108, 0.0108, 2, 0.22, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not self.is_test_teardown_allowed():\n return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99811:Return_L58_C12", "label": "return", "type": "return", "loc": [58, 58], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99811:If_L57_C8", "vector": [13, 3, 0.3135, 0.0054, 3, 0.51, 0.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99811:If_L59_C8", "label": "if", "type": "if", "loc": [59, 60], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L56_C4", "vector": [4, 2, 0.3216, 0.0108, 2, 0.22, 0.5, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self._current_suite_setup_executed:\n return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99811:Return_L60_C12", "label": "return", "type": "return", "loc": [60, 60], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99811:If_L59_C8", "vector": [13, 3, 0.3243, 0.0054, 3, 0.35, 0.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99811:Return_L61_C8", "label": "return", "type": "return", "loc": [61, 62], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L56_C4", "vector": [13, 2, 0.3324, 0.0108, 2, 0.22, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._current_init_err is self._NO_ERROR and \\\n not self._earlier_errors()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L64_C4", "label": "is_test_teardown_allowed", "type": "function", "loc": [64, 67], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99811:ClassDef_L15_C0", "vector": [2, 1, 0.3541, 0.0216, 1, 0.37, 0.5714, 739, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "is_test_teardown_allowed", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def is_test_teardown_allowed(self):\n if not self._run_mode_skip_teardowns_on_exit:\n return True\n return not (self._exit_fatal or self._exit_runmode)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99811:If_L65_C8", "label": "if", "type": "if", "loc": [65, 66], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L64_C4", "vector": [4, 2, 0.3541, 0.0108, 2, 0.99, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not self._run_mode_skip_teardowns_on_exit:\n return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99811:Return_L66_C12", "label": "return", "type": "return", "loc": [66, 66], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99811:If_L65_C8", "vector": [13, 3, 0.3568, 0.0054, 3, 0.65, 0.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99811:Return_L67_C8", "label": "return", "type": "return", "loc": [67, 67], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L64_C4", "vector": [13, 2, 0.3622, 0.0054, 2, 0.99, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return not (self._exit_fatal or self._exit_runmode)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L69_C4", "label": "_earlier_errors", "type": "function", "loc": [69, 75], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99811:ClassDef_L15_C0", "vector": [2, 1, 0.3892, 0.0378, 1, 0.37, 0.619, 424, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "_earlier_errors", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _earlier_errors(self):\n if self._exit_runmode or self._exit_fatal:\n return True\n for err in self._earlier_setup_errors + self._earlier_init_errors:\n if err is not self._NO_ERROR:\n return True\n return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99811:If_L70_C8", "label": "if", "type": "if", "loc": [70, 71], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L69_C4", "vector": [4, 2, 0.3811, 0.0108, 2, 0.71, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self._exit_runmode or self._exit_fatal:\n return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99811:Return_L71_C12", "label": "return", "type": "return", "loc": [71, 71], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99811:If_L70_C8", "vector": [13, 3, 0.3838, 0.0054, 3, 0.15, 0.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99811:For_L72_C8", "label": "for err", "type": "for", "loc": [72, 74], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L69_C4", "vector": [6, 2, 0.3946, 0.0162, 2, 0.71, 0.5, 541, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "err", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for err in self._earlier_setup_errors + self._earlier_init_errors:\n if err is not self._NO_ERROR:\n return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99811:If_L73_C12", "label": "if", "type": "if", "loc": [73, 74], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99811:For_L72_C8", "vector": [4, 3, 0.3973, 0.0108, 3, 0.35, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if err is not self._NO_ERROR:\n return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99811:Return_L74_C16", "label": "return", "type": "return", "loc": [74, 74], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99811:If_L73_C12", "vector": [13, 4, 0.4, 0.0054, 4, 0.25, 0.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99811:Return_L75_C8", "label": "return", "type": "return", "loc": [75, 75], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L69_C4", "vector": [13, 2, 0.4054, 0.0054, 2, 0.71, 1.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L77_C4", "label": "suite_init_err", "type": "function", "loc": [77, 78], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99811:ClassDef_L15_C0", "vector": [2, 1, 0.4189, 0.0108, 1, 0.37, 0.6667, 339, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "suite_init_err", "arg_names": ["self", "error_message"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def suite_init_err(self, error_message):\n self._current_init_err = error_message"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99811:Assign_L78_C8", "label": "self._current_init_err =", "type": "assigned_variable", "loc": [78, 78], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L77_C4", "vector": [14, 2, 0.4216, 0.0054, 2, 0.36, 0.0, 31, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._current_init_err", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._current_init_err = error_message"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L80_C4", "label": "setup_executed", "type": "function", "loc": [80, 81], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99811:ClassDef_L15_C0", "vector": [2, 1, 0.4351, 0.0108, 1, 0.37, 0.7143, 132, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "setup_executed", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def setup_executed(self):\n self._current_suite_setup_executed = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99811:Assign_L81_C8", "label": "self._current_suite_setup_executed =", "type": "assigned_variable", "loc": [81, 81], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L80_C4", "vector": [14, 2, 0.4378, 0.0054, 2, 0.52, 0.0, 166, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self._current_suite_setup_executed", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._current_suite_setup_executed = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L83_C4", "label": "suite_setup_err", "type": "function", "loc": [83, 86], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99811:ClassDef_L15_C0", "vector": [2, 1, 0.4568, 0.0216, 1, 0.37, 0.7619, 745, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "suite_setup_err", "arg_names": ["self", "err"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def suite_setup_err(self, err):\n if err.exit:\n self._exit_fatal = True\n self._current_setup_err = unicode(err)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99811:If_L84_C8", "label": "if", "type": "if", "loc": [84, 85], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L83_C4", "vector": [4, 2, 0.4568, 0.0108, 2, 0.28, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if err.exit:\n self._exit_fatal = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99811:Assign_L85_C12", "label": "self._exit_fatal =", "type": "assigned_variable", "loc": [85, 85], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99811:If_L84_C8", "vector": [14, 3, 0.4595, 0.0054, 3, 0.5, 0.0, 844, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self._exit_fatal", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._exit_fatal = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99811:Assign_L86_C8", "label": "self._current_setup_err = unicode()", "type": "assigned_variable", "loc": [86, 86], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L83_C4", "vector": [14, 2, 0.4649, 0.0054, 2, 0.28, 1.0, 443, 3, 1, 0, 0, 733, 10, 1], "semantic": {"name": "self._current_setup_err", "arg_names": [], "import_names": [], "rhs_call_name": "unicode", "annotation": ""}, "snippet": " self._current_setup_err = unicode(err)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L88_C4", "label": "suite_error", "type": "function", "loc": [88, 97], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99811:ClassDef_L15_C0", "vector": [2, 1, 0.5, 0.0541, 1, 0.37, 0.8095, 820, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "suite_error", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def suite_error(self):\n if self._earlier_init_erros_occurred():\n return self._parent_suite_init_error\n if self._earlier_setup_errors_occurred():\n return self._parent_suite_setup_error\n if self._current_init_err:\n return self._current_init_err\n if self._current_setup_err:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99811:If_L89_C8", "label": "if", "type": "if", "loc": [89, 90], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L88_C4", "vector": [4, 2, 0.4838, 0.0108, 2, 0.93, 0.0, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self._earlier_init_erros_occurred():\n return self._parent_suite_init_error"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99811:Return_L90_C12", "label": "return", "type": "return", "loc": [90, 90], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99811:If_L89_C8", "vector": [13, 3, 0.4865, 0.0054, 3, 0.18, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._parent_suite_init_error"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99811:If_L91_C8", "label": "if", "type": "if", "loc": [91, 92], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L88_C4", "vector": [4, 2, 0.4946, 0.0108, 2, 0.93, 0.25, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self._earlier_setup_errors_occurred():\n return self._parent_suite_setup_error"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99811:Return_L92_C12", "label": "return", "type": "return", "loc": [92, 92], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99811:If_L91_C8", "vector": [13, 3, 0.4973, 0.0054, 3, 0.53, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._parent_suite_setup_error"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99811:If_L93_C8", "label": "if", "type": "if", "loc": [93, 94], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L88_C4", "vector": [4, 2, 0.5054, 0.0108, 2, 0.93, 0.5, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self._current_init_err:\n return self._current_init_err"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99811:Return_L94_C12", "label": "return", "type": "return", "loc": [94, 94], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99811:If_L93_C8", "vector": [13, 3, 0.5081, 0.0054, 3, 0.78, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._current_init_err"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99811:If_L95_C8", "label": "if", "type": "if", "loc": [95, 96], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L88_C4", "vector": [4, 2, 0.5162, 0.0108, 2, 0.93, 0.75, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self._current_setup_err:\n return 'Suite setup failed:\\n%s' % self._current_setup_err"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99811:Return_L96_C12", "label": "return", "type": "return", "loc": [96, 96], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99811:If_L95_C8", "vector": [13, 3, 0.5189, 0.0054, 3, 0.18, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 'Suite setup failed:\\n%s' % self._current_setup_err"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99811:Return_L97_C8", "label": "return", "type": "return", "loc": [97, 97], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L88_C4", "vector": [13, 2, 0.5243, 0.0054, 2, 0.93, 1.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L99_C4", "label": "_earlier_init_erros_occurred", "type": "function", "loc": [99, 100], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99811:ClassDef_L15_C0", "vector": [2, 1, 0.5378, 0.0108, 1, 0.37, 0.8571, 60, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "_earlier_init_erros_occurred", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _earlier_init_erros_occurred(self):\n return any(self._earlier_init_errors)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99811:Return_L100_C8", "label": "return", "type": "return", "loc": [100, 100], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L99_C4", "vector": [13, 2, 0.5405, 0.0054, 2, 0.02, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return any(self._earlier_init_errors)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L102_C4", "label": "_earlier_setup_errors_occurred", "type": "function", "loc": [102, 103], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99811:ClassDef_L15_C0", "vector": [2, 1, 0.5541, 0.0108, 1, 0.37, 0.9048, 497, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "_earlier_setup_errors_occurred", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _earlier_setup_errors_occurred(self):\n return any(self._earlier_setup_errors)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99811:Return_L103_C8", "label": "return", "type": "return", "loc": [103, 103], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L102_C4", "vector": [13, 2, 0.5568, 0.0054, 2, 0.2, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return any(self._earlier_setup_errors)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L105_C4", "label": "child_error", "type": "function", "loc": [105, 114], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99811:ClassDef_L15_C0", "vector": [2, 1, 0.5919, 0.0541, 1, 0.37, 0.9524, 59, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "child_error", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def child_error(self):\n if self._current_init_err or self._earlier_init_erros_occurred():\n return self._parent_suite_init_error\n if self._current_setup_err or self._earlier_setup_errors_occurred():\n return self._parent_suite_setup_error\n if self._exit_runmode:\n return self._exit_on_failure_error\n if self._exit_fatal:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99811:If_L106_C8", "label": "if", "type": "if", "loc": [106, 107], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L105_C4", "vector": [4, 2, 0.5757, 0.0108, 2, 0.71, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self._current_init_err or self._earlier_init_erros_occurred():\n return self._parent_suite_init_error"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99811:Return_L107_C12", "label": "return", "type": "return", "loc": [107, 107], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99811:If_L106_C8", "vector": [13, 3, 0.5784, 0.0054, 3, 0.68, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._parent_suite_init_error"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99811:If_L108_C8", "label": "if", "type": "if", "loc": [108, 109], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L105_C4", "vector": [4, 2, 0.5865, 0.0108, 2, 0.71, 0.25, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self._current_setup_err or self._earlier_setup_errors_occurred():\n return self._parent_suite_setup_error"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99811:Return_L109_C12", "label": "return", "type": "return", "loc": [109, 109], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99811:If_L108_C8", "vector": [13, 3, 0.5892, 0.0054, 3, 0.6, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._parent_suite_setup_error"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99811:If_L110_C8", "label": "if", "type": "if", "loc": [110, 111], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L105_C4", "vector": [4, 2, 0.5973, 0.0108, 2, 0.71, 0.5, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self._exit_runmode:\n return self._exit_on_failure_error"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99811:Return_L111_C12", "label": "return", "type": "return", "loc": [111, 111], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99811:If_L110_C8", "vector": [13, 3, 0.6, 0.0054, 3, 0.07, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._exit_on_failure_error"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99811:If_L112_C8", "label": "if", "type": "if", "loc": [112, 113], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L105_C4", "vector": [4, 2, 0.6081, 0.0108, 2, 0.71, 0.75, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self._exit_fatal:\n return self._exit_on_fatal_error"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99811:Return_L113_C12", "label": "return", "type": "return", "loc": [113, 113], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99811:If_L112_C8", "vector": [13, 3, 0.6108, 0.0054, 3, 0.98, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._exit_on_fatal_error"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99811:Return_L114_C8", "label": "return", "type": "return", "loc": [114, 114], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L105_C4", "vector": [13, 2, 0.6162, 0.0054, 2, 0.71, 1.0, 0, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L116_C4", "label": "test_failed", "type": "function", "loc": [116, 120], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99811:ClassDef_L15_C0", "vector": [2, 1, 0.6378, 0.027, 1, 0.37, 1.0, 749, 0, 3, 0, 0, 0, 0, 0], "semantic": {"name": "test_failed", "arg_names": ["self", "exit", "critical"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def test_failed(self, exit=False, critical=False):\n if critical and self._run_mode_is_exit_on_failure:\n self._exit_runmode = True\n if exit:\n self._exit_fatal = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99811:If_L117_C8", "label": "if", "type": "if", "loc": [117, 118], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L116_C4", "vector": [4, 2, 0.6351, 0.0108, 2, 0.07, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if critical and self._run_mode_is_exit_on_failure:\n self._exit_runmode = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99811:Assign_L118_C12", "label": "self._exit_runmode =", "type": "assigned_variable", "loc": [118, 118], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99811:If_L117_C8", "vector": [14, 3, 0.6378, 0.0054, 3, 0.65, 0.0, 792, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self._exit_runmode", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._exit_runmode = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99811:If_L119_C8", "label": "if", "type": "if", "loc": [119, 120], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L116_C4", "vector": [4, 2, 0.6459, 0.0108, 2, 0.07, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if exit:\n self._exit_fatal = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99811:Assign_L120_C12", "label": "self._exit_fatal =", "type": "assigned_variable", "loc": [120, 120], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99811:If_L119_C8", "vector": [14, 3, 0.6486, 0.0054, 3, 0.41, 0.0, 844, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self._exit_fatal", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._exit_fatal = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99811:ClassDef_L123_C0", "label": "TestRunErrors", "type": "class", "loc": [123, 165], "level": 0, "parent": null, "vector": [3, 0, 0.7784, 0.2324, 0, 0.66, 0.5, 857, 0, 11, 0, 0, 186, 0, 4], "semantic": {"name": "TestRunErrors", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class TestRunErrors(object):\n\n def __init__(self, err):\n self._parent_err = err.child_error() if err else None\n self._init_err = None\n self._setup_err = None\n self._kw_err = None\n self._teardown_err = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L125_C4", "label": "__init__", "type": "function", "loc": [125, 130], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99811:ClassDef_L123_C0", "vector": [2, 1, 0.6892, 0.0324, 1, 0.71, 0.0, 555, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": ["self", "err"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, err):\n self._parent_err = err.child_error() if err else None\n self._init_err = None\n self._setup_err = None\n self._kw_err = None\n self._teardown_err = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99811:Assign_L126_C8", "label": "self._parent_err =", "type": "assigned_variable", "loc": [126, 126], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L125_C4", "vector": [14, 2, 0.6811, 0.0054, 2, 0.38, 0.0, 170, 8, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self._parent_err", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._parent_err = err.child_error() if err else None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99811:Assign_L127_C8", "label": "self._init_err =", "type": "assigned_variable", "loc": [127, 127], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L125_C4", "vector": [14, 2, 0.6865, 0.0054, 2, 0.38, 0.25, 782, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self._init_err", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._init_err = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99811:Assign_L128_C8", "label": "self._setup_err =", "type": "assigned_variable", "loc": [128, 128], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L125_C4", "vector": [14, 2, 0.6919, 0.0054, 2, 0.38, 0.5, 983, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self._setup_err", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._setup_err = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99811:Assign_L129_C8", "label": "self._kw_err =", "type": "assigned_variable", "loc": [129, 129], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L125_C4", "vector": [14, 2, 0.6973, 0.0054, 2, 0.38, 0.75, 550, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self._kw_err", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._kw_err = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99811:Assign_L130_C8", "label": "self._teardown_err =", "type": "assigned_variable", "loc": [130, 130], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L125_C4", "vector": [14, 2, 0.7027, 0.0054, 2, 0.38, 1.0, 299, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self._teardown_err", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._teardown_err = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L132_C4", "label": "is_allowed_to_run", "type": "function", "loc": [132, 133], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99811:ClassDef_L123_C0", "vector": [2, 1, 0.7162, 0.0108, 1, 0.71, 0.1, 892, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "is_allowed_to_run", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def is_allowed_to_run(self):\n return not bool(self._parent_err or self._init_err)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99811:Return_L133_C8", "label": "return", "type": "return", "loc": [133, 133], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L132_C4", "vector": [13, 2, 0.7189, 0.0054, 2, 0.0, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return not bool(self._parent_err or self._init_err)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L135_C4", "label": "init_err", "type": "function", "loc": [135, 136], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99811:ClassDef_L123_C0", "vector": [2, 1, 0.7324, 0.0108, 1, 0.71, 0.2, 424, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "init_err", "arg_names": ["self", "err"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def init_err(self, err):\n self._init_err = err"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99811:Assign_L136_C8", "label": "self._init_err =", "type": "assigned_variable", "loc": [136, 136], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L135_C4", "vector": [14, 2, 0.7351, 0.0054, 2, 0.88, 0.0, 782, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._init_err", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._init_err = err"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L138_C4", "label": "setup_err", "type": "function", "loc": [138, 139], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99811:ClassDef_L123_C0", "vector": [2, 1, 0.7486, 0.0108, 1, 0.71, 0.3, 571, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "setup_err", "arg_names": ["self", "err"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def setup_err(self, err):\n self._setup_err = err"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99811:Assign_L139_C8", "label": "self._setup_err =", "type": "assigned_variable", "loc": [139, 139], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L138_C4", "vector": [14, 2, 0.7514, 0.0054, 2, 0.13, 0.0, 983, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._setup_err", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._setup_err = err"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L141_C4", "label": "setup_failed", "type": "function", "loc": [141, 142], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99811:ClassDef_L123_C0", "vector": [2, 1, 0.7649, 0.0108, 1, 0.71, 0.4, 357, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "setup_failed", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def setup_failed(self):\n return bool(self._setup_err)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99811:Return_L142_C8", "label": "return", "type": "return", "loc": [142, 142], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L141_C4", "vector": [13, 2, 0.7676, 0.0054, 2, 0.92, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return bool(self._setup_err)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L144_C4", "label": "kw_err", "type": "function", "loc": [144, 145], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99811:ClassDef_L123_C0", "vector": [2, 1, 0.7811, 0.0108, 1, 0.71, 0.5, 937, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "kw_err", "arg_names": ["self", "error"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def kw_err(self, error):\n self._kw_err = error"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99811:Assign_L145_C8", "label": "self._kw_err =", "type": "assigned_variable", "loc": [145, 145], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L144_C4", "vector": [14, 2, 0.7838, 0.0054, 2, 0.7, 0.0, 550, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._kw_err", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._kw_err = error"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L147_C4", "label": "teardown_err", "type": "function", "loc": [147, 148], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99811:ClassDef_L123_C0", "vector": [2, 1, 0.7973, 0.0108, 1, 0.71, 0.6, 386, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "teardown_err", "arg_names": ["self", "err"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def teardown_err(self, err):\n self._teardown_err = err"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99811:Assign_L148_C8", "label": "self._teardown_err =", "type": "assigned_variable", "loc": [148, 148], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L147_C4", "vector": [14, 2, 0.8, 0.0054, 2, 0.31, 0.0, 299, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._teardown_err", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._teardown_err = err"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L150_C4", "label": "teardown_failed", "type": "function", "loc": [150, 151], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99811:ClassDef_L123_C0", "vector": [2, 1, 0.8135, 0.0108, 1, 0.71, 0.7, 218, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "teardown_failed", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def teardown_failed(self):\n return bool(self._teardown_err)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99811:Return_L151_C8", "label": "return", "type": "return", "loc": [151, 151], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L150_C4", "vector": [13, 2, 0.8162, 0.0054, 2, 0.25, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return bool(self._teardown_err)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L153_C4", "label": "get_message", "type": "function", "loc": [153, 156], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99811:ClassDef_L123_C0", "vector": [2, 1, 0.8351, 0.0216, 1, 0.71, 0.8, 305, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "get_message", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_message(self):\n if self._setup_err:\n return 'Setup failed:\\n%s' % self._setup_err\n return self._kw_err"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99811:If_L154_C8", "label": "if", "type": "if", "loc": [154, 155], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L153_C4", "vector": [4, 2, 0.8351, 0.0108, 2, 0.91, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self._setup_err:\n return 'Setup failed:\\n%s' % self._setup_err"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99811:Return_L155_C12", "label": "return", "type": "return", "loc": [155, 155], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99811:If_L154_C8", "vector": [13, 3, 0.8378, 0.0054, 3, 0.63, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 'Setup failed:\\n%s' % self._setup_err"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99811:Return_L156_C8", "label": "return", "type": "return", "loc": [156, 156], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L153_C4", "vector": [13, 2, 0.8432, 0.0054, 2, 0.91, 1.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._kw_err"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L158_C4", "label": "get_teardown_message", "type": "function", "loc": [158, 162], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99811:ClassDef_L123_C0", "vector": [2, 1, 0.8649, 0.027, 1, 0.71, 0.9, 59, 0, 2, 1, 0, 0, 0, 0], "semantic": {"name": "get_teardown_message", "arg_names": ["self", "message"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_teardown_message(self, message):\n # TODO: This API is really in need of cleanup\n if message == '':\n return 'Teardown failed:\\n%s' % self._teardown_err\n return '%s\\n\\nAlso teardown failed:\\n%s' % (message, self._teardown_err)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99811:If_L160_C8", "label": "if", "type": "if", "loc": [160, 161], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L158_C4", "vector": [4, 2, 0.8676, 0.0108, 2, 0.95, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if message == '':\n return 'Teardown failed:\\n%s' % self._teardown_err"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99811:Return_L161_C12", "label": "return", "type": "return", "loc": [161, 161], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99811:If_L160_C8", "vector": [13, 3, 0.8703, 0.0054, 3, 0.25, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 'Teardown failed:\\n%s' % self._teardown_err"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99811:Return_L162_C8", "label": "return", "type": "return", "loc": [162, 162], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L158_C4", "vector": [13, 2, 0.8757, 0.0054, 2, 0.95, 1.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return '%s\\n\\nAlso teardown failed:\\n%s' % (message, self._teardown_err)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L164_C4", "label": "parent_or_init_error", "type": "function", "loc": [164, 165], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99811:ClassDef_L123_C0", "vector": [2, 1, 0.8892, 0.0108, 1, 0.71, 1.0, 852, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "parent_or_init_error", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def parent_or_init_error(self):\n return self._parent_err or self._init_err"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99811:Return_L165_C8", "label": "return", "type": "return", "loc": [165, 165], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L164_C4", "vector": [13, 2, 0.8919, 0.0054, 2, 0.61, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._parent_err or self._init_err"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99811:ClassDef_L168_C0", "label": "KeywordRunErrors", "type": "class", "loc": [168, 184], "level": 0, "parent": null, "vector": [3, 0, 0.9514, 0.0919, 0, 0.66, 1.0, 599, 0, 3, 0, 0, 186, 0, 0], "semantic": {"name": "KeywordRunErrors", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class KeywordRunErrors(object):\n\n def __init__(self):\n self.teardown_error = None\n\n def get_message(self):\n if not self._teardown_err:\n return self._kw_err"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L170_C4", "label": "__init__", "type": "function", "loc": [170, 171], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99811:ClassDef_L168_C0", "vector": [2, 1, 0.9216, 0.0108, 1, 0.97, 0.0, 555, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self):\n self.teardown_error = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99811:Assign_L171_C8", "label": "self.teardown_error =", "type": "assigned_variable", "loc": [171, 171], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L170_C4", "vector": [14, 2, 0.9243, 0.0054, 2, 0.36, 0.0, 43, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.teardown_error", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.teardown_error = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L173_C4", "label": "get_message", "type": "function", "loc": [173, 179], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99811:ClassDef_L168_C0", "vector": [2, 1, 0.9514, 0.0378, 1, 0.97, 0.5, 305, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "get_message", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_message(self):\n if not self._teardown_err:\n return self._kw_err\n if not self._kw_err:\n return 'Keyword teardown failed:\\n%s' % self._teardown_err\n return '%s\\n\\nAlso keyword teardown failed:\\n%s' % (self._kw_err,\n self._teardown_err)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99811:If_L174_C8", "label": "if", "type": "if", "loc": [174, 175], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L173_C4", "vector": [4, 2, 0.9432, 0.0108, 2, 0.24, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not self._teardown_err:\n return self._kw_err"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99811:Return_L175_C12", "label": "return", "type": "return", "loc": [175, 175], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99811:If_L174_C8", "vector": [13, 3, 0.9459, 0.0054, 3, 0.41, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._kw_err"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99811:If_L176_C8", "label": "if", "type": "if", "loc": [176, 177], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L173_C4", "vector": [4, 2, 0.9541, 0.0108, 2, 0.24, 0.5, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not self._kw_err:\n return 'Keyword teardown failed:\\n%s' % self._teardown_err"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99811:Return_L177_C12", "label": "return", "type": "return", "loc": [177, 177], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99811:If_L176_C8", "vector": [13, 3, 0.9568, 0.0054, 3, 0.77, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 'Keyword teardown failed:\\n%s' % self._teardown_err"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99811:Return_L178_C8", "label": "return", "type": "return", "loc": [178, 179], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L173_C4", "vector": [13, 2, 0.9649, 0.0108, 2, 0.24, 1.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return '%s\\n\\nAlso keyword teardown failed:\\n%s' % (self._kw_err,\n self._teardown_err)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L183_C4", "label": "teardown_err", "type": "function", "loc": [183, 184], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99811:ClassDef_L168_C0", "vector": [2, 1, 0.9919, 0.0108, 1, 0.97, 1.0, 386, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "teardown_err", "arg_names": ["self", "err"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def teardown_err(self, err):\n self.teardown_error = err"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99811:Assign_L184_C8", "label": "self.teardown_error =", "type": "assigned_variable", "loc": [184, 184], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L183_C4", "vector": [14, 2, 0.9946, 0.0054, 2, 0.93, 0.0, 43, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.teardown_error", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.teardown_error = err"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99811:ClassDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99811:Assign_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99811:ClassDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99811:Assign_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99811:ClassDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99811:Assign_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99811:ClassDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99811:Assign_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99811:ClassDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99811:Assign_L21_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99811:ClassDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L23_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99811:Assign_L24_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L23_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99811:Assign_L25_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L23_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99811:Assign_L26_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L23_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99811:Assign_L27_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L23_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99811:Assign_L28_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L23_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99811:Expr_L29_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L23_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99811:Assign_L30_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L23_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99811:Assign_L31_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99811:ClassDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L34_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L34_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99811:Return_L35_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99811:ClassDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L37_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99811:Assign_L38_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99811:ClassDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L40_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L40_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99811:Expr_L41_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L40_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99811:Expr_L42_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L40_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99811:Expr_L43_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L40_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99811:Expr_L44_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L40_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99811:Assign_L45_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99811:ClassDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L47_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L47_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99811:Assign_L48_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L47_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99811:Assign_L49_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L47_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99811:Assign_L50_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99811:ClassDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L52_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L52_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99811:Return_L53_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99811:ClassDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L56_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L56_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99811:If_L57_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99811:If_L57_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99811:Return_L58_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L56_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99811:If_L59_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99811:If_L59_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99811:Return_L60_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L56_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99811:Return_L61_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99811:ClassDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L64_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L64_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99811:If_L65_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99811:If_L65_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99811:Return_L66_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L64_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99811:Return_L67_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99811:ClassDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L69_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L69_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99811:If_L70_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99811:If_L70_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99811:Return_L71_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L69_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99811:For_L72_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99811:For_L72_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99811:If_L73_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99811:If_L73_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99811:Return_L74_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L69_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99811:Return_L75_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99811:ClassDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L77_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L77_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99811:Assign_L78_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99811:ClassDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L80_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L80_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99811:Assign_L81_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99811:ClassDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L83_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L83_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99811:If_L84_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99811:If_L84_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99811:Assign_L85_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L83_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99811:Assign_L86_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99811:ClassDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L88_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L88_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99811:If_L89_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99811:If_L89_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99811:Return_L90_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L88_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99811:If_L91_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99811:If_L91_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99811:Return_L92_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L88_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99811:If_L93_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99811:If_L93_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99811:Return_L94_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L88_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99811:If_L95_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99811:If_L95_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99811:Return_L96_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L88_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99811:Return_L97_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99811:ClassDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L99_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L99_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99811:Return_L100_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99811:ClassDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L102_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L102_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99811:Return_L103_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99811:ClassDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L105_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L105_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99811:If_L106_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99811:If_L106_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99811:Return_L107_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L105_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99811:If_L108_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99811:If_L108_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99811:Return_L109_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L105_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99811:If_L110_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99811:If_L110_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99811:Return_L111_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L105_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99811:If_L112_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99811:If_L112_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99811:Return_L113_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L105_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99811:Return_L114_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99811:ClassDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L116_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L116_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99811:If_L117_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99811:If_L117_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99811:Assign_L118_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L116_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99811:If_L119_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99811:If_L119_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99811:Assign_L120_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99811:ClassDef_L123_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L125_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L125_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99811:Assign_L126_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L125_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99811:Assign_L127_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L125_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99811:Assign_L128_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L125_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99811:Assign_L129_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L125_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99811:Assign_L130_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99811:ClassDef_L123_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L132_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L132_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99811:Return_L133_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99811:ClassDef_L123_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L135_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L135_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99811:Assign_L136_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99811:ClassDef_L123_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L138_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L138_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99811:Assign_L139_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99811:ClassDef_L123_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L141_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L141_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99811:Return_L142_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99811:ClassDef_L123_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L144_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L144_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99811:Assign_L145_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99811:ClassDef_L123_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L147_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L147_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99811:Assign_L148_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99811:ClassDef_L123_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L150_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L150_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99811:Return_L151_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99811:ClassDef_L123_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L153_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L153_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99811:If_L154_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99811:If_L154_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99811:Return_L155_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L153_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99811:Return_L156_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99811:ClassDef_L123_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L158_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L158_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99811:If_L160_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99811:If_L160_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99811:Return_L161_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L158_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99811:Return_L162_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99811:ClassDef_L123_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L164_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L164_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99811:Return_L165_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99811:ClassDef_L168_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L170_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L170_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99811:Assign_L171_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99811:ClassDef_L168_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L173_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L173_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99811:If_L174_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99811:If_L174_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99811:Return_L175_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L173_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99811:If_L176_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99811:If_L176_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99811:Return_L177_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L173_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99811:Return_L178_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99811:ClassDef_L168_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L183_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99811:FunctionDef_L183_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99811:Assign_L184_C8"}] |
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import sys
from StringIO import StringIO
class OutputCapturer:
def __init__(self):
self._python_out = _PythonCapturer(stdout=True)
self._python_err = _PythonCapturer(stdout=False)
self._java_out = _JavaCapturer(stdout=True)
self._java_err = _JavaCapturer(stdout=False)
def release(self):
py_out = self._python_out.release()
py_err = self._python_err.release()
java_out = self._java_out.release()
java_err = self._java_err.release()
# FIXME: Should return both Python and Java stdout/stderr.
# It is unfortunately not possible to do py_out+java_out here, because
# java_out is always Unicode and py_out is bytes (=str). When py_out
# contains non-ASCII bytes catenation fails with UnicodeError.
# Unfortunately utils.unic(py_out) doesn't work either, because later
# splitting the output to levels and messages fails. Should investigate
# why that happens. It also seems that the byte message are never
# converted to Unicode - at least Message class doesn't do that.
# It's probably safe to leave this code like it is in RF 2.5, because
# a) the earlier versions worked the same way, and b) this code is
# used so that there should never be output both from Python and Java.
return (py_out, py_err) if (py_out or py_err) else (java_out, java_err)
class _PythonCapturer(object):
def __init__(self, stdout=True):
if stdout:
self._original = sys.stdout
self._set_stream = self._set_stdout
else:
self._original = sys.stderr
self._set_stream = self._set_stderr
self._stream = StringIO()
self._set_stream(self._stream)
def _set_stdout(self, stream):
sys.stdout = stream
def _set_stderr(self, stream):
sys.stderr = stream
def release(self):
# Original stream must be restored before closing the current
self._set_stream(self._original)
self._stream.flush()
output = self._stream.getvalue()
self._stream.close()
return output
if not sys.platform.startswith('java'):
class _JavaCapturer(object):
def __init__(self, stdout):
pass
def release(self):
return ''
else:
from java.io import PrintStream, ByteArrayOutputStream
from java.lang import System
class _JavaCapturer(object):
def __init__(self, stdout=True):
if stdout:
self._original = System.out
self._set_stream = System.setOut
else:
self._original = System.err
self._set_stream = System.setErr
self._bytes = ByteArrayOutputStream()
self._stream = PrintStream(self._bytes, False, 'UTF-8')
self._set_stream(self._stream)
def release(self):
# Original stream must be restored before closing the current
self._set_stream(self._original)
self._stream.close()
output = self._bytes.toString('UTF-8')
self._bytes.reset()
return output
| ajibawa-2023/Python-Code-Large/train/row_99813 | 56 | 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_99813:Import_L15_C0", "label": "sys import sys", "type": "import", "loc": [15, 15], "level": 0, "parent": null, "vector": [1, 0, 0.1415, 0.0094, 0, 0.66, 0.0, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sys"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99813:ImportFrom_L16_C0", "label": "from StringIO import StringIO", "type": "import", "loc": [16, 16], "level": 0, "parent": null, "vector": [1, 0, 0.1509, 0.0094, 0, 0.66, 0.25, 609, 0, 1, 0, 0, 609, 0, 0], "semantic": {"name": "StringIO", "arg_names": [], "import_names": ["StringIO"], "rhs_call_name": "", "annotation": ""}, "snippet": "from StringIO import StringIO"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99813:ClassDef_L19_C0", "label": "OutputCapturer", "type": "class", "loc": [19, 43], "level": 0, "parent": null, "vector": [3, 0, 0.2925, 0.2358, 0, 0.66, 0.5, 527, 0, 2, 0, 0, 0, 0, 8], "semantic": {"name": "OutputCapturer", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class OutputCapturer:\n\n def __init__(self):\n self._python_out = _PythonCapturer(stdout=True)\n self._python_err = _PythonCapturer(stdout=False)\n self._java_out = _JavaCapturer(stdout=True)\n self._java_err = _JavaCapturer(stdout=False)\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99813:FunctionDef_L21_C4", "label": "__init__", "type": "function", "loc": [21, 25], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99813:ClassDef_L19_C0", "vector": [2, 1, 0.217, 0.0472, 1, 0.85, 0.0, 555, 0, 1, 0, 0, 0, 0, 4], "semantic": {"name": "__init__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self):\n self._python_out = _PythonCapturer(stdout=True)\n self._python_err = _PythonCapturer(stdout=False)\n self._java_out = _JavaCapturer(stdout=True)\n self._java_err = _JavaCapturer(stdout=False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99813:Assign_L22_C8", "label": "self._python_out = _PythonCapturer()", "type": "assigned_variable", "loc": [22, 22], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99813:FunctionDef_L21_C4", "vector": [14, 2, 0.2075, 0.0094, 2, 0.71, 0.0, 389, 3, 1, 0, 0, 407, 10, 1], "semantic": {"name": "self._python_out", "arg_names": [], "import_names": [], "rhs_call_name": "_PythonCapturer", "annotation": ""}, "snippet": " self._python_out = _PythonCapturer(stdout=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99813:Assign_L23_C8", "label": "self._python_err = _PythonCapturer()", "type": "assigned_variable", "loc": [23, 23], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99813:FunctionDef_L21_C4", "vector": [14, 2, 0.217, 0.0094, 2, 0.71, 0.3333, 422, 3, 1, 0, 0, 407, 10, 1], "semantic": {"name": "self._python_err", "arg_names": [], "import_names": [], "rhs_call_name": "_PythonCapturer", "annotation": ""}, "snippet": " self._python_err = _PythonCapturer(stdout=False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99813:Assign_L24_C8", "label": "self._java_out = _JavaCapturer()", "type": "assigned_variable", "loc": [24, 24], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99813:FunctionDef_L21_C4", "vector": [14, 2, 0.2264, 0.0094, 2, 0.71, 0.6667, 816, 3, 1, 0, 0, 733, 10, 1], "semantic": {"name": "self._java_out", "arg_names": [], "import_names": [], "rhs_call_name": "_JavaCapturer", "annotation": ""}, "snippet": " self._java_out = _JavaCapturer(stdout=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99813:Assign_L25_C8", "label": "self._java_err = _JavaCapturer()", "type": "assigned_variable", "loc": [25, 25], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99813:FunctionDef_L21_C4", "vector": [14, 2, 0.2358, 0.0094, 2, 0.71, 1.0, 84, 3, 1, 0, 0, 733, 10, 1], "semantic": {"name": "self._java_err", "arg_names": [], "import_names": [], "rhs_call_name": "_JavaCapturer", "annotation": ""}, "snippet": " self._java_err = _JavaCapturer(stdout=False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99813:FunctionDef_L27_C4", "label": "release", "type": "function", "loc": [27, 43], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99813:ClassDef_L19_C0", "vector": [2, 1, 0.3302, 0.1604, 1, 0.85, 1.0, 784, 0, 1, 1, 0, 0, 0, 4], "semantic": {"name": "release", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def release(self):\n py_out = self._python_out.release()\n py_err = self._python_err.release()\n java_out = self._java_out.release()\n java_err = self._java_err.release()\n # FIXME: Should return both Python and Java stdout/stderr.\n # It is unfortunately not possible to do py_out+java_out here, because\n # java_out is always Unicode and py_out is bytes (=str). When py_out"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99813:Assign_L28_C8", "label": "py_out = release()", "type": "assigned_variable", "loc": [28, 28], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99813:FunctionDef_L27_C4", "vector": [14, 2, 0.2642, 0.0094, 2, 0.54, 0.0, 253, 3, 0, 0, 0, 784, 10, 1], "semantic": {"name": "py_out", "arg_names": [], "import_names": [], "rhs_call_name": "release", "annotation": ""}, "snippet": " py_out = self._python_out.release()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99813:Assign_L29_C8", "label": "py_err = release()", "type": "assigned_variable", "loc": [29, 29], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99813:FunctionDef_L27_C4", "vector": [14, 2, 0.2736, 0.0094, 2, 0.54, 0.25, 457, 3, 0, 0, 0, 784, 10, 1], "semantic": {"name": "py_err", "arg_names": [], "import_names": [], "rhs_call_name": "release", "annotation": ""}, "snippet": " py_err = self._python_err.release()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99813:Assign_L30_C8", "label": "java_out = release()", "type": "assigned_variable", "loc": [30, 30], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99813:FunctionDef_L27_C4", "vector": [14, 2, 0.283, 0.0094, 2, 0.54, 0.5, 724, 3, 0, 0, 0, 784, 10, 1], "semantic": {"name": "java_out", "arg_names": [], "import_names": [], "rhs_call_name": "release", "annotation": ""}, "snippet": " java_out = self._java_out.release()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99813:Assign_L31_C8", "label": "java_err = release()", "type": "assigned_variable", "loc": [31, 31], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99813:FunctionDef_L27_C4", "vector": [14, 2, 0.2925, 0.0094, 2, 0.54, 0.75, 260, 3, 0, 0, 0, 784, 10, 1], "semantic": {"name": "java_err", "arg_names": [], "import_names": [], "rhs_call_name": "release", "annotation": ""}, "snippet": " java_err = self._java_err.release()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99813:Return_L43_C8", "label": "return", "type": "return", "loc": [43, 43], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99813:FunctionDef_L27_C4", "vector": [13, 2, 0.4057, 0.0094, 2, 0.54, 1.0, 0, 8, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return (py_out, py_err) if (py_out or py_err) else (java_out, java_err)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99813:ClassDef_L46_C0", "label": "_PythonCapturer", "type": "class", "loc": [46, 70], "level": 0, "parent": null, "vector": [3, 0, 0.5472, 0.2358, 0, 0.66, 0.75, 407, 0, 4, 0, 0, 186, 0, 6], "semantic": {"name": "_PythonCapturer", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class _PythonCapturer(object):\n\n def __init__(self, stdout=True):\n if stdout:\n self._original = sys.stdout\n self._set_stream = self._set_stdout\n else:\n self._original = sys.stderr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99813:FunctionDef_L48_C4", "label": "__init__", "type": "function", "loc": [48, 56], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99813:ClassDef_L46_C0", "vector": [2, 1, 0.4906, 0.0849, 1, 0.26, 0.0, 555, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": ["self", "stdout"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, stdout=True):\n if stdout:\n self._original = sys.stdout\n self._set_stream = self._set_stdout\n else:\n self._original = sys.stderr\n self._set_stream = self._set_stderr\n self._stream = StringIO()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99813:If_L49_C8", "label": "if", "type": "if", "loc": [49, 54], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99813:FunctionDef_L48_C4", "vector": [4, 2, 0.4858, 0.0566, 2, 0.12, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if stdout:\n self._original = sys.stdout\n self._set_stream = self._set_stdout\n else:\n self._original = sys.stderr\n self._set_stream = self._set_stderr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99813:Assign_L50_C12", "label": "self._original =", "type": "assigned_variable", "loc": [50, 50], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99813:If_L49_C8", "vector": [14, 3, 0.4717, 0.0094, 3, 0.98, 0.0, 995, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._original", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._original = sys.stdout"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99813:Assign_L51_C12", "label": "self._set_stream =", "type": "assigned_variable", "loc": [51, 51], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99813:If_L49_C8", "vector": [14, 3, 0.4811, 0.0094, 3, 0.98, 0.3333, 280, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._set_stream", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._set_stream = self._set_stdout"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99813:Assign_L53_C12", "label": "self._original =", "type": "assigned_variable", "loc": [53, 53], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99813:If_L49_C8", "vector": [14, 3, 0.5, 0.0094, 3, 0.98, 0.6667, 995, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._original", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._original = sys.stderr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99813:Assign_L54_C12", "label": "self._set_stream =", "type": "assigned_variable", "loc": [54, 54], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99813:If_L49_C8", "vector": [14, 3, 0.5094, 0.0094, 3, 0.98, 1.0, 280, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._set_stream", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._set_stream = self._set_stderr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99813:Assign_L55_C8", "label": "self._stream = StringIO()", "type": "assigned_variable", "loc": [55, 55], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99813:FunctionDef_L48_C4", "vector": [14, 2, 0.5189, 0.0094, 2, 0.12, 0.5, 214, 3, 0, 0, 0, 609, 10, 1], "semantic": {"name": "self._stream", "arg_names": [], "import_names": [], "rhs_call_name": "StringIO", "annotation": ""}, "snippet": " self._stream = StringIO()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99813:Expr_L56_C8", "label": "_set_stream()", "type": "expression", "loc": [56, 56], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99813:FunctionDef_L48_C4", "vector": [8, 2, 0.5283, 0.0094, 2, 0.12, 1.0, 931, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_set_stream", "arg_names": [], "import_names": [], "rhs_call_name": "_set_stream", "annotation": ""}, "snippet": " self._set_stream(self._stream)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99813:FunctionDef_L58_C4", "label": "_set_stdout", "type": "function", "loc": [58, 59], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99813:ClassDef_L46_C0", "vector": [2, 1, 0.5519, 0.0189, 1, 0.26, 0.3333, 64, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "_set_stdout", "arg_names": ["self", "stream"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _set_stdout(self, stream):\n sys.stdout = stream "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99813:Assign_L59_C8", "label": "sys.stdout =", "type": "assigned_variable", "loc": [59, 59], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99813:FunctionDef_L58_C4", "vector": [14, 2, 0.5566, 0.0094, 2, 0.79, 0.0, 260, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "sys.stdout", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " sys.stdout = stream "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99813:FunctionDef_L61_C4", "label": "_set_stderr", "type": "function", "loc": [61, 62], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99813:ClassDef_L46_C0", "vector": [2, 1, 0.5802, 0.0189, 1, 0.26, 0.6667, 587, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "_set_stderr", "arg_names": ["self", "stream"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _set_stderr(self, stream):\n sys.stderr = stream "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99813:Assign_L62_C8", "label": "sys.stderr =", "type": "assigned_variable", "loc": [62, 62], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99813:FunctionDef_L61_C4", "vector": [14, 2, 0.5849, 0.0094, 2, 0.91, 0.0, 387, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "sys.stderr", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " sys.stderr = stream "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99813:FunctionDef_L64_C4", "label": "release", "type": "function", "loc": [64, 70], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99813:ClassDef_L46_C0", "vector": [2, 1, 0.6321, 0.066, 1, 0.26, 1.0, 784, 0, 1, 1, 0, 0, 0, 4], "semantic": {"name": "release", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def release(self):\n # Original stream must be restored before closing the current\n self._set_stream(self._original)\n self._stream.flush()\n output = self._stream.getvalue()\n self._stream.close()\n return output"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99813:Expr_L66_C8", "label": "_set_stream()", "type": "expression", "loc": [66, 66], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99813:FunctionDef_L64_C4", "vector": [8, 2, 0.6226, 0.0094, 2, 0.36, 0.0, 931, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_set_stream", "arg_names": [], "import_names": [], "rhs_call_name": "_set_stream", "annotation": ""}, "snippet": " self._set_stream(self._original)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99813:Expr_L67_C8", "label": "flush()", "type": "expression", "loc": [67, 67], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99813:FunctionDef_L64_C4", "vector": [8, 2, 0.6321, 0.0094, 2, 0.36, 0.25, 439, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "flush", "arg_names": [], "import_names": [], "rhs_call_name": "flush", "annotation": ""}, "snippet": " self._stream.flush()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99813:Assign_L68_C8", "label": "output = getvalue()", "type": "assigned_variable", "loc": [68, 68], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99813:FunctionDef_L64_C4", "vector": [14, 2, 0.6415, 0.0094, 2, 0.36, 0.5, 886, 3, 0, 0, 0, 626, 10, 1], "semantic": {"name": "output", "arg_names": [], "import_names": [], "rhs_call_name": "getvalue", "annotation": ""}, "snippet": " output = self._stream.getvalue()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99813:Expr_L69_C8", "label": "close()", "type": "expression", "loc": [69, 69], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99813:FunctionDef_L64_C4", "vector": [8, 2, 0.6509, 0.0094, 2, 0.36, 0.75, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": " self._stream.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99813:Return_L70_C8", "label": "return", "type": "return", "loc": [70, 70], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99813:FunctionDef_L64_C4", "vector": [13, 2, 0.6604, 0.0094, 2, 0.36, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return output"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99813:If_L73_C0", "label": "if", "type": "if", "loc": [73, 106], "level": 0, "parent": null, "vector": [4, 0, 0.8443, 0.3208, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 8], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if not sys.platform.startswith('java'):\n\n class _JavaCapturer(object):\n def __init__(self, stdout):\n pass\n def release(self):\n return ''\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99813:ClassDef_L75_C4", "label": "_JavaCapturer", "type": "class", "loc": [75, 79], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99813:If_L73_C0", "vector": [3, 1, 0.7264, 0.0472, 1, 0.34, 0.0, 733, 0, 2, 0, 0, 186, 0, 0], "semantic": {"name": "_JavaCapturer", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " class _JavaCapturer(object):\n def __init__(self, stdout):\n pass\n def release(self):\n return ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99813:FunctionDef_L76_C8", "label": "__init__", "type": "function", "loc": [76, 77], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99813:ClassDef_L75_C4", "vector": [2, 2, 0.7217, 0.0189, 2, 0.39, 0.0, 555, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "stdout"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, stdout):\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99813:FunctionDef_L78_C8", "label": "release", "type": "function", "loc": [78, 79], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99813:ClassDef_L75_C4", "vector": [2, 2, 0.7406, 0.0189, 2, 0.39, 1.0, 784, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "release", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def release(self):\n return ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99813:Return_L79_C12", "label": "return", "type": "return", "loc": [79, 79], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99813:FunctionDef_L78_C8", "vector": [13, 3, 0.7453, 0.0094, 3, 0.21, 0.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99813:ImportFrom_L83_C4", "label": "from java.io import PrintStream, ByteArrayOutputStream", "type": "import", "loc": [83, 83], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99813:If_L73_C0", "vector": [1, 1, 0.783, 0.0094, 1, 0.34, 0.3333, 181, 0, 2, 0, 0, 181, 0, 0], "semantic": {"name": "java.io", "arg_names": [], "import_names": ["PrintStream", "ByteArrayOutputStream"], "rhs_call_name": "", "annotation": ""}, "snippet": " from java.io import PrintStream, ByteArrayOutputStream"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99813:ImportFrom_L84_C4", "label": "from java.lang import System", "type": "import", "loc": [84, 84], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99813:If_L73_C0", "vector": [1, 1, 0.7925, 0.0094, 1, 0.34, 0.6667, 100, 0, 1, 0, 0, 100, 0, 0], "semantic": {"name": "java.lang", "arg_names": [], "import_names": ["System"], "rhs_call_name": "", "annotation": ""}, "snippet": " from java.lang import System"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99813:ClassDef_L87_C4", "label": "_JavaCapturer", "type": "class", "loc": [87, 106], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99813:If_L73_C0", "vector": [3, 1, 0.9104, 0.1887, 1, 0.34, 1.0, 733, 0, 2, 0, 0, 186, 0, 7], "semantic": {"name": "_JavaCapturer", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " class _JavaCapturer(object):\n\n def __init__(self, stdout=True):\n if stdout:\n self._original = System.out\n self._set_stream = System.setOut\n else:\n self._original = System.err"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99813:FunctionDef_L89_C8", "label": "__init__", "type": "function", "loc": [89, 98], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99813:ClassDef_L87_C4", "vector": [2, 2, 0.8821, 0.0943, 2, 0.96, 0.0, 555, 0, 2, 0, 0, 0, 0, 3], "semantic": {"name": "__init__", "arg_names": ["self", "stdout"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, stdout=True):\n if stdout:\n self._original = System.out\n self._set_stream = System.setOut\n else:\n self._original = System.err\n self._set_stream = System.setErr\n self._bytes = ByteArrayOutputStream()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99813:If_L90_C12", "label": "if", "type": "if", "loc": [90, 95], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99813:FunctionDef_L89_C8", "vector": [4, 3, 0.8726, 0.0566, 3, 0.04, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if stdout:\n self._original = System.out\n self._set_stream = System.setOut\n else:\n self._original = System.err\n self._set_stream = System.setErr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99813:Assign_L91_C16", "label": "self._original =", "type": "assigned_variable", "loc": [91, 91], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99813:If_L90_C12", "vector": [14, 4, 0.8585, 0.0094, 4, 0.07, 0.0, 995, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._original", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._original = System.out"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99813:Assign_L92_C16", "label": "self._set_stream =", "type": "assigned_variable", "loc": [92, 92], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99813:If_L90_C12", "vector": [14, 4, 0.8679, 0.0094, 4, 0.07, 0.3333, 280, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._set_stream", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._set_stream = System.setOut"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99813:Assign_L94_C16", "label": "self._original =", "type": "assigned_variable", "loc": [94, 94], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99813:If_L90_C12", "vector": [14, 4, 0.8868, 0.0094, 4, 0.07, 0.6667, 995, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._original", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._original = System.err"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99813:Assign_L95_C16", "label": "self._set_stream =", "type": "assigned_variable", "loc": [95, 95], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99813:If_L90_C12", "vector": [14, 4, 0.8962, 0.0094, 4, 0.07, 1.0, 280, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._set_stream", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._set_stream = System.setErr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99813:Assign_L96_C12", "label": "self._bytes = ByteArrayOutputStream()", "type": "assigned_variable", "loc": [96, 96], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99813:FunctionDef_L89_C8", "vector": [14, 3, 0.9057, 0.0094, 3, 0.04, 0.3333, 951, 3, 0, 0, 0, 509, 10, 1], "semantic": {"name": "self._bytes", "arg_names": [], "import_names": [], "rhs_call_name": "ByteArrayOutputStream", "annotation": ""}, "snippet": " self._bytes = ByteArrayOutputStream()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99813:Assign_L97_C12", "label": "self._stream = PrintStream()", "type": "assigned_variable", "loc": [97, 97], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99813:FunctionDef_L89_C8", "vector": [14, 3, 0.9151, 0.0094, 3, 0.04, 0.6667, 214, 3, 3, 0, 0, 777, 10, 1], "semantic": {"name": "self._stream", "arg_names": [], "import_names": [], "rhs_call_name": "PrintStream", "annotation": ""}, "snippet": " self._stream = PrintStream(self._bytes, False, 'UTF-8')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99813:Expr_L98_C12", "label": "_set_stream()", "type": "expression", "loc": [98, 98], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99813:FunctionDef_L89_C8", "vector": [8, 3, 0.9245, 0.0094, 3, 0.04, 1.0, 931, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_set_stream", "arg_names": [], "import_names": [], "rhs_call_name": "_set_stream", "annotation": ""}, "snippet": " self._set_stream(self._stream)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99813:FunctionDef_L100_C8", "label": "release", "type": "function", "loc": [100, 106], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99813:ClassDef_L87_C4", "vector": [2, 2, 0.9717, 0.066, 2, 0.96, 1.0, 784, 0, 1, 1, 0, 0, 0, 4], "semantic": {"name": "release", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def release(self):\n # Original stream must be restored before closing the current\n self._set_stream(self._original)\n self._stream.close()\n output = self._bytes.toString('UTF-8')\n self._bytes.reset()\n return output"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99813:Expr_L102_C12", "label": "_set_stream()", "type": "expression", "loc": [102, 102], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99813:FunctionDef_L100_C8", "vector": [8, 3, 0.9623, 0.0094, 3, 0.82, 0.0, 931, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_set_stream", "arg_names": [], "import_names": [], "rhs_call_name": "_set_stream", "annotation": ""}, "snippet": " self._set_stream(self._original)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99813:Expr_L103_C12", "label": "close()", "type": "expression", "loc": [103, 103], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99813:FunctionDef_L100_C8", "vector": [8, 3, 0.9717, 0.0094, 3, 0.82, 0.25, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": " self._stream.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99813:Assign_L104_C12", "label": "output = toString()", "type": "assigned_variable", "loc": [104, 104], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99813:FunctionDef_L100_C8", "vector": [14, 3, 0.9811, 0.0094, 3, 0.82, 0.5, 886, 3, 1, 0, 0, 661, 10, 1], "semantic": {"name": "output", "arg_names": [], "import_names": [], "rhs_call_name": "toString", "annotation": ""}, "snippet": " output = self._bytes.toString('UTF-8')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99813:Expr_L105_C12", "label": "reset()", "type": "expression", "loc": [105, 105], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99813:FunctionDef_L100_C8", "vector": [8, 3, 0.9906, 0.0094, 3, 0.82, 0.75, 944, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "reset", "arg_names": [], "import_names": [], "rhs_call_name": "reset", "annotation": ""}, "snippet": " self._bytes.reset()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99813:Return_L106_C12", "label": "return", "type": "return", "loc": [106, 106], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99813:FunctionDef_L100_C8", "vector": [13, 3, 1.0, 0.0094, 3, 0.82, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return output"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99813:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99813:FunctionDef_L21_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99813:FunctionDef_L21_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99813:Assign_L22_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99813:FunctionDef_L21_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99813:Assign_L23_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99813:FunctionDef_L21_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99813:Assign_L24_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99813:FunctionDef_L21_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99813:Assign_L25_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99813:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99813:FunctionDef_L27_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99813:FunctionDef_L27_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99813:Assign_L28_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99813:FunctionDef_L27_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99813:Assign_L29_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99813:FunctionDef_L27_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99813:Assign_L30_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99813:FunctionDef_L27_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99813:Assign_L31_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99813:FunctionDef_L27_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99813:Return_L43_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99813:ClassDef_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99813:FunctionDef_L48_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99813:FunctionDef_L48_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99813:If_L49_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99813:If_L49_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99813:Assign_L50_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99813:If_L49_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99813:Assign_L51_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99813:If_L49_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99813:Assign_L53_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99813:If_L49_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99813:Assign_L54_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99813:FunctionDef_L48_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99813:Assign_L55_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99813:FunctionDef_L48_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99813:Expr_L56_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99813:ClassDef_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99813:FunctionDef_L58_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99813:FunctionDef_L58_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99813:Assign_L59_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99813:ClassDef_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99813:FunctionDef_L61_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99813:FunctionDef_L61_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99813:Assign_L62_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99813:ClassDef_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99813:FunctionDef_L64_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99813:FunctionDef_L64_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99813:Expr_L66_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99813:FunctionDef_L64_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99813:Expr_L67_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99813:FunctionDef_L64_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99813:Assign_L68_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99813:FunctionDef_L64_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99813:Expr_L69_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99813:FunctionDef_L64_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99813:Return_L70_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99813:If_L73_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99813:ClassDef_L75_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99813:ClassDef_L75_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99813:FunctionDef_L76_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99813:ClassDef_L75_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99813:FunctionDef_L78_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99813:FunctionDef_L78_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99813:Return_L79_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99813:If_L73_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99813:ImportFrom_L83_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99813:If_L73_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99813:ImportFrom_L84_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99813:If_L73_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99813:ClassDef_L87_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99813:ClassDef_L87_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99813:FunctionDef_L89_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99813:FunctionDef_L89_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99813:If_L90_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99813:If_L90_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99813:Assign_L91_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99813:If_L90_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99813:Assign_L92_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99813:If_L90_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99813:Assign_L94_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99813:If_L90_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99813:Assign_L95_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99813:FunctionDef_L89_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99813:Assign_L96_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99813:FunctionDef_L89_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99813:Assign_L97_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99813:FunctionDef_L89_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99813:Expr_L98_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99813:ClassDef_L87_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99813:FunctionDef_L100_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99813:FunctionDef_L100_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99813:Expr_L102_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99813:FunctionDef_L100_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99813:Expr_L103_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99813:FunctionDef_L100_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99813:Assign_L104_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99813:FunctionDef_L100_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99813:Expr_L105_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99813:FunctionDef_L100_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99813:Return_L106_C12"}] |
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from fixture import Setup, Teardown
from timeouts import TestTimeout
class DefaultValues(object):
def __init__(self, settings, parent_default_values=None):
self._parent = parent_default_values
self._setup = settings.test_setup
self._teardown = settings.test_teardown
self._timeout = settings.test_timeout
self._force_tags = settings.force_tags
self._default_tags = settings.default_tags
self._test_template = settings.test_template
def get_setup(self, tc_setup):
setup = tc_setup if tc_setup.is_set() else self._get_default_setup()
return Setup(setup.name, setup.args)
def _get_default_setup(self):
if self._setup.is_set() or not self._parent:
return self._setup
return self._parent._get_default_setup()
def get_teardown(self, tc_teardown):
td = tc_teardown if tc_teardown.is_set() else self._get_default_teardown()
return Teardown(td.name, td.args)
def _get_default_teardown(self):
if self._teardown.is_set() or not self._parent:
return self._teardown
return self._parent._get_default_teardown()
def get_timeout(self, tc_timeout):
timeout = tc_timeout if tc_timeout.is_set() else self._timeout
return TestTimeout(timeout.value, timeout.message)
def get_tags(self, tc_tags):
tags = tc_tags if tc_tags.is_set() else self._default_tags
return (tags + self._get_force_tags()).value
def _get_force_tags(self):
if not self._parent:
return self._force_tags
return self._force_tags + self._parent._get_force_tags()
def get_template(self, template):
return (template if template.is_set() else self._test_template).value
| ajibawa-2023/Python-Code-Large/train/row_99814 | 37 | 63 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99814:ImportFrom_L16_C0", "label": "from fixture import Setup, Teardown", "type": "import", "loc": [16, 16], "level": 0, "parent": null, "vector": [1, 0, 0.254, 0.0159, 0, 0.66, 0.0, 458, 0, 2, 0, 0, 458, 0, 0], "semantic": {"name": "fixture", "arg_names": [], "import_names": ["Setup", "Teardown"], "rhs_call_name": "", "annotation": ""}, "snippet": "from fixture import Setup, Teardown"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99814:ImportFrom_L17_C0", "label": "from timeouts import TestTimeout", "type": "import", "loc": [17, 17], "level": 0, "parent": null, "vector": [1, 0, 0.2698, 0.0159, 0, 0.66, 0.5, 164, 0, 1, 0, 0, 164, 0, 0], "semantic": {"name": "timeouts", "arg_names": [], "import_names": ["TestTimeout"], "rhs_call_name": "", "annotation": ""}, "snippet": "from timeouts import TestTimeout"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99814:ClassDef_L20_C0", "label": "DefaultValues", "type": "class", "loc": [20, 63], "level": 0, "parent": null, "vector": [3, 0, 0.6587, 0.6984, 0, 0.66, 1.0, 351, 0, 9, 0, 0, 186, 0, 16], "semantic": {"name": "DefaultValues", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class DefaultValues(object):\n\n def __init__(self, settings, parent_default_values=None):\n self._parent = parent_default_values\n self._setup = settings.test_setup\n self._teardown = settings.test_teardown\n self._timeout = settings.test_timeout\n self._force_tags = settings.force_tags"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99814:FunctionDef_L22_C4", "label": "__init__", "type": "function", "loc": [22, 29], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99814:ClassDef_L20_C0", "vector": [2, 1, 0.4048, 0.127, 1, 0.39, 0.0, 555, 0, 3, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "settings", "parent_default_values"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, settings, parent_default_values=None):\n self._parent = parent_default_values\n self._setup = settings.test_setup\n self._teardown = settings.test_teardown\n self._timeout = settings.test_timeout\n self._force_tags = settings.force_tags\n self._default_tags = settings.default_tags\n self._test_template = settings.test_template"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99814:Assign_L23_C8", "label": "self._parent =", "type": "assigned_variable", "loc": [23, 23], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99814:FunctionDef_L22_C4", "vector": [14, 2, 0.3651, 0.0159, 2, 0.18, 0.0, 349, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._parent", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._parent = parent_default_values"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99814:Assign_L24_C8", "label": "self._setup =", "type": "assigned_variable", "loc": [24, 24], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99814:FunctionDef_L22_C4", "vector": [14, 2, 0.381, 0.0159, 2, 0.18, 0.1667, 822, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._setup", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._setup = settings.test_setup"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99814:Assign_L25_C8", "label": "self._teardown =", "type": "assigned_variable", "loc": [25, 25], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99814:FunctionDef_L22_C4", "vector": [14, 2, 0.3968, 0.0159, 2, 0.18, 0.3333, 933, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._teardown", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._teardown = settings.test_teardown"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99814:Assign_L26_C8", "label": "self._timeout =", "type": "assigned_variable", "loc": [26, 26], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99814:FunctionDef_L22_C4", "vector": [14, 2, 0.4127, 0.0159, 2, 0.18, 0.5, 347, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._timeout", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._timeout = settings.test_timeout"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99814:Assign_L27_C8", "label": "self._force_tags =", "type": "assigned_variable", "loc": [27, 27], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99814:FunctionDef_L22_C4", "vector": [14, 2, 0.4286, 0.0159, 2, 0.18, 0.6667, 517, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._force_tags", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._force_tags = settings.force_tags"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99814:Assign_L28_C8", "label": "self._default_tags =", "type": "assigned_variable", "loc": [28, 28], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99814:FunctionDef_L22_C4", "vector": [14, 2, 0.4444, 0.0159, 2, 0.18, 0.8333, 28, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._default_tags", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._default_tags = settings.default_tags"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99814:Assign_L29_C8", "label": "self._test_template =", "type": "assigned_variable", "loc": [29, 29], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99814:FunctionDef_L22_C4", "vector": [14, 2, 0.4603, 0.0159, 2, 0.18, 1.0, 513, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._test_template", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._test_template = settings.test_template"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99814:FunctionDef_L31_C4", "label": "get_setup", "type": "function", "loc": [31, 33], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99814:ClassDef_L20_C0", "vector": [2, 1, 0.5079, 0.0476, 1, 0.39, 0.125, 129, 0, 2, 1, 0, 0, 0, 3], "semantic": {"name": "get_setup", "arg_names": ["self", "tc_setup"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_setup(self, tc_setup):\n setup = tc_setup if tc_setup.is_set() else self._get_default_setup()\n return Setup(setup.name, setup.args)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99814:Assign_L32_C8", "label": "setup =", "type": "assigned_variable", "loc": [32, 32], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99814:FunctionDef_L31_C4", "vector": [14, 2, 0.5079, 0.0159, 2, 0.58, 0.0, 234, 8, 0, 0, 0, 0, 0, 2], "semantic": {"name": "setup", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " setup = tc_setup if tc_setup.is_set() else self._get_default_setup()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99814:Return_L33_C8", "label": "return", "type": "return", "loc": [33, 33], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99814:FunctionDef_L31_C4", "vector": [13, 2, 0.5238, 0.0159, 2, 0.58, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return Setup(setup.name, setup.args)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99814:FunctionDef_L35_C4", "label": "_get_default_setup", "type": "function", "loc": [35, 38], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99814:ClassDef_L20_C0", "vector": [2, 1, 0.5794, 0.0635, 1, 0.39, 0.25, 580, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "_get_default_setup", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _get_default_setup(self):\n if self._setup.is_set() or not self._parent:\n return self._setup\n return self._parent._get_default_setup()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99814:If_L36_C8", "label": "if", "type": "if", "loc": [36, 37], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99814:FunctionDef_L35_C4", "vector": [4, 2, 0.5794, 0.0317, 2, 0.99, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self._setup.is_set() or not self._parent:\n return self._setup"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99814:Return_L37_C12", "label": "return", "type": "return", "loc": [37, 37], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99814:If_L36_C8", "vector": [13, 3, 0.5873, 0.0159, 3, 0.11, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._setup"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99814:Return_L38_C8", "label": "return", "type": "return", "loc": [38, 38], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99814:FunctionDef_L35_C4", "vector": [13, 2, 0.6032, 0.0159, 2, 0.99, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._parent._get_default_setup()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99814:FunctionDef_L40_C4", "label": "get_teardown", "type": "function", "loc": [40, 42], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99814:ClassDef_L20_C0", "vector": [2, 1, 0.6508, 0.0476, 1, 0.39, 0.375, 227, 0, 2, 1, 0, 0, 0, 3], "semantic": {"name": "get_teardown", "arg_names": ["self", "tc_teardown"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_teardown(self, tc_teardown):\n td = tc_teardown if tc_teardown.is_set() else self._get_default_teardown()\n return Teardown(td.name, td.args)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99814:Assign_L41_C8", "label": "td =", "type": "assigned_variable", "loc": [41, 41], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99814:FunctionDef_L40_C4", "vector": [14, 2, 0.6508, 0.0159, 2, 0.34, 0.0, 102, 8, 0, 0, 0, 0, 0, 2], "semantic": {"name": "td", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " td = tc_teardown if tc_teardown.is_set() else self._get_default_teardown()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99814:Return_L42_C8", "label": "return", "type": "return", "loc": [42, 42], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99814:FunctionDef_L40_C4", "vector": [13, 2, 0.6667, 0.0159, 2, 0.34, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return Teardown(td.name, td.args)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99814:FunctionDef_L44_C4", "label": "_get_default_teardown", "type": "function", "loc": [44, 47], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99814:ClassDef_L20_C0", "vector": [2, 1, 0.7222, 0.0635, 1, 0.39, 0.5, 187, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "_get_default_teardown", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _get_default_teardown(self):\n if self._teardown.is_set() or not self._parent:\n return self._teardown\n return self._parent._get_default_teardown()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99814:If_L45_C8", "label": "if", "type": "if", "loc": [45, 46], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99814:FunctionDef_L44_C4", "vector": [4, 2, 0.7222, 0.0317, 2, 0.82, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self._teardown.is_set() or not self._parent:\n return self._teardown"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99814:Return_L46_C12", "label": "return", "type": "return", "loc": [46, 46], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99814:If_L45_C8", "vector": [13, 3, 0.7302, 0.0159, 3, 0.23, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._teardown"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99814:Return_L47_C8", "label": "return", "type": "return", "loc": [47, 47], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99814:FunctionDef_L44_C4", "vector": [13, 2, 0.746, 0.0159, 2, 0.82, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._parent._get_default_teardown()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99814:FunctionDef_L49_C4", "label": "get_timeout", "type": "function", "loc": [49, 51], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99814:ClassDef_L20_C0", "vector": [2, 1, 0.7937, 0.0476, 1, 0.39, 0.625, 639, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "get_timeout", "arg_names": ["self", "tc_timeout"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_timeout(self, tc_timeout):\n timeout = tc_timeout if tc_timeout.is_set() else self._timeout\n return TestTimeout(timeout.value, timeout.message)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99814:Assign_L50_C8", "label": "timeout =", "type": "assigned_variable", "loc": [50, 50], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99814:FunctionDef_L49_C4", "vector": [14, 2, 0.7937, 0.0159, 2, 0.85, 0.0, 616, 8, 0, 0, 0, 0, 0, 1], "semantic": {"name": "timeout", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " timeout = tc_timeout if tc_timeout.is_set() else self._timeout"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99814:Return_L51_C8", "label": "return", "type": "return", "loc": [51, 51], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99814:FunctionDef_L49_C4", "vector": [13, 2, 0.8095, 0.0159, 2, 0.85, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return TestTimeout(timeout.value, timeout.message)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99814:FunctionDef_L53_C4", "label": "get_tags", "type": "function", "loc": [53, 55], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99814:ClassDef_L20_C0", "vector": [2, 1, 0.8571, 0.0476, 1, 0.39, 0.75, 54, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "get_tags", "arg_names": ["self", "tc_tags"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_tags(self, tc_tags):\n tags = tc_tags if tc_tags.is_set() else self._default_tags\n return (tags + self._get_force_tags()).value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99814:Assign_L54_C8", "label": "tags =", "type": "assigned_variable", "loc": [54, 54], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99814:FunctionDef_L53_C4", "vector": [14, 2, 0.8571, 0.0159, 2, 0.68, 0.0, 487, 8, 0, 0, 0, 0, 0, 1], "semantic": {"name": "tags", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tags = tc_tags if tc_tags.is_set() else self._default_tags"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99814:Return_L55_C8", "label": "return", "type": "return", "loc": [55, 55], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99814:FunctionDef_L53_C4", "vector": [13, 2, 0.873, 0.0159, 2, 0.68, 1.0, 0, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return (tags + self._get_force_tags()).value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99814:FunctionDef_L57_C4", "label": "_get_force_tags", "type": "function", "loc": [57, 60], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99814:ClassDef_L20_C0", "vector": [2, 1, 0.9286, 0.0635, 1, 0.39, 0.875, 563, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "_get_force_tags", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _get_force_tags(self):\n if not self._parent:\n return self._force_tags\n return self._force_tags + self._parent._get_force_tags()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99814:If_L58_C8", "label": "if", "type": "if", "loc": [58, 59], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99814:FunctionDef_L57_C4", "vector": [4, 2, 0.9286, 0.0317, 2, 0.39, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not self._parent:\n return self._force_tags"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99814:Return_L59_C12", "label": "return", "type": "return", "loc": [59, 59], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99814:If_L58_C8", "vector": [13, 3, 0.9365, 0.0159, 3, 0.73, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._force_tags"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99814:Return_L60_C8", "label": "return", "type": "return", "loc": [60, 60], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99814:FunctionDef_L57_C4", "vector": [13, 2, 0.9524, 0.0159, 2, 0.39, 1.0, 0, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._force_tags + self._parent._get_force_tags()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99814:FunctionDef_L62_C4", "label": "get_template", "type": "function", "loc": [62, 63], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99814:ClassDef_L20_C0", "vector": [2, 1, 0.9921, 0.0317, 1, 0.39, 1.0, 27, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "get_template", "arg_names": ["self", "template"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_template(self, template):\n return (template if template.is_set() else self._test_template).value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99814:Return_L63_C8", "label": "return", "type": "return", "loc": [63, 63], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99814:FunctionDef_L62_C4", "vector": [13, 2, 1.0, 0.0159, 2, 0.69, 0.0, 0, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return (template if template.is_set() else self._test_template).value"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99814:ClassDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99814:FunctionDef_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99814:FunctionDef_L22_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99814:Assign_L23_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99814:FunctionDef_L22_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99814:Assign_L24_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99814:FunctionDef_L22_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99814:Assign_L25_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99814:FunctionDef_L22_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99814:Assign_L26_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99814:FunctionDef_L22_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99814:Assign_L27_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99814:FunctionDef_L22_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99814:Assign_L28_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99814:FunctionDef_L22_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99814:Assign_L29_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99814:ClassDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99814:FunctionDef_L31_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99814:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99814:Assign_L32_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99814:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99814:Return_L33_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99814:ClassDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99814:FunctionDef_L35_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99814:FunctionDef_L35_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99814:If_L36_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99814:If_L36_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99814:Return_L37_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99814:FunctionDef_L35_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99814:Return_L38_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99814:ClassDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99814:FunctionDef_L40_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99814:FunctionDef_L40_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99814:Assign_L41_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99814:FunctionDef_L40_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99814:Return_L42_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99814:ClassDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99814:FunctionDef_L44_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99814:FunctionDef_L44_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99814:If_L45_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99814:If_L45_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99814:Return_L46_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99814:FunctionDef_L44_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99814:Return_L47_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99814:ClassDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99814:FunctionDef_L49_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99814:FunctionDef_L49_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99814:Assign_L50_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99814:FunctionDef_L49_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99814:Return_L51_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99814:ClassDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99814:FunctionDef_L53_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99814:FunctionDef_L53_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99814:Assign_L54_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99814:FunctionDef_L53_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99814:Return_L55_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99814:ClassDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99814:FunctionDef_L57_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99814:FunctionDef_L57_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99814:If_L58_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99814:If_L58_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99814:Return_L59_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99814:FunctionDef_L57_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99814:Return_L60_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99814:ClassDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99814:FunctionDef_L62_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99814:FunctionDef_L62_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99814:Return_L63_C8"}] |
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import sys
import inspect
from array import ArrayType
from robot.errors import DataError, FrameworkError
from robot.variables import is_list_var, is_scalar_var
from robot import utils
if utils.is_jython:
from javaargcoercer import ArgumentCoercer
class _KeywordArguments(object):
_type = 'Keyword'
def __init__(self, argument_source, kw_or_lib_name):
self.names, self.defaults, self.varargs, self.minargs, self.maxargs \
= self._determine_args(argument_source)
self._arg_limit_checker = _ArgLimitChecker(self.minargs, self.maxargs,
kw_or_lib_name, self._type)
def _determine_args(self, handler_or_argspec):
args, defaults, varargs = self._get_arg_spec(handler_or_argspec)
minargs = len(args) - len(defaults)
maxargs = len(args) if not varargs else sys.maxint
return args, defaults, varargs, minargs, maxargs
def resolve(self, args, variables, output=None):
posargs, namedargs = self._resolve(args, variables, output)
self.check_arg_limits(posargs, namedargs)
self._tracelog_args(output, posargs, namedargs)
return posargs, namedargs
def _resolve(self, args, variables, output):
return self._get_argument_resolver().resolve(args, output, variables)
def check_arg_limits(self, args, namedargs={}):
self._arg_limit_checker.check_arg_limits(args, namedargs)
def check_arg_limits_for_dry_run(self, args):
self._arg_limit_checker.check_arg_limits_for_dry_run(args)
def _tracelog_args(self, logger, posargs, namedargs={}):
if self._logger_not_available_during_library_init(logger):
return
args = [utils.safe_repr(a) for a in posargs] \
+ ['%s=%s' % (utils.unic(a), utils.safe_repr(namedargs[a]))
for a in namedargs]
logger.trace('Arguments: [ %s ]' % ' | '.join(args))
def _logger_not_available_during_library_init(self, logger):
return not logger
class PythonKeywordArguments(_KeywordArguments):
def _get_argument_resolver(self):
return PythonKeywordArgumentResolver(self)
def _get_arg_spec(self, handler):
"""Returns info about args in a tuple (args, defaults, varargs)
args - list of all accepted arguments except varargs
defaults - list of default values
varargs - name of the argument accepting varargs or None
"""
args, varargs, _, defaults = inspect.getargspec(handler)
if inspect.ismethod(handler):
args = args[1:] # drop 'self'
defaults = list(defaults) if defaults else []
return args, defaults, varargs
class JavaKeywordArguments(_KeywordArguments):
def __init__(self, handler_method, name):
_KeywordArguments.__init__(self, handler_method, name)
self.arg_coercer = ArgumentCoercer(self._get_signatures(handler_method))
def _get_argument_resolver(self):
return JavaKeywordArgumentResolver(self)
def _determine_args(self, handler_method):
signatures = self._get_signatures(handler_method)
minargs, maxargs = self._get_arg_limits(signatures)
return [], [], None, minargs, maxargs
def _get_signatures(self, handler):
co = self._get_code_object(handler)
return co.argslist[:co.nargs]
def _get_code_object(self, handler):
try:
return handler.im_func
except AttributeError:
return handler
def _get_arg_limits(self, signatures):
if len(signatures) == 1:
return self._get_single_sig_arg_limits(signatures[0])
else:
return self._get_multi_sig_arg_limits(signatures)
def _get_single_sig_arg_limits(self, signature):
args = signature.args
if len(args) > 0 and args[-1].isArray():
mina = len(args) - 1
maxa = sys.maxint
else:
mina = maxa = len(args)
return mina, maxa
def _get_multi_sig_arg_limits(self, signatures):
mina = maxa = None
for sig in signatures:
argc = len(sig.args)
if mina is None or argc < mina:
mina = argc
if maxa is None or argc > maxa:
maxa = argc
return mina, maxa
class DynamicKeywordArguments(_KeywordArguments):
def _get_argument_resolver(self):
return PythonKeywordArgumentResolver(self)
def _get_arg_spec(self, argspec):
if argspec is None:
return [], [], '<unknown>'
try:
if isinstance(argspec, basestring):
raise TypeError
return self._parse_arg_spec(list(argspec))
except TypeError:
raise TypeError('Argument spec should be a list/array of strings')
def _parse_arg_spec(self, argspec):
if argspec == []:
return [], [], None
args = []
defaults = []
vararg = None
for token in argspec:
if vararg is not None:
raise TypeError
if token.startswith('*'):
vararg = token[1:]
continue
if '=' in token:
arg, default = token.split('=', 1)
args.append(arg)
defaults.append(default)
continue
if defaults:
raise TypeError
args.append(token)
return args, defaults, vararg
class RunKeywordArguments(PythonKeywordArguments):
def __init__(self, argument_source, name, arg_resolution_index):
PythonKeywordArguments.__init__(self, argument_source, name)
self._arg_resolution_index = arg_resolution_index
def _resolve(self, args, variables, output):
args = variables.replace_from_beginning(self._arg_resolution_index, args)
return args, {}
class PythonInitArguments(PythonKeywordArguments):
_type = 'Test Library'
class JavaInitArguments(JavaKeywordArguments):
_type = 'Test Library'
def resolve(self, args, variables=None):
if variables:
args = variables.replace_list(args)
self.check_arg_limits(args)
return args, {}
class UserKeywordArguments(object):
def __init__(self, args, name):
self.names, self.defaults, self.varargs = self._get_arg_spec(args)
self.minargs = len(self.names) - len(self.defaults)
maxargs = len(self.names) if not self.varargs else sys.maxint
self._arg_limit_checker = _ArgLimitChecker(self.minargs, maxargs,
name, 'Keyword')
def _get_arg_spec(self, origargs):
"""Returns argument spec in a tuple (args, defaults, varargs).
args - tuple of all accepted arguments
defaults - tuple of default values
varargs - name of the argument accepting varargs or None
Examples:
['${arg1}', '${arg2}']
=> ('${arg1}', '${arg2}'), (), None
['${arg1}', '${arg2}=default', '@{varargs}']
=> ('${arg1}', '${arg2}'), ('default',), '@{varargs}'
"""
args = []
defaults = []
varargs = None
for arg in origargs:
if varargs:
raise DataError('Only last argument can be a list')
if is_list_var(arg):
varargs = arg
continue # should be last round (otherwise DataError in next)
arg, default = self._split_default(arg)
if defaults and default is None:
raise DataError('Non default argument after default arguments')
if not is_scalar_var(arg):
raise DataError("Invalid argument '%s'" % arg)
args.append(arg)
if default is not None:
defaults.append(default)
return args, defaults, varargs
def _split_default(self, arg):
if '=' not in arg:
return arg, None
return arg.split('=', 1)
def resolve_arguments_for_dry_run(self, arguments):
self._arg_limit_checker.check_arg_limits_for_dry_run(arguments)
required_number_of_args = self.minargs + len(self.defaults)
needed_args = required_number_of_args - len(arguments)
if needed_args > 0:
return self._fill_missing_args(arguments, needed_args)
return arguments
def _fill_missing_args(self, arguments, needed):
return arguments + needed * [None]
def resolve(self, arguments, variables, output):
positional, varargs, named = self._resolve_arg_usage(arguments, variables, output)
self._arg_limit_checker.check_arg_limits(positional+varargs, named)
argument_values = self._resolve_arg_values(variables, named, positional)
argument_values += varargs
self._arg_limit_checker.check_missing_args(argument_values, len(arguments))
return argument_values
def _resolve_arg_usage(self, arguments, variables, output):
resolver = UserKeywordArgumentResolver(self)
positional, named = resolver.resolve(arguments, output=output)
positional, named = self._replace_variables(variables, positional, named)
return self._split_args_and_varargs(positional) + (named,)
def _resolve_arg_values(self, variables, named, positional):
template = self._template_for(variables)
for name, value in named.items():
template.set_value(self.names.index(name), value)
for index, value in enumerate(positional):
template.set_value(index, value)
return template.as_list()
def _template_for(self, variables):
defaults = variables.replace_list(list(self.defaults))
return UserKeywordArgsTemplate(self.minargs, defaults)
def _replace_variables(self, variables, positional, named):
for name in named:
named[name] = variables.replace_scalar(named[name])
return variables.replace_list(positional), named
def set_variables(self, arg_values, variables, output):
before_varargs, varargs = self._split_args_and_varargs(arg_values)
for name, value in zip(self.names, before_varargs):
variables[name] = value
if self.varargs:
variables[self.varargs] = varargs
self._tracelog_args(output, variables)
def _split_args_and_varargs(self, args):
if not self.varargs:
return args, []
return args[:len(self.names)], args[len(self.names):]
def _tracelog_args(self, logger, variables):
arguments_string = self._get_arguments_as_string(variables)
logger.trace('Arguments: [ %s ]' % arguments_string)
def _get_arguments_as_string(self, variables):
args = []
for name in self.names + ([self.varargs] if self.varargs else []):
args.append('%s=%s' % (name, utils.safe_repr(variables[name])))
return ' | '.join(args)
class _MissingArg(object):
def __getattr__(self, name):
raise DataError
class UserKeywordArgsTemplate(object):
def __init__(self, minargs, defaults):
self._template = [_MissingArg() for _ in range(minargs)] + defaults
self._already_set = set()
def set_value(self, idx, value):
if idx in self._already_set:
raise FrameworkError
self._already_set.add(idx)
self._template[idx] = value
def as_list(self):
return self._template
class _ArgumentResolver(object):
def __init__(self, arguments):
self._arguments = arguments
self._mand_arg_count = len(arguments.names) - len(arguments.defaults)
def resolve(self, values, output, variables=None):
positional, named = self._resolve_argument_usage(values, output)
return self._resolve_variables(positional, named, variables)
def _resolve_argument_usage(self, values, output):
named = {}
last_positional = self._get_last_positional_idx(values)
used_names = self._arguments.names[:last_positional]
for arg in values[last_positional:]:
name, value = self._parse_named(arg)
if name in named:
raise DataError('Keyword argument %s repeated.' % name)
if name in used_names:
output.warn("Could not resolve named arguments because value "
"for argument '%s' was given twice." % name)
return values, {}
used_names.append(name)
named[name] = value
return values[:last_positional], named
def _get_last_positional_idx(self, values):
last_positional_idx = self._mand_arg_count
named_allowed = True
for arg in reversed(self._optional(values)):
if not (named_allowed and self._is_named(arg)):
named_allowed = False
last_positional_idx += 1
return last_positional_idx
def _optional(self, values):
return values[self._mand_arg_count:]
def _is_named(self, arg):
if self._is_str_with_kwarg_sep(arg):
name, _ = self._split_from_kwarg_sep(arg)
return self._is_arg_name(name)
return False
def _parse_named(self, arg):
name, value = self._split_from_kwarg_sep(arg)
return self._coerce(name), value
def _is_str_with_kwarg_sep(self, arg):
if not isinstance(arg, basestring):
return False
if '=' not in arg:
return False
return True
def _split_from_kwarg_sep(self, arg):
return arg.split('=', 1)
def _is_arg_name(self, name):
return self._arg_name(name) in self._arguments.names
def _resolve_variables(self, posargs, kwargs, variables):
posargs = self._replace_list(posargs, variables)
for name, value in kwargs.items():
kwargs[name] = self._replace_scalar(value, variables)
return posargs, kwargs
def _replace_list(self, values, variables):
return variables.replace_list(values) if variables else values
def _replace_scalar(self, value, variables):
return variables.replace_scalar(value) if variables else value
class UserKeywordArgumentResolver(_ArgumentResolver):
def _arg_name(self, name):
return '${%s}' % name
def _coerce(self, name):
return '${%s}' % name
class PythonKeywordArgumentResolver(_ArgumentResolver):
def _arg_name(self, name):
return name
def _coerce(self, name):
return str(name)
class JavaKeywordArgumentResolver(object):
def __init__(self, arguments):
self._arguments = arguments
self._minargs, self._maxargs = arguments.minargs, arguments.maxargs
def resolve(self, values, output, variables):
values = variables.replace_list(values)
self._arguments.check_arg_limits(values)
if self._expects_varargs() and self._last_is_not_list(values):
values[self._minargs:] = [values[self._minargs:]]
return self._arguments.arg_coercer(values), {}
def _expects_varargs(self):
return self._maxargs == sys.maxint
def _last_is_not_list(self, args):
return not (len(args) == self._minargs + 1
and isinstance(args[-1], (list, tuple, ArrayType)))
class _ArgLimitChecker(object):
def __init__(self, minargs, maxargs, name, type_):
self.minargs = minargs
self.maxargs = maxargs
self._name = name
self._type = type_
def check_arg_limits(self, args, namedargs={}):
self._check_arg_limits(len(args) + len(namedargs))
def check_arg_limits_for_dry_run(self, args):
arg_count = len(args)
scalar_arg_count = len([a for a in args if not is_list_var(a)])
if scalar_arg_count <= self.minargs and arg_count - scalar_arg_count:
arg_count = self.minargs
self._check_arg_limits(arg_count)
def _check_arg_limits(self, arg_count):
if not self.minargs <= arg_count <= self.maxargs:
self._raise_inv_args(arg_count)
def check_missing_args(self, args, arg_count):
for a in args:
if isinstance(a, _MissingArg):
self._raise_inv_args(arg_count)
def _raise_inv_args(self, arg_count):
minend = utils.plural_or_not(self.minargs)
if self.minargs == self.maxargs:
exptxt = "%d argument%s" % (self.minargs, minend)
elif self.maxargs != sys.maxint:
exptxt = "%d to %d arguments" % (self.minargs, self.maxargs)
else:
exptxt = "at least %d argument%s" % (self.minargs, minend)
raise DataError("%s '%s' expected %s, got %d."
% (self._type, self._name, exptxt, arg_count))
| ajibawa-2023/Python-Code-Large/train/row_99815 | 324 | 483 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Import_L15_C0", "label": "sys import sys", "type": "import", "loc": [15, 15], "level": 0, "parent": null, "vector": [1, 0, 0.0311, 0.0021, 0, 0.66, 0.0, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sys"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Import_L16_C0", "label": "inspect import inspect", "type": "import", "loc": [16, 16], "level": 0, "parent": null, "vector": [1, 0, 0.0331, 0.0021, 0, 0.66, 0.0476, 878, 0, 1, 0, 0, 878, 0, 0], "semantic": {"name": "inspect", "arg_names": [], "import_names": ["inspect"], "rhs_call_name": "", "annotation": ""}, "snippet": "import inspect"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:ImportFrom_L17_C0", "label": "from array import ArrayType", "type": "import", "loc": [17, 17], "level": 0, "parent": null, "vector": [1, 0, 0.0352, 0.0021, 0, 0.66, 0.0952, 80, 0, 1, 0, 0, 80, 0, 0], "semantic": {"name": "array", "arg_names": [], "import_names": ["ArrayType"], "rhs_call_name": "", "annotation": ""}, "snippet": "from array import ArrayType"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:ImportFrom_L19_C0", "label": "from robot.errors import DataError, FrameworkError", "type": "import", "loc": [19, 19], "level": 0, "parent": null, "vector": [1, 0, 0.0393, 0.0021, 0, 0.66, 0.1429, 299, 0, 2, 0, 0, 299, 0, 0], "semantic": {"name": "robot.errors", "arg_names": [], "import_names": ["DataError", "FrameworkError"], "rhs_call_name": "", "annotation": ""}, "snippet": "from robot.errors import DataError, FrameworkError"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:ImportFrom_L20_C0", "label": "from robot.variables import is_list_var, is_scalar_var", "type": "import", "loc": [20, 20], "level": 0, "parent": null, "vector": [1, 0, 0.0414, 0.0021, 0, 0.66, 0.1905, 595, 0, 2, 0, 0, 595, 0, 0], "semantic": {"name": "robot.variables", "arg_names": [], "import_names": ["is_list_var", "is_scalar_var"], "rhs_call_name": "", "annotation": ""}, "snippet": "from robot.variables import is_list_var, is_scalar_var"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:ImportFrom_L21_C0", "label": "from robot import utils", "type": "import", "loc": [21, 21], "level": 0, "parent": null, "vector": [1, 0, 0.0435, 0.0021, 0, 0.66, 0.2381, 735, 0, 1, 0, 0, 735, 0, 0], "semantic": {"name": "robot", "arg_names": [], "import_names": ["utils"], "rhs_call_name": "", "annotation": ""}, "snippet": "from robot import utils"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L23_C0", "label": "if", "type": "if", "loc": [23, 24], "level": 0, "parent": null, "vector": [4, 0, 0.0487, 0.0041, 0, 0.66, 0.2857, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if utils.is_jython:\n from javaargcoercer import ArgumentCoercer"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:ImportFrom_L24_C4", "label": "from javaargcoercer import ArgumentCoercer", "type": "import", "loc": [24, 24], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L23_C0", "vector": [1, 1, 0.0497, 0.0021, 1, 0.96, 0.0, 452, 0, 1, 0, 0, 452, 0, 0], "semantic": {"name": "javaargcoercer", "arg_names": [], "import_names": ["ArgumentCoercer"], "rhs_call_name": "", "annotation": ""}, "snippet": " from javaargcoercer import ArgumentCoercer"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L27_C0", "label": "_KeywordArguments", "type": "class", "loc": [27, 66], "level": 0, "parent": null, "vector": [3, 0, 0.0963, 0.0828, 0, 0.66, 0.3333, 796, 0, 8, 0, 0, 186, 0, 19], "semantic": {"name": "_KeywordArguments", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class _KeywordArguments(object):\n _type = 'Keyword'\n\n def __init__(self, argument_source, kw_or_lib_name):\n self.names, self.defaults, self.varargs, self.minargs, self.maxargs \\\n = self._determine_args(argument_source)\n self._arg_limit_checker = _ArgLimitChecker(self.minargs, self.maxargs,\n kw_or_lib_name, self._type)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L28_C4", "label": "_type =", "type": "assigned_variable", "loc": [28, 28], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L27_C0", "vector": [14, 1, 0.058, 0.0021, 1, 0.78, 0.0, 439, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "_type", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " _type = 'Keyword'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L30_C4", "label": "__init__", "type": "function", "loc": [30, 34], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L27_C0", "vector": [2, 1, 0.0663, 0.0104, 1, 0.78, 0.125, 555, 0, 3, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": ["self", "argument_source", "kw_or_lib_name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, argument_source, kw_or_lib_name):\n self.names, self.defaults, self.varargs, self.minargs, self.maxargs \\\n = self._determine_args(argument_source)\n self._arg_limit_checker = _ArgLimitChecker(self.minargs, self.maxargs,\n kw_or_lib_name, self._type)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L31_C8", "label": " = _determine_args()", "type": "assigned_variable", "loc": [31, 32], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L30_C4", "vector": [14, 2, 0.0652, 0.0041, 2, 0.34, 0.0, 0, 3, 1, 0, 0, 726, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "_determine_args", "annotation": ""}, "snippet": " self.names, self.defaults, self.varargs, self.minargs, self.maxargs \\\n = self._determine_args(argument_source)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L33_C8", "label": "self._arg_limit_checker = _ArgLimitChecker()", "type": "assigned_variable", "loc": [33, 34], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L30_C4", "vector": [14, 2, 0.0694, 0.0041, 2, 0.34, 1.0, 347, 3, 4, 0, 0, 456, 10, 1], "semantic": {"name": "self._arg_limit_checker", "arg_names": [], "import_names": [], "rhs_call_name": "_ArgLimitChecker", "annotation": ""}, "snippet": " self._arg_limit_checker = _ArgLimitChecker(self.minargs, self.maxargs,\n kw_or_lib_name, self._type)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L36_C4", "label": "_determine_args", "type": "function", "loc": [36, 40], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L27_C0", "vector": [2, 1, 0.0787, 0.0104, 1, 0.78, 0.25, 726, 0, 2, 1, 0, 0, 0, 4], "semantic": {"name": "_determine_args", "arg_names": ["self", "handler_or_argspec"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _determine_args(self, handler_or_argspec):\n args, defaults, varargs = self._get_arg_spec(handler_or_argspec)\n minargs = len(args) - len(defaults)\n maxargs = len(args) if not varargs else sys.maxint\n return args, defaults, varargs, minargs, maxargs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L37_C8", "label": "args, defaults, varargs = _get_arg_spec()", "type": "assigned_variable", "loc": [37, 37], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L36_C4", "vector": [14, 2, 0.0766, 0.0021, 2, 0.14, 0.0, 297, 3, 1, 0, 0, 862, 10, 1], "semantic": {"name": "args, defaults, varargs", "arg_names": [], "import_names": [], "rhs_call_name": "_get_arg_spec", "annotation": ""}, "snippet": " args, defaults, varargs = self._get_arg_spec(handler_or_argspec)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L38_C8", "label": "minargs =", "type": "assigned_variable", "loc": [38, 38], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L36_C4", "vector": [14, 2, 0.0787, 0.0021, 2, 0.14, 0.3333, 654, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "minargs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " minargs = len(args) - len(defaults)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L39_C8", "label": "maxargs =", "type": "assigned_variable", "loc": [39, 39], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L36_C4", "vector": [14, 2, 0.0807, 0.0021, 2, 0.14, 0.6667, 321, 8, 0, 0, 0, 0, 0, 1], "semantic": {"name": "maxargs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " maxargs = len(args) if not varargs else sys.maxint"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Return_L40_C8", "label": "return", "type": "return", "loc": [40, 40], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L36_C4", "vector": [13, 2, 0.0828, 0.0021, 2, 0.14, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return args, defaults, varargs, minargs, maxargs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L42_C4", "label": "resolve", "type": "function", "loc": [42, 46], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L27_C0", "vector": [2, 1, 0.0911, 0.0104, 1, 0.78, 0.375, 675, 0, 4, 1, 0, 0, 0, 3], "semantic": {"name": "resolve", "arg_names": ["self", "args", "variables", "output"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def resolve(self, args, variables, output=None):\n posargs, namedargs = self._resolve(args, variables, output)\n self.check_arg_limits(posargs, namedargs)\n self._tracelog_args(output, posargs, namedargs)\n return posargs, namedargs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L43_C8", "label": "posargs, namedargs = _resolve()", "type": "assigned_variable", "loc": [43, 43], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L42_C4", "vector": [14, 2, 0.089, 0.0021, 2, 0.37, 0.0, 120, 3, 3, 0, 0, 779, 10, 1], "semantic": {"name": "posargs, namedargs", "arg_names": [], "import_names": [], "rhs_call_name": "_resolve", "annotation": ""}, "snippet": " posargs, namedargs = self._resolve(args, variables, output)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Expr_L44_C8", "label": "check_arg_limits()", "type": "expression", "loc": [44, 44], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L42_C4", "vector": [8, 2, 0.0911, 0.0021, 2, 0.37, 0.3333, 324, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "check_arg_limits", "arg_names": [], "import_names": [], "rhs_call_name": "check_arg_limits", "annotation": ""}, "snippet": " self.check_arg_limits(posargs, namedargs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Expr_L45_C8", "label": "_tracelog_args()", "type": "expression", "loc": [45, 45], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L42_C4", "vector": [8, 2, 0.0932, 0.0021, 2, 0.37, 0.6667, 977, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "_tracelog_args", "arg_names": [], "import_names": [], "rhs_call_name": "_tracelog_args", "annotation": ""}, "snippet": " self._tracelog_args(output, posargs, namedargs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Return_L46_C8", "label": "return", "type": "return", "loc": [46, 46], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L42_C4", "vector": [13, 2, 0.0952, 0.0021, 2, 0.37, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return posargs, namedargs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L48_C4", "label": "_resolve", "type": "function", "loc": [48, 49], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L27_C0", "vector": [2, 1, 0.1004, 0.0041, 1, 0.78, 0.5, 779, 0, 4, 1, 0, 0, 0, 2], "semantic": {"name": "_resolve", "arg_names": ["self", "args", "variables", "output"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _resolve(self, args, variables, output):\n return self._get_argument_resolver().resolve(args, output, variables)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Return_L49_C8", "label": "return", "type": "return", "loc": [49, 49], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L48_C4", "vector": [13, 2, 0.1014, 0.0021, 2, 0.41, 0.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._get_argument_resolver().resolve(args, output, variables)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L51_C4", "label": "check_arg_limits", "type": "function", "loc": [51, 52], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L27_C0", "vector": [2, 1, 0.1066, 0.0041, 1, 0.78, 0.625, 324, 0, 3, 0, 0, 0, 0, 1], "semantic": {"name": "check_arg_limits", "arg_names": ["self", "args", "namedargs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def check_arg_limits(self, args, namedargs={}):\n self._arg_limit_checker.check_arg_limits(args, namedargs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Expr_L52_C8", "label": "check_arg_limits()", "type": "expression", "loc": [52, 52], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L51_C4", "vector": [8, 2, 0.1077, 0.0021, 2, 0.81, 0.0, 324, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "check_arg_limits", "arg_names": [], "import_names": [], "rhs_call_name": "check_arg_limits", "annotation": ""}, "snippet": " self._arg_limit_checker.check_arg_limits(args, namedargs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L54_C4", "label": "check_arg_limits_for_dry_run", "type": "function", "loc": [54, 55], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L27_C0", "vector": [2, 1, 0.1128, 0.0041, 1, 0.78, 0.75, 100, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "check_arg_limits_for_dry_run", "arg_names": ["self", "args"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def check_arg_limits_for_dry_run(self, args):\n self._arg_limit_checker.check_arg_limits_for_dry_run(args)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Expr_L55_C8", "label": "check_arg_limits_for_dry_run()", "type": "expression", "loc": [55, 55], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L54_C4", "vector": [8, 2, 0.1139, 0.0021, 2, 0.58, 0.0, 100, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "check_arg_limits_for_dry_run", "arg_names": [], "import_names": [], "rhs_call_name": "check_arg_limits_for_dry_run", "annotation": ""}, "snippet": " self._arg_limit_checker.check_arg_limits_for_dry_run(args)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L57_C4", "label": "_tracelog_args", "type": "function", "loc": [57, 63], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L27_C0", "vector": [2, 1, 0.1242, 0.0145, 1, 0.78, 0.875, 977, 0, 4, 0, 0, 0, 0, 6], "semantic": {"name": "_tracelog_args", "arg_names": ["self", "logger", "posargs", "namedargs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _tracelog_args(self, logger, posargs, namedargs={}):\n if self._logger_not_available_during_library_init(logger):\n return\n args = [utils.safe_repr(a) for a in posargs] \\\n + ['%s=%s' % (utils.unic(a), utils.safe_repr(namedargs[a]))\n for a in namedargs]\n logger.trace('Arguments: [ %s ]' % ' | '.join(args))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L58_C8", "label": "if", "type": "if", "loc": [58, 59], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L57_C4", "vector": [4, 2, 0.1211, 0.0041, 2, 0.61, 0.0, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self._logger_not_available_during_library_init(logger):\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Return_L59_C12", "label": "return", "type": "return", "loc": [59, 59], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L58_C8", "vector": [13, 3, 0.1222, 0.0021, 3, 0.42, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L60_C8", "label": "args =", "type": "assigned_variable", "loc": [60, 62], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L57_C4", "vector": [14, 2, 0.1263, 0.0062, 2, 0.61, 0.5, 805, 4, 0, 0, 0, 0, 0, 3], "semantic": {"name": "args", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " args = [utils.safe_repr(a) for a in posargs] \\\n + ['%s=%s' % (utils.unic(a), utils.safe_repr(namedargs[a]))\n for a in namedargs]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Expr_L63_C8", "label": "trace()", "type": "expression", "loc": [63, 63], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L57_C4", "vector": [8, 2, 0.1304, 0.0021, 2, 0.61, 1.0, 211, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "trace", "arg_names": [], "import_names": [], "rhs_call_name": "trace", "annotation": ""}, "snippet": " logger.trace('Arguments: [ %s ]' % ' | '.join(args))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L65_C4", "label": "_logger_not_available_during_library_init", "type": "function", "loc": [65, 66], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L27_C0", "vector": [2, 1, 0.1356, 0.0041, 1, 0.78, 1.0, 761, 0, 2, 1, 0, 0, 0, 0], "semantic": {"name": "_logger_not_available_during_library_init", "arg_names": ["self", "logger"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _logger_not_available_during_library_init(self, logger):\n return not logger"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Return_L66_C8", "label": "return", "type": "return", "loc": [66, 66], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L65_C4", "vector": [13, 2, 0.1366, 0.0021, 2, 0.96, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return not logger"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L69_C0", "label": "PythonKeywordArguments", "type": "class", "loc": [69, 85], "level": 0, "parent": null, "vector": [3, 0, 0.1594, 0.0352, 0, 0.66, 0.381, 213, 0, 2, 0, 0, 796, 0, 4], "semantic": {"name": "PythonKeywordArguments", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class PythonKeywordArguments(_KeywordArguments):\n\n def _get_argument_resolver(self):\n return PythonKeywordArgumentResolver(self)\n\n def _get_arg_spec(self, handler):\n \"\"\"Returns info about args in a tuple (args, defaults, varargs)\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L71_C4", "label": "_get_argument_resolver", "type": "function", "loc": [71, 72], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L69_C0", "vector": [2, 1, 0.148, 0.0041, 1, 0.41, 0.0, 815, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "_get_argument_resolver", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _get_argument_resolver(self):\n return PythonKeywordArgumentResolver(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Return_L72_C8", "label": "return", "type": "return", "loc": [72, 72], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L71_C4", "vector": [13, 2, 0.1491, 0.0021, 2, 0.47, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return PythonKeywordArgumentResolver(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L74_C4", "label": "_get_arg_spec", "type": "function", "loc": [74, 85], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L69_C0", "vector": [2, 1, 0.1646, 0.0248, 1, 0.41, 1.0, 862, 0, 2, 1, 0, 0, 0, 3], "semantic": {"name": "_get_arg_spec", "arg_names": ["self", "handler"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _get_arg_spec(self, handler):\n \"\"\"Returns info about args in a tuple (args, defaults, varargs)\n\n args - list of all accepted arguments except varargs\n defaults - list of default values\n varargs - name of the argument accepting varargs or None\n \"\"\"\n args, varargs, _, defaults = inspect.getargspec(handler)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Expr_L75_C8", "label": "expression", "type": "expression", "loc": [75, 80], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L74_C4", "vector": [8, 2, 0.1605, 0.0124, 2, 0.48, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Returns info about args in a tuple (args, defaults, varargs)\n\n args - list of all accepted arguments except varargs\n defaults - list of default values\n varargs - name of the argument accepting varargs or None\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L81_C8", "label": "args, varargs, _, defaults = getargspec()", "type": "assigned_variable", "loc": [81, 81], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L74_C4", "vector": [14, 2, 0.1677, 0.0021, 2, 0.48, 0.25, 353, 3, 1, 0, 0, 179, 10, 1], "semantic": {"name": "args, varargs, _, defaults", "arg_names": [], "import_names": [], "rhs_call_name": "getargspec", "annotation": ""}, "snippet": " args, varargs, _, defaults = inspect.getargspec(handler)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L82_C8", "label": "if", "type": "if", "loc": [82, 83], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L74_C4", "vector": [4, 2, 0.1708, 0.0041, 2, 0.48, 0.5, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if inspect.ismethod(handler):\n args = args[1:] # drop 'self'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L83_C12", "label": "args =", "type": "assigned_variable", "loc": [83, 83], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L82_C8", "vector": [14, 3, 0.1718, 0.0021, 3, 0.58, 0.0, 805, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "args", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " args = args[1:] # drop 'self'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L84_C8", "label": "defaults =", "type": "assigned_variable", "loc": [84, 84], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L74_C4", "vector": [14, 2, 0.1739, 0.0021, 2, 0.48, 0.75, 233, 8, 0, 0, 0, 0, 0, 1], "semantic": {"name": "defaults", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " defaults = list(defaults) if defaults else []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Return_L85_C8", "label": "return", "type": "return", "loc": [85, 85], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L74_C4", "vector": [13, 2, 0.176, 0.0021, 2, 0.48, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return args, defaults, varargs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L88_C0", "label": "JavaKeywordArguments", "type": "class", "loc": [88, 135], "level": 0, "parent": null, "vector": [3, 0, 0.2308, 0.0994, 0, 0.66, 0.4286, 796, 0, 8, 0, 0, 796, 0, 15], "semantic": {"name": "JavaKeywordArguments", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class JavaKeywordArguments(_KeywordArguments):\n\n def __init__(self, handler_method, name):\n _KeywordArguments.__init__(self, handler_method, name)\n self.arg_coercer = ArgumentCoercer(self._get_signatures(handler_method))\n\n def _get_argument_resolver(self):\n return JavaKeywordArgumentResolver(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L90_C4", "label": "__init__", "type": "function", "loc": [90, 92], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L88_C0", "vector": [2, 1, 0.1884, 0.0062, 1, 0.92, 0.0, 555, 0, 3, 0, 0, 0, 0, 3], "semantic": {"name": "__init__", "arg_names": ["self", "handler_method", "name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, handler_method, name):\n _KeywordArguments.__init__(self, handler_method, name)\n self.arg_coercer = ArgumentCoercer(self._get_signatures(handler_method))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Expr_L91_C8", "label": "__init__()", "type": "expression", "loc": [91, 91], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L90_C4", "vector": [8, 2, 0.1884, 0.0021, 2, 0.3, 0.0, 555, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " _KeywordArguments.__init__(self, handler_method, name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L92_C8", "label": "self.arg_coercer = ArgumentCoercer()", "type": "assigned_variable", "loc": [92, 92], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L90_C4", "vector": [14, 2, 0.1905, 0.0021, 2, 0.3, 1.0, 944, 3, 1, 0, 0, 639, 10, 2], "semantic": {"name": "self.arg_coercer", "arg_names": [], "import_names": [], "rhs_call_name": "ArgumentCoercer", "annotation": ""}, "snippet": " self.arg_coercer = ArgumentCoercer(self._get_signatures(handler_method))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L94_C4", "label": "_get_argument_resolver", "type": "function", "loc": [94, 95], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L88_C0", "vector": [2, 1, 0.1957, 0.0041, 1, 0.92, 0.1429, 815, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "_get_argument_resolver", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _get_argument_resolver(self):\n return JavaKeywordArgumentResolver(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Return_L95_C8", "label": "return", "type": "return", "loc": [95, 95], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L94_C4", "vector": [13, 2, 0.1967, 0.0021, 2, 0.92, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return JavaKeywordArgumentResolver(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L97_C4", "label": "_determine_args", "type": "function", "loc": [97, 100], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L88_C0", "vector": [2, 1, 0.2039, 0.0083, 1, 0.92, 0.2857, 726, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "_determine_args", "arg_names": ["self", "handler_method"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _determine_args(self, handler_method):\n signatures = self._get_signatures(handler_method)\n minargs, maxargs = self._get_arg_limits(signatures)\n return [], [], None, minargs, maxargs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L98_C8", "label": "signatures = _get_signatures()", "type": "assigned_variable", "loc": [98, 98], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L97_C4", "vector": [14, 2, 0.2029, 0.0021, 2, 0.65, 0.0, 57, 3, 1, 0, 0, 917, 10, 1], "semantic": {"name": "signatures", "arg_names": [], "import_names": [], "rhs_call_name": "_get_signatures", "annotation": ""}, "snippet": " signatures = self._get_signatures(handler_method)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L99_C8", "label": "minargs, maxargs = _get_arg_limits()", "type": "assigned_variable", "loc": [99, 99], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L97_C4", "vector": [14, 2, 0.205, 0.0021, 2, 0.65, 0.5, 109, 3, 1, 0, 0, 864, 10, 1], "semantic": {"name": "minargs, maxargs", "arg_names": [], "import_names": [], "rhs_call_name": "_get_arg_limits", "annotation": ""}, "snippet": " minargs, maxargs = self._get_arg_limits(signatures)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Return_L100_C8", "label": "return", "type": "return", "loc": [100, 100], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L97_C4", "vector": [13, 2, 0.207, 0.0021, 2, 0.65, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return [], [], None, minargs, maxargs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L102_C4", "label": "_get_signatures", "type": "function", "loc": [102, 104], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L88_C0", "vector": [2, 1, 0.2133, 0.0062, 1, 0.92, 0.4286, 917, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "_get_signatures", "arg_names": ["self", "handler"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _get_signatures(self, handler):\n co = self._get_code_object(handler)\n return co.argslist[:co.nargs]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L103_C8", "label": "co = _get_code_object()", "type": "assigned_variable", "loc": [103, 103], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L102_C4", "vector": [14, 2, 0.2133, 0.0021, 2, 0.58, 0.0, 730, 3, 1, 0, 0, 945, 10, 1], "semantic": {"name": "co", "arg_names": [], "import_names": [], "rhs_call_name": "_get_code_object", "annotation": ""}, "snippet": " co = self._get_code_object(handler)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Return_L104_C8", "label": "return", "type": "return", "loc": [104, 104], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L102_C4", "vector": [13, 2, 0.2153, 0.0021, 2, 0.58, 1.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return co.argslist[:co.nargs]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L106_C4", "label": "_get_code_object", "type": "function", "loc": [106, 110], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L88_C0", "vector": [2, 1, 0.2236, 0.0104, 1, 0.92, 0.5714, 945, 0, 2, 1, 0, 0, 0, 0], "semantic": {"name": "_get_code_object", "arg_names": ["self", "handler"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _get_code_object(self, handler):\n try:\n return handler.im_func\n except AttributeError:\n return handler"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Try_L107_C8", "label": "try", "type": "try", "loc": [107, 110], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L106_C4", "vector": [7, 2, 0.2246, 0.0083, 2, 0.42, 0.0, 0, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n return handler.im_func\n except AttributeError:\n return handler"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Return_L108_C12", "label": "return", "type": "return", "loc": [108, 108], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:Try_L107_C8", "vector": [13, 3, 0.2236, 0.0021, 3, 0.46, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return handler.im_func"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Return_L110_C12", "label": "return", "type": "return", "loc": [110, 110], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:Try_L107_C8", "vector": [13, 3, 0.2277, 0.0021, 3, 0.46, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return handler"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L112_C4", "label": "_get_arg_limits", "type": "function", "loc": [112, 116], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L88_C0", "vector": [2, 1, 0.236, 0.0104, 1, 0.92, 0.7143, 864, 0, 2, 1, 0, 0, 0, 3], "semantic": {"name": "_get_arg_limits", "arg_names": ["self", "signatures"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _get_arg_limits(self, signatures):\n if len(signatures) == 1:\n return self._get_single_sig_arg_limits(signatures[0])\n else:\n return self._get_multi_sig_arg_limits(signatures)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L113_C8", "label": "if", "type": "if", "loc": [113, 116], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L112_C4", "vector": [4, 2, 0.2371, 0.0083, 2, 0.93, 0.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(signatures) == 1:\n return self._get_single_sig_arg_limits(signatures[0])\n else:\n return self._get_multi_sig_arg_limits(signatures)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Return_L114_C12", "label": "return", "type": "return", "loc": [114, 114], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L113_C8", "vector": [13, 3, 0.236, 0.0021, 3, 0.13, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._get_single_sig_arg_limits(signatures[0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Return_L116_C12", "label": "return", "type": "return", "loc": [116, 116], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L113_C8", "vector": [13, 3, 0.2402, 0.0021, 3, 0.13, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._get_multi_sig_arg_limits(signatures)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L118_C4", "label": "_get_single_sig_arg_limits", "type": "function", "loc": [118, 125], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L88_C0", "vector": [2, 1, 0.2516, 0.0166, 1, 0.92, 0.8571, 729, 0, 2, 1, 0, 0, 0, 4], "semantic": {"name": "_get_single_sig_arg_limits", "arg_names": ["self", "signature"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _get_single_sig_arg_limits(self, signature):\n args = signature.args\n if len(args) > 0 and args[-1].isArray():\n mina = len(args) - 1\n maxa = sys.maxint\n else:\n mina = maxa = len(args)\n return mina, maxa"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L119_C8", "label": "args =", "type": "assigned_variable", "loc": [119, 119], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L118_C4", "vector": [14, 2, 0.2464, 0.0021, 2, 0.69, 0.0, 805, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "args", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " args = signature.args"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L120_C8", "label": "if", "type": "if", "loc": [120, 124], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L118_C4", "vector": [4, 2, 0.2526, 0.0104, 2, 0.69, 0.5, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(args) > 0 and args[-1].isArray():\n mina = len(args) - 1\n maxa = sys.maxint\n else:\n mina = maxa = len(args)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L121_C12", "label": "mina =", "type": "assigned_variable", "loc": [121, 121], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L120_C8", "vector": [14, 3, 0.2505, 0.0021, 3, 0.1, 0.0, 877, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "mina", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mina = len(args) - 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L122_C12", "label": "maxa =", "type": "assigned_variable", "loc": [122, 122], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L120_C8", "vector": [14, 3, 0.2526, 0.0021, 3, 0.1, 0.5, 525, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "maxa", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " maxa = sys.maxint"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L124_C12", "label": "mina = len()", "type": "assigned_variable", "loc": [124, 124], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L120_C8", "vector": [14, 3, 0.2567, 0.0021, 3, 0.1, 1.0, 877, 3, 1, 0, 0, 890, 10, 1], "semantic": {"name": "mina", "arg_names": [], "import_names": [], "rhs_call_name": "len", "annotation": ""}, "snippet": " mina = maxa = len(args)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Return_L125_C8", "label": "return", "type": "return", "loc": [125, 125], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L118_C4", "vector": [13, 2, 0.2588, 0.0021, 2, 0.69, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return mina, maxa"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L127_C4", "label": "_get_multi_sig_arg_limits", "type": "function", "loc": [127, 135], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L88_C0", "vector": [2, 1, 0.2712, 0.0186, 1, 0.92, 1.0, 713, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "_get_multi_sig_arg_limits", "arg_names": ["self", "signatures"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _get_multi_sig_arg_limits(self, signatures):\n mina = maxa = None\n for sig in signatures:\n argc = len(sig.args)\n if mina is None or argc < mina:\n mina = argc\n if maxa is None or argc > maxa:\n maxa = argc"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L128_C8", "label": "mina =", "type": "assigned_variable", "loc": [128, 128], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L127_C4", "vector": [14, 2, 0.265, 0.0021, 2, 0.15, 0.0, 877, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "mina", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mina = maxa = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:For_L129_C8", "label": "for sig", "type": "for", "loc": [129, 134], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L127_C4", "vector": [6, 2, 0.2723, 0.0124, 2, 0.15, 0.5, 899, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "sig", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for sig in signatures:\n argc = len(sig.args)\n if mina is None or argc < mina:\n mina = argc\n if maxa is None or argc > maxa:\n maxa = argc"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L130_C12", "label": "argc = len()", "type": "assigned_variable", "loc": [130, 130], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:For_L129_C8", "vector": [14, 3, 0.2692, 0.0021, 3, 0.81, 0.0, 123, 3, 1, 0, 0, 890, 10, 1], "semantic": {"name": "argc", "arg_names": [], "import_names": [], "rhs_call_name": "len", "annotation": ""}, "snippet": " argc = len(sig.args)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L131_C12", "label": "if", "type": "if", "loc": [131, 132], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:For_L129_C8", "vector": [4, 3, 0.2723, 0.0041, 3, 0.81, 0.5, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if mina is None or argc < mina:\n mina = argc"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L132_C16", "label": "mina =", "type": "assigned_variable", "loc": [132, 132], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L131_C12", "vector": [14, 4, 0.2733, 0.0021, 4, 0.83, 0.0, 877, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "mina", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mina = argc"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L133_C12", "label": "if", "type": "if", "loc": [133, 134], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:For_L129_C8", "vector": [4, 3, 0.2764, 0.0041, 3, 0.81, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if maxa is None or argc > maxa:\n maxa = argc"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L134_C16", "label": "maxa =", "type": "assigned_variable", "loc": [134, 134], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L133_C12", "vector": [14, 4, 0.2774, 0.0021, 4, 0.21, 0.0, 525, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "maxa", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " maxa = argc"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Return_L135_C8", "label": "return", "type": "return", "loc": [135, 135], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L127_C4", "vector": [13, 2, 0.2795, 0.0021, 2, 0.15, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return mina, maxa"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L138_C0", "label": "DynamicKeywordArguments", "type": "class", "loc": [138, 173], "level": 0, "parent": null, "vector": [3, 0, 0.3219, 0.0745, 0, 0.66, 0.4762, 64, 0, 3, 0, 0, 796, 0, 10], "semantic": {"name": "DynamicKeywordArguments", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class DynamicKeywordArguments(_KeywordArguments):\n\n def _get_argument_resolver(self):\n return PythonKeywordArgumentResolver(self)\n\n def _get_arg_spec(self, argspec):\n if argspec is None:\n return [], [], '<unknown>'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L140_C4", "label": "_get_argument_resolver", "type": "function", "loc": [140, 141], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L138_C0", "vector": [2, 1, 0.2909, 0.0041, 1, 0.47, 0.0, 815, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "_get_argument_resolver", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _get_argument_resolver(self):\n return PythonKeywordArgumentResolver(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Return_L141_C8", "label": "return", "type": "return", "loc": [141, 141], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L140_C4", "vector": [13, 2, 0.2919, 0.0021, 2, 0.15, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return PythonKeywordArgumentResolver(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L143_C4", "label": "_get_arg_spec", "type": "function", "loc": [143, 151], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L138_C0", "vector": [2, 1, 0.3043, 0.0186, 1, 0.47, 0.5, 862, 0, 2, 1, 0, 0, 0, 4], "semantic": {"name": "_get_arg_spec", "arg_names": ["self", "argspec"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _get_arg_spec(self, argspec):\n if argspec is None:\n return [], [], '<unknown>'\n try:\n if isinstance(argspec, basestring):\n raise TypeError\n return self._parse_arg_spec(list(argspec))\n except TypeError:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L144_C8", "label": "if", "type": "if", "loc": [144, 145], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L143_C4", "vector": [4, 2, 0.2992, 0.0041, 2, 0.08, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if argspec is None:\n return [], [], '<unknown>'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Return_L145_C12", "label": "return", "type": "return", "loc": [145, 145], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L144_C8", "vector": [13, 3, 0.3002, 0.0021, 3, 0.33, 0.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return [], [], '<unknown>'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Try_L146_C8", "label": "try", "type": "try", "loc": [146, 151], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L143_C4", "vector": [7, 2, 0.3075, 0.0124, 2, 0.08, 1.0, 0, 0, 1, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n if isinstance(argspec, basestring):\n raise TypeError\n return self._parse_arg_spec(list(argspec))\n except TypeError:\n raise TypeError('Argument spec should be a list/array of strings')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L147_C12", "label": "if", "type": "if", "loc": [147, 148], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:Try_L146_C8", "vector": [4, 3, 0.3054, 0.0041, 3, 0.26, 0.0, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if isinstance(argspec, basestring):\n raise TypeError"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Return_L149_C12", "label": "return", "type": "return", "loc": [149, 149], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:Try_L146_C8", "vector": [13, 3, 0.3085, 0.0021, 3, 0.26, 1.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._parse_arg_spec(list(argspec))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L153_C4", "label": "_parse_arg_spec", "type": "function", "loc": [153, 173], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L138_C0", "vector": [2, 1, 0.3375, 0.0435, 1, 0.47, 1.0, 959, 0, 2, 1, 0, 0, 0, 5], "semantic": {"name": "_parse_arg_spec", "arg_names": ["self", "argspec"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _parse_arg_spec(self, argspec):\n if argspec == []:\n return [], [], None\n args = []\n defaults = []\n vararg = None\n for token in argspec:\n if vararg is not None:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L154_C8", "label": "if", "type": "if", "loc": [154, 155], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L153_C4", "vector": [4, 2, 0.3199, 0.0041, 2, 0.66, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if argspec == []:\n return [], [], None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Return_L155_C12", "label": "return", "type": "return", "loc": [155, 155], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L154_C8", "vector": [13, 3, 0.3209, 0.0021, 3, 0.96, 0.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return [], [], None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L156_C8", "label": "args =", "type": "assigned_variable", "loc": [156, 156], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L153_C4", "vector": [14, 2, 0.323, 0.0021, 2, 0.66, 0.2, 805, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "args", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " args = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L157_C8", "label": "defaults =", "type": "assigned_variable", "loc": [157, 157], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L153_C4", "vector": [14, 2, 0.3251, 0.0021, 2, 0.66, 0.4, 233, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "defaults", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " defaults = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L158_C8", "label": "vararg =", "type": "assigned_variable", "loc": [158, 158], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L153_C4", "vector": [14, 2, 0.3271, 0.0021, 2, 0.66, 0.6, 871, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "vararg", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " vararg = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:For_L159_C8", "label": "for token", "type": "for", "loc": [159, 172], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L153_C4", "vector": [6, 2, 0.3427, 0.029, 2, 0.66, 0.8, 129, 2, 0, 0, 0, 0, 0, 5], "semantic": {"name": "token", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for token in argspec:\n if vararg is not None:\n raise TypeError\n if token.startswith('*'):\n vararg = token[1:]\n continue\n if '=' in token:\n arg, default = token.split('=', 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L160_C12", "label": "if", "type": "if", "loc": [160, 161], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:For_L159_C8", "vector": [4, 3, 0.3323, 0.0041, 3, 0.68, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if vararg is not None:\n raise TypeError"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L162_C12", "label": "if", "type": "if", "loc": [162, 164], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:For_L159_C8", "vector": [4, 3, 0.3375, 0.0062, 3, 0.68, 0.25, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if token.startswith('*'):\n vararg = token[1:]\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L163_C16", "label": "vararg =", "type": "assigned_variable", "loc": [163, 163], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L162_C12", "vector": [14, 4, 0.3375, 0.0021, 4, 0.68, 0.0, 871, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "vararg", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " vararg = token[1:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L165_C12", "label": "if", "type": "if", "loc": [165, 169], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:For_L159_C8", "vector": [4, 3, 0.3458, 0.0104, 3, 0.68, 0.5, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if '=' in token:\n arg, default = token.split('=', 1)\n args.append(arg)\n defaults.append(default)\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L166_C16", "label": "arg, default = split()", "type": "assigned_variable", "loc": [166, 166], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L165_C12", "vector": [14, 4, 0.3437, 0.0021, 4, 0.63, 0.0, 39, 3, 2, 0, 0, 908, 10, 1], "semantic": {"name": "arg, default", "arg_names": [], "import_names": [], "rhs_call_name": "split", "annotation": ""}, "snippet": " arg, default = token.split('=', 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Expr_L167_C16", "label": "append()", "type": "expression", "loc": [167, 167], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L165_C12", "vector": [8, 4, 0.3458, 0.0021, 4, 0.63, 0.5, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " args.append(arg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Expr_L168_C16", "label": "append()", "type": "expression", "loc": [168, 168], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L165_C12", "vector": [8, 4, 0.3478, 0.0021, 4, 0.63, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " defaults.append(default)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L170_C12", "label": "if", "type": "if", "loc": [170, 171], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:For_L159_C8", "vector": [4, 3, 0.353, 0.0041, 3, 0.68, 0.75, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if defaults:\n raise TypeError"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Expr_L172_C12", "label": "append()", "type": "expression", "loc": [172, 172], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:For_L159_C8", "vector": [8, 3, 0.3561, 0.0021, 3, 0.68, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " args.append(token)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Return_L173_C8", "label": "return", "type": "return", "loc": [173, 173], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L153_C4", "vector": [13, 2, 0.3582, 0.0021, 2, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return args, defaults, vararg"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L176_C0", "label": "RunKeywordArguments", "type": "class", "loc": [176, 184], "level": 0, "parent": null, "vector": [3, 0, 0.3727, 0.0186, 0, 0.66, 0.5238, 462, 0, 2, 0, 0, 213, 0, 2], "semantic": {"name": "RunKeywordArguments", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class RunKeywordArguments(PythonKeywordArguments):\n\n def __init__(self, argument_source, name, arg_resolution_index):\n PythonKeywordArguments.__init__(self, argument_source, name)\n self._arg_resolution_index = arg_resolution_index\n\n def _resolve(self, args, variables, output):\n args = variables.replace_from_beginning(self._arg_resolution_index, args)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L178_C4", "label": "__init__", "type": "function", "loc": [178, 180], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L176_C0", "vector": [2, 1, 0.3706, 0.0062, 1, 0.57, 0.0, 555, 0, 4, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": ["self", "argument_source", "name", "arg_resolution_index"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, argument_source, name, arg_resolution_index):\n PythonKeywordArguments.__init__(self, argument_source, name)\n self._arg_resolution_index = arg_resolution_index"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Expr_L179_C8", "label": "__init__()", "type": "expression", "loc": [179, 179], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L178_C4", "vector": [8, 2, 0.3706, 0.0021, 2, 0.1, 0.0, 555, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " PythonKeywordArguments.__init__(self, argument_source, name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L180_C8", "label": "self._arg_resolution_index =", "type": "assigned_variable", "loc": [180, 180], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L178_C4", "vector": [14, 2, 0.3727, 0.0021, 2, 0.1, 1.0, 357, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._arg_resolution_index", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._arg_resolution_index = arg_resolution_index"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L182_C4", "label": "_resolve", "type": "function", "loc": [182, 184], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L176_C0", "vector": [2, 1, 0.3789, 0.0062, 1, 0.57, 1.0, 779, 0, 4, 1, 0, 0, 0, 1], "semantic": {"name": "_resolve", "arg_names": ["self", "args", "variables", "output"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _resolve(self, args, variables, output):\n args = variables.replace_from_beginning(self._arg_resolution_index, args)\n return args, {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L183_C8", "label": "args = replace_from_beginning()", "type": "assigned_variable", "loc": [183, 183], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L182_C4", "vector": [14, 2, 0.3789, 0.0021, 2, 0.17, 0.0, 805, 3, 2, 0, 0, 167, 10, 1], "semantic": {"name": "args", "arg_names": [], "import_names": [], "rhs_call_name": "replace_from_beginning", "annotation": ""}, "snippet": " args = variables.replace_from_beginning(self._arg_resolution_index, args)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Return_L184_C8", "label": "return", "type": "return", "loc": [184, 184], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L182_C4", "vector": [13, 2, 0.381, 0.0021, 2, 0.17, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return args, {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L187_C0", "label": "PythonInitArguments", "type": "class", "loc": [187, 188], "level": 0, "parent": null, "vector": [3, 0, 0.3882, 0.0041, 0, 0.66, 0.5714, 742, 0, 0, 0, 0, 213, 0, 0], "semantic": {"name": "PythonInitArguments", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class PythonInitArguments(PythonKeywordArguments):\n _type = 'Test Library'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L188_C4", "label": "_type =", "type": "assigned_variable", "loc": [188, 188], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L187_C0", "vector": [14, 1, 0.3892, 0.0021, 1, 0.05, 0.0, 439, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "_type", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " _type = 'Test Library'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L191_C0", "label": "JavaInitArguments", "type": "class", "loc": [191, 198], "level": 0, "parent": null, "vector": [3, 0, 0.4027, 0.0166, 0, 0.66, 0.619, 414, 0, 1, 0, 0, 796, 0, 2], "semantic": {"name": "JavaInitArguments", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class JavaInitArguments(JavaKeywordArguments):\n _type = 'Test Library'\n\n def resolve(self, args, variables=None):\n if variables:\n args = variables.replace_list(args)\n self.check_arg_limits(args)\n return args, {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L192_C4", "label": "_type =", "type": "assigned_variable", "loc": [192, 192], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L191_C0", "vector": [14, 1, 0.3975, 0.0021, 1, 0.15, 0.0, 439, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "_type", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " _type = 'Test Library'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L194_C4", "label": "resolve", "type": "function", "loc": [194, 198], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L191_C0", "vector": [2, 1, 0.4058, 0.0104, 1, 0.15, 1.0, 675, 0, 3, 1, 0, 0, 0, 2], "semantic": {"name": "resolve", "arg_names": ["self", "args", "variables"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def resolve(self, args, variables=None):\n if variables:\n args = variables.replace_list(args)\n self.check_arg_limits(args)\n return args, {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L195_C8", "label": "if", "type": "if", "loc": [195, 196], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L194_C4", "vector": [4, 2, 0.4048, 0.0041, 2, 0.05, 0.0, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if variables:\n args = variables.replace_list(args)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L196_C12", "label": "args = replace_list()", "type": "assigned_variable", "loc": [196, 196], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L195_C8", "vector": [14, 3, 0.4058, 0.0021, 3, 0.74, 0.0, 805, 3, 1, 0, 0, 919, 10, 1], "semantic": {"name": "args", "arg_names": [], "import_names": [], "rhs_call_name": "replace_list", "annotation": ""}, "snippet": " args = variables.replace_list(args)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Expr_L197_C8", "label": "check_arg_limits()", "type": "expression", "loc": [197, 197], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L194_C4", "vector": [8, 2, 0.4079, 0.0021, 2, 0.05, 0.5, 324, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "check_arg_limits", "arg_names": [], "import_names": [], "rhs_call_name": "check_arg_limits", "annotation": ""}, "snippet": " self.check_arg_limits(args)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Return_L198_C8", "label": "return", "type": "return", "loc": [198, 198], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L194_C4", "vector": [13, 2, 0.4099, 0.0021, 2, 0.05, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return args, {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L201_C0", "label": "UserKeywordArguments", "type": "class", "loc": [201, 310], "level": 0, "parent": null, "vector": [3, 0, 0.529, 0.2277, 0, 0.66, 0.6667, 34, 0, 14, 0, 0, 186, 0, 49], "semantic": {"name": "UserKeywordArguments", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class UserKeywordArguments(object):\n\n def __init__(self, args, name):\n self.names, self.defaults, self.varargs = self._get_arg_spec(args)\n self.minargs = len(self.names) - len(self.defaults)\n maxargs = len(self.names) if not self.varargs else sys.maxint\n self._arg_limit_checker = _ArgLimitChecker(self.minargs, maxargs,\n name, 'Keyword')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L203_C4", "label": "__init__", "type": "function", "loc": [203, 208], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L201_C0", "vector": [2, 1, 0.4255, 0.0124, 1, 0.11, 0.0, 555, 0, 3, 0, 0, 0, 0, 5], "semantic": {"name": "__init__", "arg_names": ["self", "args", "name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, args, name):\n self.names, self.defaults, self.varargs = self._get_arg_spec(args)\n self.minargs = len(self.names) - len(self.defaults)\n maxargs = len(self.names) if not self.varargs else sys.maxint\n self._arg_limit_checker = _ArgLimitChecker(self.minargs, maxargs,\n name, 'Keyword')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L204_C8", "label": " = _get_arg_spec()", "type": "assigned_variable", "loc": [204, 204], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L203_C4", "vector": [14, 2, 0.4224, 0.0021, 2, 0.41, 0.0, 0, 3, 1, 0, 0, 862, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "_get_arg_spec", "annotation": ""}, "snippet": " self.names, self.defaults, self.varargs = self._get_arg_spec(args)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L205_C8", "label": "self.minargs =", "type": "assigned_variable", "loc": [205, 205], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L203_C4", "vector": [14, 2, 0.4244, 0.0021, 2, 0.41, 0.3333, 421, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "self.minargs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.minargs = len(self.names) - len(self.defaults)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L206_C8", "label": "maxargs =", "type": "assigned_variable", "loc": [206, 206], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L203_C4", "vector": [14, 2, 0.4265, 0.0021, 2, 0.41, 0.6667, 321, 8, 0, 0, 0, 0, 0, 1], "semantic": {"name": "maxargs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " maxargs = len(self.names) if not self.varargs else sys.maxint"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L207_C8", "label": "self._arg_limit_checker = _ArgLimitChecker()", "type": "assigned_variable", "loc": [207, 208], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L203_C4", "vector": [14, 2, 0.4296, 0.0041, 2, 0.41, 1.0, 347, 3, 4, 0, 0, 456, 10, 1], "semantic": {"name": "self._arg_limit_checker", "arg_names": [], "import_names": [], "rhs_call_name": "_ArgLimitChecker", "annotation": ""}, "snippet": " self._arg_limit_checker = _ArgLimitChecker(self.minargs, maxargs,\n name, 'Keyword')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L210_C4", "label": "_get_arg_spec", "type": "function", "loc": [210, 240], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L201_C0", "vector": [2, 1, 0.4658, 0.0642, 1, 0.11, 0.0769, 862, 0, 2, 1, 0, 0, 0, 8], "semantic": {"name": "_get_arg_spec", "arg_names": ["self", "origargs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _get_arg_spec(self, origargs):\n \"\"\"Returns argument spec in a tuple (args, defaults, varargs).\n\n args - tuple of all accepted arguments\n defaults - tuple of default values\n varargs - name of the argument accepting varargs or None\n\n Examples:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Expr_L211_C8", "label": "expression", "type": "expression", "loc": [211, 222], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L210_C4", "vector": [8, 2, 0.4482, 0.0248, 2, 0.58, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Returns argument spec in a tuple (args, defaults, varargs).\n\n args - tuple of all accepted arguments\n defaults - tuple of default values\n varargs - name of the argument accepting varargs or None\n\n Examples:\n ['${arg1}', '${arg2}']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L223_C8", "label": "args =", "type": "assigned_variable", "loc": [223, 223], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L210_C4", "vector": [14, 2, 0.4617, 0.0021, 2, 0.58, 0.2, 805, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "args", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " args = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L224_C8", "label": "defaults =", "type": "assigned_variable", "loc": [224, 224], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L210_C4", "vector": [14, 2, 0.4638, 0.0021, 2, 0.58, 0.4, 233, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "defaults", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " defaults = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L225_C8", "label": "varargs =", "type": "assigned_variable", "loc": [225, 225], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L210_C4", "vector": [14, 2, 0.4658, 0.0021, 2, 0.58, 0.6, 501, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "varargs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " varargs = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:For_L226_C8", "label": "for arg", "type": "for", "loc": [226, 239], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L210_C4", "vector": [6, 2, 0.4814, 0.029, 2, 0.58, 0.8, 447, 2, 0, 0, 0, 0, 0, 8], "semantic": {"name": "arg", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for arg in origargs:\n if varargs:\n raise DataError('Only last argument can be a list')\n if is_list_var(arg):\n varargs = arg\n continue # should be last round (otherwise DataError in next)\n arg, default = self._split_default(arg)\n if defaults and default is None:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L227_C12", "label": "if", "type": "if", "loc": [227, 228], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:For_L226_C8", "vector": [4, 3, 0.471, 0.0041, 3, 0.61, 0.0, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if varargs:\n raise DataError('Only last argument can be a list')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L229_C12", "label": "if", "type": "if", "loc": [229, 231], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:For_L226_C8", "vector": [4, 3, 0.4762, 0.0062, 3, 0.61, 0.1667, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if is_list_var(arg):\n varargs = arg\n continue # should be last round (otherwise DataError in next)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L230_C16", "label": "varargs =", "type": "assigned_variable", "loc": [230, 230], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L229_C12", "vector": [14, 4, 0.4762, 0.0021, 4, 0.79, 0.0, 501, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "varargs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " varargs = arg"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L232_C12", "label": "arg, default = _split_default()", "type": "assigned_variable", "loc": [232, 232], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:For_L226_C8", "vector": [14, 3, 0.4803, 0.0021, 3, 0.61, 0.3333, 39, 3, 1, 0, 0, 475, 10, 1], "semantic": {"name": "arg, default", "arg_names": [], "import_names": [], "rhs_call_name": "_split_default", "annotation": ""}, "snippet": " arg, default = self._split_default(arg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L233_C12", "label": "if", "type": "if", "loc": [233, 234], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:For_L226_C8", "vector": [4, 3, 0.4834, 0.0041, 3, 0.61, 0.5, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if defaults and default is None:\n raise DataError('Non default argument after default arguments')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L235_C12", "label": "if", "type": "if", "loc": [235, 236], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:For_L226_C8", "vector": [4, 3, 0.4876, 0.0041, 3, 0.61, 0.6667, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not is_scalar_var(arg):\n raise DataError(\"Invalid argument '%s'\" % arg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Expr_L237_C12", "label": "append()", "type": "expression", "loc": [237, 237], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:For_L226_C8", "vector": [8, 3, 0.4907, 0.0021, 3, 0.61, 0.8333, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " args.append(arg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L238_C12", "label": "if", "type": "if", "loc": [238, 239], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:For_L226_C8", "vector": [4, 3, 0.4938, 0.0041, 3, 0.61, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if default is not None:\n defaults.append(default)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Expr_L239_C16", "label": "append()", "type": "expression", "loc": [239, 239], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L238_C12", "vector": [8, 4, 0.4948, 0.0021, 4, 0.52, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " defaults.append(default)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Return_L240_C8", "label": "return", "type": "return", "loc": [240, 240], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L210_C4", "vector": [13, 2, 0.4969, 0.0021, 2, 0.58, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return args, defaults, varargs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L242_C4", "label": "_split_default", "type": "function", "loc": [242, 245], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L201_C0", "vector": [2, 1, 0.5041, 0.0083, 1, 0.11, 0.1538, 475, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "_split_default", "arg_names": ["self", "arg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _split_default(self, arg):\n if '=' not in arg:\n return arg, None\n return arg.split('=', 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L243_C8", "label": "if", "type": "if", "loc": [243, 244], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L242_C4", "vector": [4, 2, 0.5041, 0.0041, 2, 0.18, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if '=' not in arg:\n return arg, None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Return_L244_C12", "label": "return", "type": "return", "loc": [244, 244], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L243_C8", "vector": [13, 3, 0.5052, 0.0021, 3, 0.43, 0.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return arg, None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Return_L245_C8", "label": "return", "type": "return", "loc": [245, 245], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L242_C4", "vector": [13, 2, 0.5072, 0.0021, 2, 0.18, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return arg.split('=', 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L247_C4", "label": "resolve_arguments_for_dry_run", "type": "function", "loc": [247, 253], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L201_C0", "vector": [2, 1, 0.5176, 0.0145, 1, 0.11, 0.2308, 369, 0, 2, 1, 0, 0, 0, 4], "semantic": {"name": "resolve_arguments_for_dry_run", "arg_names": ["self", "arguments"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def resolve_arguments_for_dry_run(self, arguments):\n self._arg_limit_checker.check_arg_limits_for_dry_run(arguments)\n required_number_of_args = self.minargs + len(self.defaults)\n needed_args = required_number_of_args - len(arguments)\n if needed_args > 0:\n return self._fill_missing_args(arguments, needed_args)\n return arguments"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Expr_L248_C8", "label": "check_arg_limits_for_dry_run()", "type": "expression", "loc": [248, 248], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L247_C4", "vector": [8, 2, 0.5135, 0.0021, 2, 0.86, 0.0, 100, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "check_arg_limits_for_dry_run", "arg_names": [], "import_names": [], "rhs_call_name": "check_arg_limits_for_dry_run", "annotation": ""}, "snippet": " self._arg_limit_checker.check_arg_limits_for_dry_run(arguments)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L249_C8", "label": "required_number_of_args =", "type": "assigned_variable", "loc": [249, 249], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L247_C4", "vector": [14, 2, 0.5155, 0.0021, 2, 0.86, 0.25, 879, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "required_number_of_args", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " required_number_of_args = self.minargs + len(self.defaults)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L250_C8", "label": "needed_args =", "type": "assigned_variable", "loc": [250, 250], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L247_C4", "vector": [14, 2, 0.5176, 0.0021, 2, 0.86, 0.5, 985, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "needed_args", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " needed_args = required_number_of_args - len(arguments)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L251_C8", "label": "if", "type": "if", "loc": [251, 252], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L247_C4", "vector": [4, 2, 0.5207, 0.0041, 2, 0.86, 0.75, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if needed_args > 0:\n return self._fill_missing_args(arguments, needed_args)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Return_L252_C12", "label": "return", "type": "return", "loc": [252, 252], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L251_C8", "vector": [13, 3, 0.5217, 0.0021, 3, 0.43, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._fill_missing_args(arguments, needed_args)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Return_L253_C8", "label": "return", "type": "return", "loc": [253, 253], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L247_C4", "vector": [13, 2, 0.5238, 0.0021, 2, 0.86, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return arguments"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L255_C4", "label": "_fill_missing_args", "type": "function", "loc": [255, 256], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L201_C0", "vector": [2, 1, 0.529, 0.0041, 1, 0.11, 0.3077, 228, 0, 3, 1, 0, 0, 0, 0], "semantic": {"name": "_fill_missing_args", "arg_names": ["self", "arguments", "needed"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _fill_missing_args(self, arguments, needed):\n return arguments + needed * [None]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Return_L256_C8", "label": "return", "type": "return", "loc": [256, 256], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L255_C4", "vector": [13, 2, 0.53, 0.0021, 2, 0.56, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return arguments + needed * [None]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L258_C4", "label": "resolve", "type": "function", "loc": [258, 264], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L201_C0", "vector": [2, 1, 0.5404, 0.0145, 1, 0.11, 0.3846, 675, 0, 4, 1, 0, 0, 0, 5], "semantic": {"name": "resolve", "arg_names": ["self", "arguments", "variables", "output"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def resolve(self, arguments, variables, output):\n positional, varargs, named = self._resolve_arg_usage(arguments, variables, output)\n self._arg_limit_checker.check_arg_limits(positional+varargs, named)\n argument_values = self._resolve_arg_values(variables, named, positional)\n argument_values += varargs\n self._arg_limit_checker.check_missing_args(argument_values, len(arguments))\n return argument_values"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L259_C8", "label": "positional, varargs, named = _resolve_arg_usage()", "type": "assigned_variable", "loc": [259, 259], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L258_C4", "vector": [14, 2, 0.5362, 0.0021, 2, 0.52, 0.0, 813, 3, 3, 0, 0, 791, 10, 1], "semantic": {"name": "positional, varargs, named", "arg_names": [], "import_names": [], "rhs_call_name": "_resolve_arg_usage", "annotation": ""}, "snippet": " positional, varargs, named = self._resolve_arg_usage(arguments, variables, output)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Expr_L260_C8", "label": "check_arg_limits()", "type": "expression", "loc": [260, 260], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L258_C4", "vector": [8, 2, 0.5383, 0.0021, 2, 0.52, 0.25, 324, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "check_arg_limits", "arg_names": [], "import_names": [], "rhs_call_name": "check_arg_limits", "annotation": ""}, "snippet": " self._arg_limit_checker.check_arg_limits(positional+varargs, named)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L261_C8", "label": "argument_values = _resolve_arg_values()", "type": "assigned_variable", "loc": [261, 261], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L258_C4", "vector": [14, 2, 0.5404, 0.0021, 2, 0.52, 0.5, 333, 3, 3, 0, 0, 122, 10, 1], "semantic": {"name": "argument_values", "arg_names": [], "import_names": [], "rhs_call_name": "_resolve_arg_values", "annotation": ""}, "snippet": " argument_values = self._resolve_arg_values(variables, named, positional)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Expr_L263_C8", "label": "check_missing_args()", "type": "expression", "loc": [263, 263], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L258_C4", "vector": [8, 2, 0.5445, 0.0021, 2, 0.52, 0.75, 32, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "check_missing_args", "arg_names": [], "import_names": [], "rhs_call_name": "check_missing_args", "annotation": ""}, "snippet": " self._arg_limit_checker.check_missing_args(argument_values, len(arguments))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Return_L264_C8", "label": "return", "type": "return", "loc": [264, 264], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L258_C4", "vector": [13, 2, 0.5466, 0.0021, 2, 0.52, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return argument_values"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L266_C4", "label": "_resolve_arg_usage", "type": "function", "loc": [266, 270], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L201_C0", "vector": [2, 1, 0.5549, 0.0104, 1, 0.11, 0.4615, 791, 0, 4, 1, 0, 0, 0, 4], "semantic": {"name": "_resolve_arg_usage", "arg_names": ["self", "arguments", "variables", "output"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _resolve_arg_usage(self, arguments, variables, output):\n resolver = UserKeywordArgumentResolver(self)\n positional, named = resolver.resolve(arguments, output=output)\n positional, named = self._replace_variables(variables, positional, named)\n return self._split_args_and_varargs(positional) + (named,)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L267_C8", "label": "resolver = UserKeywordArgumentResolver()", "type": "assigned_variable", "loc": [267, 267], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L266_C4", "vector": [14, 2, 0.5528, 0.0021, 2, 0.27, 0.0, 594, 3, 1, 0, 0, 49, 10, 1], "semantic": {"name": "resolver", "arg_names": [], "import_names": [], "rhs_call_name": "UserKeywordArgumentResolver", "annotation": ""}, "snippet": " resolver = UserKeywordArgumentResolver(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L268_C8", "label": "positional, named = resolve()", "type": "assigned_variable", "loc": [268, 268], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L266_C4", "vector": [14, 2, 0.5549, 0.0021, 2, 0.27, 0.3333, 437, 3, 2, 0, 0, 675, 10, 1], "semantic": {"name": "positional, named", "arg_names": [], "import_names": [], "rhs_call_name": "resolve", "annotation": ""}, "snippet": " positional, named = resolver.resolve(arguments, output=output)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L269_C8", "label": "positional, named = _replace_variables()", "type": "assigned_variable", "loc": [269, 269], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L266_C4", "vector": [14, 2, 0.5569, 0.0021, 2, 0.27, 0.6667, 437, 3, 3, 0, 0, 204, 10, 1], "semantic": {"name": "positional, named", "arg_names": [], "import_names": [], "rhs_call_name": "_replace_variables", "annotation": ""}, "snippet": " positional, named = self._replace_variables(variables, positional, named)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Return_L270_C8", "label": "return", "type": "return", "loc": [270, 270], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L266_C4", "vector": [13, 2, 0.559, 0.0021, 2, 0.27, 1.0, 0, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._split_args_and_varargs(positional) + (named,)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L272_C4", "label": "_resolve_arg_values", "type": "function", "loc": [272, 278], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L201_C0", "vector": [2, 1, 0.5694, 0.0145, 1, 0.11, 0.5385, 122, 0, 4, 1, 0, 0, 0, 7], "semantic": {"name": "_resolve_arg_values", "arg_names": ["self", "variables", "named", "positional"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _resolve_arg_values(self, variables, named, positional):\n template = self._template_for(variables)\n for name, value in named.items():\n template.set_value(self.names.index(name), value)\n for index, value in enumerate(positional):\n template.set_value(index, value)\n return template.as_list()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L273_C8", "label": "template = _template_for()", "type": "assigned_variable", "loc": [273, 273], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L272_C4", "vector": [14, 2, 0.5652, 0.0021, 2, 0.18, 0.0, 549, 3, 1, 0, 0, 401, 10, 1], "semantic": {"name": "template", "arg_names": [], "import_names": [], "rhs_call_name": "_template_for", "annotation": ""}, "snippet": " template = self._template_for(variables)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:For_L274_C8", "label": "for name, value", "type": "for", "loc": [274, 275], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L272_C4", "vector": [6, 2, 0.5683, 0.0041, 2, 0.18, 0.3333, 509, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "name, value", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for name, value in named.items():\n template.set_value(self.names.index(name), value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Expr_L275_C12", "label": "set_value()", "type": "expression", "loc": [275, 275], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:For_L274_C8", "vector": [8, 3, 0.5694, 0.0021, 3, 0.41, 0.0, 493, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "set_value", "arg_names": [], "import_names": [], "rhs_call_name": "set_value", "annotation": ""}, "snippet": " template.set_value(self.names.index(name), value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:For_L276_C8", "label": "for index, value", "type": "for", "loc": [276, 277], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L272_C4", "vector": [6, 2, 0.5725, 0.0041, 2, 0.18, 0.6667, 827, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "index, value", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for index, value in enumerate(positional):\n template.set_value(index, value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Expr_L277_C12", "label": "set_value()", "type": "expression", "loc": [277, 277], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:For_L276_C8", "vector": [8, 3, 0.5735, 0.0021, 3, 0.3, 0.0, 493, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "set_value", "arg_names": [], "import_names": [], "rhs_call_name": "set_value", "annotation": ""}, "snippet": " template.set_value(index, value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Return_L278_C8", "label": "return", "type": "return", "loc": [278, 278], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L272_C4", "vector": [13, 2, 0.5756, 0.0021, 2, 0.18, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return template.as_list()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L280_C4", "label": "_template_for", "type": "function", "loc": [280, 282], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L201_C0", "vector": [2, 1, 0.5818, 0.0062, 1, 0.11, 0.6154, 401, 0, 2, 1, 0, 0, 0, 3], "semantic": {"name": "_template_for", "arg_names": ["self", "variables"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _template_for(self, variables):\n defaults = variables.replace_list(list(self.defaults))\n return UserKeywordArgsTemplate(self.minargs, defaults)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L281_C8", "label": "defaults = replace_list()", "type": "assigned_variable", "loc": [281, 281], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L280_C4", "vector": [14, 2, 0.5818, 0.0021, 2, 0.14, 0.0, 233, 3, 1, 0, 0, 919, 10, 2], "semantic": {"name": "defaults", "arg_names": [], "import_names": [], "rhs_call_name": "replace_list", "annotation": ""}, "snippet": " defaults = variables.replace_list(list(self.defaults))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Return_L282_C8", "label": "return", "type": "return", "loc": [282, 282], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L280_C4", "vector": [13, 2, 0.5839, 0.0021, 2, 0.14, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return UserKeywordArgsTemplate(self.minargs, defaults)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L284_C4", "label": "_replace_variables", "type": "function", "loc": [284, 287], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L201_C0", "vector": [2, 1, 0.5911, 0.0083, 1, 0.11, 0.6923, 204, 0, 4, 1, 0, 0, 0, 2], "semantic": {"name": "_replace_variables", "arg_names": ["self", "variables", "positional", "named"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _replace_variables(self, variables, positional, named):\n for name in named:\n named[name] = variables.replace_scalar(named[name])\n return variables.replace_list(positional), named"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:For_L285_C8", "label": "for name", "type": "for", "loc": [285, 286], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L284_C4", "vector": [6, 2, 0.5911, 0.0041, 2, 0.63, 0.0, 57, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for name in named:\n named[name] = variables.replace_scalar(named[name])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L286_C12", "label": " = replace_scalar()", "type": "assigned_variable", "loc": [286, 286], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:For_L285_C8", "vector": [14, 3, 0.5921, 0.0021, 3, 0.47, 0.0, 0, 3, 1, 0, 0, 156, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "replace_scalar", "annotation": ""}, "snippet": " named[name] = variables.replace_scalar(named[name])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Return_L287_C8", "label": "return", "type": "return", "loc": [287, 287], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L284_C4", "vector": [13, 2, 0.5942, 0.0021, 2, 0.63, 1.0, 0, 0, 0, 0, 0, 0, 8, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return variables.replace_list(positional), named"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L289_C4", "label": "set_variables", "type": "function", "loc": [289, 295], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L201_C0", "vector": [2, 1, 0.6046, 0.0145, 1, 0.11, 0.7692, 859, 0, 4, 0, 0, 0, 0, 3], "semantic": {"name": "set_variables", "arg_names": ["self", "arg_values", "variables", "output"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def set_variables(self, arg_values, variables, output):\n before_varargs, varargs = self._split_args_and_varargs(arg_values)\n for name, value in zip(self.names, before_varargs):\n variables[name] = value\n if self.varargs:\n variables[self.varargs] = varargs\n self._tracelog_args(output, variables)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L290_C8", "label": "before_varargs, varargs = _split_args_and_varargs()", "type": "assigned_variable", "loc": [290, 290], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L289_C4", "vector": [14, 2, 0.6004, 0.0021, 2, 0.63, 0.0, 607, 3, 1, 0, 0, 462, 10, 1], "semantic": {"name": "before_varargs, varargs", "arg_names": [], "import_names": [], "rhs_call_name": "_split_args_and_varargs", "annotation": ""}, "snippet": " before_varargs, varargs = self._split_args_and_varargs(arg_values)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:For_L291_C8", "label": "for name, value", "type": "for", "loc": [291, 292], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L289_C4", "vector": [6, 2, 0.6035, 0.0041, 2, 0.63, 0.3333, 509, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "name, value", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for name, value in zip(self.names, before_varargs):\n variables[name] = value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L292_C12", "label": "assign", "type": "assigned_variable", "loc": [292, 292], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:For_L291_C8", "vector": [14, 3, 0.6046, 0.0021, 3, 0.25, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " variables[name] = value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L293_C8", "label": "if", "type": "if", "loc": [293, 294], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L289_C4", "vector": [4, 2, 0.6077, 0.0041, 2, 0.63, 0.6667, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.varargs:\n variables[self.varargs] = varargs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L294_C12", "label": "assign", "type": "assigned_variable", "loc": [294, 294], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L293_C8", "vector": [14, 3, 0.6087, 0.0021, 3, 0.73, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " variables[self.varargs] = varargs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Expr_L295_C8", "label": "_tracelog_args()", "type": "expression", "loc": [295, 295], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L289_C4", "vector": [8, 2, 0.6108, 0.0021, 2, 0.63, 1.0, 977, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "_tracelog_args", "arg_names": [], "import_names": [], "rhs_call_name": "_tracelog_args", "annotation": ""}, "snippet": " self._tracelog_args(output, variables)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L297_C4", "label": "_split_args_and_varargs", "type": "function", "loc": [297, 300], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L201_C0", "vector": [2, 1, 0.618, 0.0083, 1, 0.11, 0.8462, 462, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "_split_args_and_varargs", "arg_names": ["self", "args"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _split_args_and_varargs(self, args):\n if not self.varargs:\n return args, []\n return args[:len(self.names)], args[len(self.names):]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L298_C8", "label": "if", "type": "if", "loc": [298, 299], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L297_C4", "vector": [4, 2, 0.618, 0.0041, 2, 0.42, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not self.varargs:\n return args, []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Return_L299_C12", "label": "return", "type": "return", "loc": [299, 299], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L298_C8", "vector": [13, 3, 0.619, 0.0021, 3, 0.19, 0.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return args, []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Return_L300_C8", "label": "return", "type": "return", "loc": [300, 300], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L297_C4", "vector": [13, 2, 0.6211, 0.0021, 2, 0.42, 1.0, 0, 0, 0, 0, 0, 0, 8, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return args[:len(self.names)], args[len(self.names):]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L302_C4", "label": "_tracelog_args", "type": "function", "loc": [302, 304], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L201_C0", "vector": [2, 1, 0.6273, 0.0062, 1, 0.11, 0.9231, 977, 0, 3, 0, 0, 0, 0, 2], "semantic": {"name": "_tracelog_args", "arg_names": ["self", "logger", "variables"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _tracelog_args(self, logger, variables):\n arguments_string = self._get_arguments_as_string(variables)\n logger.trace('Arguments: [ %s ]' % arguments_string)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L303_C8", "label": "arguments_string = _get_arguments_as_string()", "type": "assigned_variable", "loc": [303, 303], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L302_C4", "vector": [14, 2, 0.6273, 0.0021, 2, 0.16, 0.0, 688, 3, 1, 0, 0, 168, 10, 1], "semantic": {"name": "arguments_string", "arg_names": [], "import_names": [], "rhs_call_name": "_get_arguments_as_string", "annotation": ""}, "snippet": " arguments_string = self._get_arguments_as_string(variables)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Expr_L304_C8", "label": "trace()", "type": "expression", "loc": [304, 304], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L302_C4", "vector": [8, 2, 0.6294, 0.0021, 2, 0.16, 1.0, 211, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "trace", "arg_names": [], "import_names": [], "rhs_call_name": "trace", "annotation": ""}, "snippet": " logger.trace('Arguments: [ %s ]' % arguments_string)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L306_C4", "label": "_get_arguments_as_string", "type": "function", "loc": [306, 310], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L201_C0", "vector": [2, 1, 0.6377, 0.0104, 1, 0.11, 1.0, 168, 0, 2, 1, 0, 0, 0, 3], "semantic": {"name": "_get_arguments_as_string", "arg_names": ["self", "variables"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _get_arguments_as_string(self, variables):\n args = []\n for name in self.names + ([self.varargs] if self.varargs else []):\n args.append('%s=%s' % (name, utils.safe_repr(variables[name])))\n return ' | '.join(args)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L307_C8", "label": "args =", "type": "assigned_variable", "loc": [307, 307], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L306_C4", "vector": [14, 2, 0.6356, 0.0021, 2, 0.09, 0.0, 805, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "args", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " args = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:For_L308_C8", "label": "for name", "type": "for", "loc": [308, 309], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L306_C4", "vector": [6, 2, 0.6387, 0.0041, 2, 0.09, 0.5, 57, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for name in self.names + ([self.varargs] if self.varargs else []):\n args.append('%s=%s' % (name, utils.safe_repr(variables[name])))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Expr_L309_C12", "label": "append()", "type": "expression", "loc": [309, 309], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:For_L308_C8", "vector": [8, 3, 0.6398, 0.0021, 3, 0.2, 0.0, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " args.append('%s=%s' % (name, utils.safe_repr(variables[name])))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Return_L310_C8", "label": "return", "type": "return", "loc": [310, 310], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L306_C4", "vector": [13, 2, 0.6418, 0.0021, 2, 0.09, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ' | '.join(args)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L313_C0", "label": "_MissingArg", "type": "class", "loc": [313, 315], "level": 0, "parent": null, "vector": [3, 0, 0.6501, 0.0062, 0, 0.66, 0.7143, 516, 0, 1, 0, 0, 186, 0, 0], "semantic": {"name": "_MissingArg", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class _MissingArg(object):\n def __getattr__(self, name):\n raise DataError"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L314_C4", "label": "__getattr__", "type": "function", "loc": [314, 315], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L313_C0", "vector": [2, 1, 0.6511, 0.0041, 1, 0.45, 0.0, 210, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "__getattr__", "arg_names": ["self", "name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __getattr__(self, name):\n raise DataError"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L318_C0", "label": "UserKeywordArgsTemplate", "type": "class", "loc": [318, 331], "level": 0, "parent": null, "vector": [3, 0, 0.6718, 0.029, 0, 0.66, 0.7619, 72, 0, 3, 0, 0, 186, 0, 4], "semantic": {"name": "UserKeywordArgsTemplate", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class UserKeywordArgsTemplate(object):\n\n def __init__(self, minargs, defaults):\n self._template = [_MissingArg() for _ in range(minargs)] + defaults\n self._already_set = set()\n\n def set_value(self, idx, value):\n if idx in self._already_set:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L320_C4", "label": "__init__", "type": "function", "loc": [320, 322], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L318_C0", "vector": [2, 1, 0.6646, 0.0062, 1, 0.33, 0.0, 555, 0, 3, 0, 0, 0, 0, 3], "semantic": {"name": "__init__", "arg_names": ["self", "minargs", "defaults"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, minargs, defaults):\n self._template = [_MissingArg() for _ in range(minargs)] + defaults\n self._already_set = set()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L321_C8", "label": "self._template =", "type": "assigned_variable", "loc": [321, 321], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L320_C4", "vector": [14, 2, 0.6646, 0.0021, 2, 0.47, 0.0, 461, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "self._template", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._template = [_MissingArg() for _ in range(minargs)] + defaults"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L322_C8", "label": "self._already_set = set()", "type": "assigned_variable", "loc": [322, 322], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L320_C4", "vector": [14, 2, 0.6667, 0.0021, 2, 0.47, 1.0, 151, 3, 0, 0, 0, 21, 10, 1], "semantic": {"name": "self._already_set", "arg_names": [], "import_names": [], "rhs_call_name": "set", "annotation": ""}, "snippet": " self._already_set = set()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L324_C4", "label": "set_value", "type": "function", "loc": [324, 328], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L318_C0", "vector": [2, 1, 0.6749, 0.0104, 1, 0.33, 0.5, 493, 0, 3, 0, 0, 0, 0, 1], "semantic": {"name": "set_value", "arg_names": ["self", "idx", "value"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def set_value(self, idx, value):\n if idx in self._already_set:\n raise FrameworkError\n self._already_set.add(idx)\n self._template[idx] = value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L325_C8", "label": "if", "type": "if", "loc": [325, 326], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L324_C4", "vector": [4, 2, 0.6739, 0.0041, 2, 0.02, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if idx in self._already_set:\n raise FrameworkError"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Expr_L327_C8", "label": "add()", "type": "expression", "loc": [327, 327], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L324_C4", "vector": [8, 2, 0.677, 0.0021, 2, 0.02, 0.5, 241, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " self._already_set.add(idx)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L328_C8", "label": "assign", "type": "assigned_variable", "loc": [328, 328], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L324_C4", "vector": [14, 2, 0.6791, 0.0021, 2, 0.02, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._template[idx] = value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L330_C4", "label": "as_list", "type": "function", "loc": [330, 331], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L318_C0", "vector": [2, 1, 0.6843, 0.0041, 1, 0.33, 1.0, 817, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "as_list", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def as_list(self):\n return self._template"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Return_L331_C8", "label": "return", "type": "return", "loc": [331, 331], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L330_C4", "vector": [13, 2, 0.6853, 0.0021, 2, 0.45, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._template"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L334_C0", "label": "_ArgumentResolver", "type": "class", "loc": [334, 405], "level": 0, "parent": null, "vector": [3, 0, 0.765, 0.1491, 0, 0.66, 0.8095, 244, 0, 13, 0, 0, 186, 0, 25], "semantic": {"name": "_ArgumentResolver", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class _ArgumentResolver(object):\n\n def __init__(self, arguments):\n self._arguments = arguments\n self._mand_arg_count = len(arguments.names) - len(arguments.defaults)\n\n def resolve(self, values, output, variables=None):\n positional, named = self._resolve_argument_usage(values, output)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L336_C4", "label": "__init__", "type": "function", "loc": [336, 338], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L334_C0", "vector": [2, 1, 0.6977, 0.0062, 1, 0.48, 0.0, 555, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": ["self", "arguments"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, arguments):\n self._arguments = arguments\n self._mand_arg_count = len(arguments.names) - len(arguments.defaults)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L337_C8", "label": "self._arguments =", "type": "assigned_variable", "loc": [337, 337], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L336_C4", "vector": [14, 2, 0.6977, 0.0021, 2, 0.92, 0.0, 637, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._arguments", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._arguments = arguments"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L338_C8", "label": "self._mand_arg_count =", "type": "assigned_variable", "loc": [338, 338], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L336_C4", "vector": [14, 2, 0.6998, 0.0021, 2, 0.92, 1.0, 812, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "self._mand_arg_count", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._mand_arg_count = len(arguments.names) - len(arguments.defaults)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L340_C4", "label": "resolve", "type": "function", "loc": [340, 342], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L334_C0", "vector": [2, 1, 0.706, 0.0062, 1, 0.48, 0.0833, 675, 0, 4, 1, 0, 0, 0, 2], "semantic": {"name": "resolve", "arg_names": ["self", "values", "output", "variables"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def resolve(self, values, output, variables=None):\n positional, named = self._resolve_argument_usage(values, output)\n return self._resolve_variables(positional, named, variables)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L341_C8", "label": "positional, named = _resolve_argument_usage()", "type": "assigned_variable", "loc": [341, 341], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L340_C4", "vector": [14, 2, 0.706, 0.0021, 2, 0.4, 0.0, 437, 3, 2, 0, 0, 966, 10, 1], "semantic": {"name": "positional, named", "arg_names": [], "import_names": [], "rhs_call_name": "_resolve_argument_usage", "annotation": ""}, "snippet": " positional, named = self._resolve_argument_usage(values, output)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Return_L342_C8", "label": "return", "type": "return", "loc": [342, 342], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L340_C4", "vector": [13, 2, 0.7081, 0.0021, 2, 0.4, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._resolve_variables(positional, named, variables)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L344_C4", "label": "_resolve_argument_usage", "type": "function", "loc": [344, 358], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L334_C0", "vector": [2, 1, 0.7267, 0.0311, 1, 0.48, 0.1667, 966, 0, 3, 1, 0, 0, 0, 5], "semantic": {"name": "_resolve_argument_usage", "arg_names": ["self", "values", "output"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _resolve_argument_usage(self, values, output):\n named = {}\n last_positional = self._get_last_positional_idx(values)\n used_names = self._arguments.names[:last_positional]\n for arg in values[last_positional:]:\n name, value = self._parse_named(arg)\n if name in named:\n raise DataError('Keyword argument %s repeated.' % name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L345_C8", "label": "named =", "type": "assigned_variable", "loc": [345, 345], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L344_C4", "vector": [14, 2, 0.7143, 0.0021, 2, 0.29, 0.0, 188, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "named", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " named = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L346_C8", "label": "last_positional = _get_last_positional_idx()", "type": "assigned_variable", "loc": [346, 346], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L344_C4", "vector": [14, 2, 0.7164, 0.0021, 2, 0.29, 0.25, 580, 3, 1, 0, 0, 812, 10, 1], "semantic": {"name": "last_positional", "arg_names": [], "import_names": [], "rhs_call_name": "_get_last_positional_idx", "annotation": ""}, "snippet": " last_positional = self._get_last_positional_idx(values)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L347_C8", "label": "used_names =", "type": "assigned_variable", "loc": [347, 347], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L344_C4", "vector": [14, 2, 0.7184, 0.0021, 2, 0.29, 0.5, 273, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "used_names", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " used_names = self._arguments.names[:last_positional]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:For_L348_C8", "label": "for arg", "type": "for", "loc": [348, 357], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L344_C4", "vector": [6, 2, 0.7298, 0.0207, 2, 0.29, 0.75, 447, 6, 0, 0, 0, 0, 0, 4], "semantic": {"name": "arg", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for arg in values[last_positional:]:\n name, value = self._parse_named(arg)\n if name in named:\n raise DataError('Keyword argument %s repeated.' % name)\n if name in used_names:\n output.warn(\"Could not resolve named arguments because value \"\n \"for argument '%s' was given twice.\" % name)\n return values, {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L349_C12", "label": "name, value = _parse_named()", "type": "assigned_variable", "loc": [349, 349], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:For_L348_C8", "vector": [14, 3, 0.7226, 0.0021, 3, 0.42, 0.0, 509, 3, 1, 0, 0, 422, 10, 1], "semantic": {"name": "name, value", "arg_names": [], "import_names": [], "rhs_call_name": "_parse_named", "annotation": ""}, "snippet": " name, value = self._parse_named(arg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L350_C12", "label": "if", "type": "if", "loc": [350, 351], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:For_L348_C8", "vector": [4, 3, 0.7257, 0.0041, 3, 0.42, 0.25, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if name in named:\n raise DataError('Keyword argument %s repeated.' % name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L352_C12", "label": "if", "type": "if", "loc": [352, 355], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:For_L348_C8", "vector": [4, 3, 0.7319, 0.0083, 3, 0.42, 0.5, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if name in used_names:\n output.warn(\"Could not resolve named arguments because value \"\n \"for argument '%s' was given twice.\" % name)\n return values, {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Expr_L353_C16", "label": "warn()", "type": "expression", "loc": [353, 354], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L352_C12", "vector": [8, 4, 0.7319, 0.0041, 4, 0.13, 0.0, 960, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "warn", "arg_names": [], "import_names": [], "rhs_call_name": "warn", "annotation": ""}, "snippet": " output.warn(\"Could not resolve named arguments because value \"\n \"for argument '%s' was given twice.\" % name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Return_L355_C16", "label": "return", "type": "return", "loc": [355, 355], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L352_C12", "vector": [13, 4, 0.735, 0.0021, 4, 0.13, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return values, {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Expr_L356_C12", "label": "append()", "type": "expression", "loc": [356, 356], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:For_L348_C8", "vector": [8, 3, 0.7371, 0.0021, 3, 0.42, 0.75, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " used_names.append(name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L357_C12", "label": "assign", "type": "assigned_variable", "loc": [357, 357], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:For_L348_C8", "vector": [14, 3, 0.7391, 0.0021, 3, 0.42, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " named[name] = value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Return_L358_C8", "label": "return", "type": "return", "loc": [358, 358], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L344_C4", "vector": [13, 2, 0.7412, 0.0021, 2, 0.29, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return values[:last_positional], named"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L360_C4", "label": "_get_last_positional_idx", "type": "function", "loc": [360, 367], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L334_C0", "vector": [2, 1, 0.7526, 0.0166, 1, 0.48, 0.25, 812, 0, 2, 1, 0, 0, 0, 3], "semantic": {"name": "_get_last_positional_idx", "arg_names": ["self", "values"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _get_last_positional_idx(self, values):\n last_positional_idx = self._mand_arg_count\n named_allowed = True\n for arg in reversed(self._optional(values)):\n if not (named_allowed and self._is_named(arg)):\n named_allowed = False\n last_positional_idx += 1\n return last_positional_idx"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L361_C8", "label": "last_positional_idx =", "type": "assigned_variable", "loc": [361, 361], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L360_C4", "vector": [14, 2, 0.7474, 0.0021, 2, 0.09, 0.0, 707, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "last_positional_idx", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " last_positional_idx = self._mand_arg_count"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L362_C8", "label": "named_allowed =", "type": "assigned_variable", "loc": [362, 362], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L360_C4", "vector": [14, 2, 0.7495, 0.0021, 2, 0.09, 0.3333, 359, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "named_allowed", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " named_allowed = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:For_L363_C8", "label": "for arg", "type": "for", "loc": [363, 366], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L360_C4", "vector": [6, 2, 0.7547, 0.0083, 2, 0.09, 0.6667, 447, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "arg", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for arg in reversed(self._optional(values)):\n if not (named_allowed and self._is_named(arg)):\n named_allowed = False\n last_positional_idx += 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L364_C12", "label": "if", "type": "if", "loc": [364, 366], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:For_L363_C8", "vector": [4, 3, 0.7557, 0.0062, 3, 0.21, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not (named_allowed and self._is_named(arg)):\n named_allowed = False\n last_positional_idx += 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L365_C16", "label": "named_allowed =", "type": "assigned_variable", "loc": [365, 365], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L364_C12", "vector": [14, 4, 0.7557, 0.0021, 4, 0.49, 0.0, 359, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "named_allowed", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " named_allowed = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Return_L367_C8", "label": "return", "type": "return", "loc": [367, 367], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L360_C4", "vector": [13, 2, 0.7598, 0.0021, 2, 0.09, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return last_positional_idx"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L369_C4", "label": "_optional", "type": "function", "loc": [369, 370], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L334_C0", "vector": [2, 1, 0.765, 0.0041, 1, 0.48, 0.3333, 992, 0, 2, 1, 0, 0, 0, 0], "semantic": {"name": "_optional", "arg_names": ["self", "values"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _optional(self, values):\n return values[self._mand_arg_count:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Return_L370_C8", "label": "return", "type": "return", "loc": [370, 370], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L369_C4", "vector": [13, 2, 0.766, 0.0021, 2, 0.92, 0.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return values[self._mand_arg_count:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L372_C4", "label": "_is_named", "type": "function", "loc": [372, 376], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L334_C0", "vector": [2, 1, 0.7743, 0.0104, 1, 0.48, 0.4167, 760, 0, 2, 1, 0, 0, 0, 3], "semantic": {"name": "_is_named", "arg_names": ["self", "arg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _is_named(self, arg):\n if self._is_str_with_kwarg_sep(arg):\n name, _ = self._split_from_kwarg_sep(arg)\n return self._is_arg_name(name)\n return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L373_C8", "label": "if", "type": "if", "loc": [373, 375], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L372_C4", "vector": [4, 2, 0.7743, 0.0062, 2, 0.74, 0.0, 0, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self._is_str_with_kwarg_sep(arg):\n name, _ = self._split_from_kwarg_sep(arg)\n return self._is_arg_name(name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L374_C12", "label": "name, _ = _split_from_kwarg_sep()", "type": "assigned_variable", "loc": [374, 374], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L373_C8", "vector": [14, 3, 0.7743, 0.0021, 3, 0.52, 0.0, 649, 3, 1, 0, 0, 243, 10, 1], "semantic": {"name": "name, _", "arg_names": [], "import_names": [], "rhs_call_name": "_split_from_kwarg_sep", "annotation": ""}, "snippet": " name, _ = self._split_from_kwarg_sep(arg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Return_L375_C12", "label": "return", "type": "return", "loc": [375, 375], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L373_C8", "vector": [13, 3, 0.7764, 0.0021, 3, 0.52, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._is_arg_name(name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Return_L376_C8", "label": "return", "type": "return", "loc": [376, 376], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L372_C4", "vector": [13, 2, 0.7785, 0.0021, 2, 0.74, 1.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L378_C4", "label": "_parse_named", "type": "function", "loc": [378, 380], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L334_C0", "vector": [2, 1, 0.7847, 0.0062, 1, 0.48, 0.5, 422, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "_parse_named", "arg_names": ["self", "arg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _parse_named(self, arg):\n name, value = self._split_from_kwarg_sep(arg)\n return self._coerce(name), value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L379_C8", "label": "name, value = _split_from_kwarg_sep()", "type": "assigned_variable", "loc": [379, 379], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L378_C4", "vector": [14, 2, 0.7847, 0.0021, 2, 0.64, 0.0, 509, 3, 1, 0, 0, 243, 10, 1], "semantic": {"name": "name, value", "arg_names": [], "import_names": [], "rhs_call_name": "_split_from_kwarg_sep", "annotation": ""}, "snippet": " name, value = self._split_from_kwarg_sep(arg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Return_L380_C8", "label": "return", "type": "return", "loc": [380, 380], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L378_C4", "vector": [13, 2, 0.7867, 0.0021, 2, 0.64, 1.0, 0, 0, 0, 0, 0, 0, 8, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._coerce(name), value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L382_C4", "label": "_is_str_with_kwarg_sep", "type": "function", "loc": [382, 387], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L334_C0", "vector": [2, 1, 0.7961, 0.0124, 1, 0.48, 0.5833, 835, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "_is_str_with_kwarg_sep", "arg_names": ["self", "arg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _is_str_with_kwarg_sep(self, arg):\n if not isinstance(arg, basestring):\n return False\n if '=' not in arg:\n return False\n return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L383_C8", "label": "if", "type": "if", "loc": [383, 384], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L382_C4", "vector": [4, 2, 0.794, 0.0041, 2, 0.69, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not isinstance(arg, basestring):\n return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Return_L384_C12", "label": "return", "type": "return", "loc": [384, 384], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L383_C8", "vector": [13, 3, 0.795, 0.0021, 3, 0.13, 0.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L385_C8", "label": "if", "type": "if", "loc": [385, 386], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L382_C4", "vector": [4, 2, 0.7981, 0.0041, 2, 0.69, 0.5, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if '=' not in arg:\n return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Return_L386_C12", "label": "return", "type": "return", "loc": [386, 386], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L385_C8", "vector": [13, 3, 0.7992, 0.0021, 3, 0.35, 0.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Return_L387_C8", "label": "return", "type": "return", "loc": [387, 387], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L382_C4", "vector": [13, 2, 0.8012, 0.0021, 2, 0.69, 1.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L389_C4", "label": "_split_from_kwarg_sep", "type": "function", "loc": [389, 390], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L334_C0", "vector": [2, 1, 0.8064, 0.0041, 1, 0.48, 0.6667, 243, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "_split_from_kwarg_sep", "arg_names": ["self", "arg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _split_from_kwarg_sep(self, arg):\n return arg.split('=', 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Return_L390_C8", "label": "return", "type": "return", "loc": [390, 390], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L389_C4", "vector": [13, 2, 0.8075, 0.0021, 2, 0.57, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return arg.split('=', 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L392_C4", "label": "_is_arg_name", "type": "function", "loc": [392, 393], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L334_C0", "vector": [2, 1, 0.8126, 0.0041, 1, 0.48, 0.75, 35, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "_is_arg_name", "arg_names": ["self", "name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _is_arg_name(self, name):\n return self._arg_name(name) in self._arguments.names"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Return_L393_C8", "label": "return", "type": "return", "loc": [393, 393], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L392_C4", "vector": [13, 2, 0.8137, 0.0021, 2, 0.7, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._arg_name(name) in self._arguments.names"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L395_C4", "label": "_resolve_variables", "type": "function", "loc": [395, 399], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L334_C0", "vector": [2, 1, 0.8219, 0.0104, 1, 0.48, 0.8333, 591, 0, 4, 1, 0, 0, 0, 3], "semantic": {"name": "_resolve_variables", "arg_names": ["self", "posargs", "kwargs", "variables"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _resolve_variables(self, posargs, kwargs, variables):\n posargs = self._replace_list(posargs, variables)\n for name, value in kwargs.items():\n kwargs[name] = self._replace_scalar(value, variables)\n return posargs, kwargs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L396_C8", "label": "posargs = _replace_list()", "type": "assigned_variable", "loc": [396, 396], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L395_C4", "vector": [14, 2, 0.8199, 0.0021, 2, 0.95, 0.0, 225, 3, 2, 0, 0, 19, 10, 1], "semantic": {"name": "posargs", "arg_names": [], "import_names": [], "rhs_call_name": "_replace_list", "annotation": ""}, "snippet": " posargs = self._replace_list(posargs, variables)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:For_L397_C8", "label": "for name, value", "type": "for", "loc": [397, 398], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L395_C4", "vector": [6, 2, 0.823, 0.0041, 2, 0.95, 0.5, 509, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "name, value", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for name, value in kwargs.items():\n kwargs[name] = self._replace_scalar(value, variables)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L398_C12", "label": " = _replace_scalar()", "type": "assigned_variable", "loc": [398, 398], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:For_L397_C8", "vector": [14, 3, 0.824, 0.0021, 3, 0.06, 0.0, 0, 3, 2, 0, 0, 834, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "_replace_scalar", "annotation": ""}, "snippet": " kwargs[name] = self._replace_scalar(value, variables)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Return_L399_C8", "label": "return", "type": "return", "loc": [399, 399], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L395_C4", "vector": [13, 2, 0.8261, 0.0021, 2, 0.95, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return posargs, kwargs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L401_C4", "label": "_replace_list", "type": "function", "loc": [401, 402], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L334_C0", "vector": [2, 1, 0.8313, 0.0041, 1, 0.48, 0.9167, 19, 0, 3, 1, 0, 0, 0, 1], "semantic": {"name": "_replace_list", "arg_names": ["self", "values", "variables"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _replace_list(self, values, variables):\n return variables.replace_list(values) if variables else values"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Return_L402_C8", "label": "return", "type": "return", "loc": [402, 402], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L401_C4", "vector": [13, 2, 0.8323, 0.0021, 2, 0.03, 0.0, 0, 8, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return variables.replace_list(values) if variables else values"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L404_C4", "label": "_replace_scalar", "type": "function", "loc": [404, 405], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L334_C0", "vector": [2, 1, 0.8375, 0.0041, 1, 0.48, 1.0, 834, 0, 3, 1, 0, 0, 0, 1], "semantic": {"name": "_replace_scalar", "arg_names": ["self", "value", "variables"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _replace_scalar(self, value, variables):\n return variables.replace_scalar(value) if variables else value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Return_L405_C8", "label": "return", "type": "return", "loc": [405, 405], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L404_C4", "vector": [13, 2, 0.8385, 0.0021, 2, 0.36, 0.0, 0, 8, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return variables.replace_scalar(value) if variables else value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L408_C0", "label": "UserKeywordArgumentResolver", "type": "class", "loc": [408, 414], "level": 0, "parent": null, "vector": [3, 0, 0.8509, 0.0145, 0, 0.66, 0.8571, 49, 0, 2, 0, 0, 244, 0, 0], "semantic": {"name": "UserKeywordArgumentResolver", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class UserKeywordArgumentResolver(_ArgumentResolver):\n\n def _arg_name(self, name):\n return '${%s}' % name\n\n def _coerce(self, name):\n return '${%s}' % name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L410_C4", "label": "_arg_name", "type": "function", "loc": [410, 411], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L408_C0", "vector": [2, 1, 0.8499, 0.0041, 1, 0.63, 0.0, 878, 0, 2, 1, 0, 0, 0, 0], "semantic": {"name": "_arg_name", "arg_names": ["self", "name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _arg_name(self, name):\n return '${%s}' % name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Return_L411_C8", "label": "return", "type": "return", "loc": [411, 411], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L410_C4", "vector": [13, 2, 0.8509, 0.0021, 2, 0.39, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return '${%s}' % name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L413_C4", "label": "_coerce", "type": "function", "loc": [413, 414], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L408_C0", "vector": [2, 1, 0.8561, 0.0041, 1, 0.63, 1.0, 110, 0, 2, 1, 0, 0, 0, 0], "semantic": {"name": "_coerce", "arg_names": ["self", "name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _coerce(self, name):\n return '${%s}' % name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Return_L414_C8", "label": "return", "type": "return", "loc": [414, 414], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L413_C4", "vector": [13, 2, 0.8571, 0.0021, 2, 0.21, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return '${%s}' % name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L417_C0", "label": "PythonKeywordArgumentResolver", "type": "class", "loc": [417, 423], "level": 0, "parent": null, "vector": [3, 0, 0.8696, 0.0145, 0, 0.66, 0.9048, 896, 0, 2, 0, 0, 244, 0, 1], "semantic": {"name": "PythonKeywordArgumentResolver", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class PythonKeywordArgumentResolver(_ArgumentResolver):\n\n def _arg_name(self, name):\n return name\n\n def _coerce(self, name):\n return str(name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L419_C4", "label": "_arg_name", "type": "function", "loc": [419, 420], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L417_C0", "vector": [2, 1, 0.8685, 0.0041, 1, 0.79, 0.0, 878, 0, 2, 1, 0, 0, 0, 0], "semantic": {"name": "_arg_name", "arg_names": ["self", "name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _arg_name(self, name):\n return name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Return_L420_C8", "label": "return", "type": "return", "loc": [420, 420], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L419_C4", "vector": [13, 2, 0.8696, 0.0021, 2, 0.85, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L422_C4", "label": "_coerce", "type": "function", "loc": [422, 423], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L417_C0", "vector": [2, 1, 0.8747, 0.0041, 1, 0.79, 1.0, 110, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "_coerce", "arg_names": ["self", "name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _coerce(self, name):\n return str(name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Return_L423_C8", "label": "return", "type": "return", "loc": [423, 423], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L422_C4", "vector": [13, 2, 0.8758, 0.0021, 2, 0.79, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return str(name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L426_C0", "label": "JavaKeywordArgumentResolver", "type": "class", "loc": [426, 444], "level": 0, "parent": null, "vector": [3, 0, 0.9006, 0.0393, 0, 0.66, 0.9524, 63, 0, 4, 0, 0, 186, 0, 7], "semantic": {"name": "JavaKeywordArgumentResolver", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class JavaKeywordArgumentResolver(object):\n\n def __init__(self, arguments):\n self._arguments = arguments\n self._minargs, self._maxargs = arguments.minargs, arguments.maxargs\n\n def resolve(self, values, output, variables):\n values = variables.replace_list(values)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L428_C4", "label": "__init__", "type": "function", "loc": [428, 430], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L426_C0", "vector": [2, 1, 0.8882, 0.0062, 1, 0.1, 0.0, 555, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "arguments"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, arguments):\n self._arguments = arguments\n self._minargs, self._maxargs = arguments.minargs, arguments.maxargs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L429_C8", "label": "self._arguments =", "type": "assigned_variable", "loc": [429, 429], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L428_C4", "vector": [14, 2, 0.8882, 0.0021, 2, 0.07, 0.0, 637, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._arguments", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._arguments = arguments"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L430_C8", "label": "assign", "type": "assigned_variable", "loc": [430, 430], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L428_C4", "vector": [14, 2, 0.8903, 0.0021, 2, 0.07, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._minargs, self._maxargs = arguments.minargs, arguments.maxargs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L432_C4", "label": "resolve", "type": "function", "loc": [432, 437], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L426_C0", "vector": [2, 1, 0.8996, 0.0124, 1, 0.1, 0.3333, 675, 0, 4, 1, 0, 0, 0, 5], "semantic": {"name": "resolve", "arg_names": ["self", "values", "output", "variables"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def resolve(self, values, output, variables):\n values = variables.replace_list(values)\n self._arguments.check_arg_limits(values)\n if self._expects_varargs() and self._last_is_not_list(values):\n values[self._minargs:] = [values[self._minargs:]]\n return self._arguments.arg_coercer(values), {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L433_C8", "label": "values = replace_list()", "type": "assigned_variable", "loc": [433, 433], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L432_C4", "vector": [14, 2, 0.8965, 0.0021, 2, 0.97, 0.0, 721, 3, 1, 0, 0, 919, 10, 1], "semantic": {"name": "values", "arg_names": [], "import_names": [], "rhs_call_name": "replace_list", "annotation": ""}, "snippet": " values = variables.replace_list(values)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Expr_L434_C8", "label": "check_arg_limits()", "type": "expression", "loc": [434, 434], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L432_C4", "vector": [8, 2, 0.8986, 0.0021, 2, 0.97, 0.3333, 324, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "check_arg_limits", "arg_names": [], "import_names": [], "rhs_call_name": "check_arg_limits", "annotation": ""}, "snippet": " self._arguments.check_arg_limits(values)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L435_C8", "label": "if", "type": "if", "loc": [435, 436], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L432_C4", "vector": [4, 2, 0.9017, 0.0041, 2, 0.97, 0.6667, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self._expects_varargs() and self._last_is_not_list(values):\n values[self._minargs:] = [values[self._minargs:]]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L436_C12", "label": "assign", "type": "assigned_variable", "loc": [436, 436], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L435_C8", "vector": [14, 3, 0.9027, 0.0021, 3, 0.96, 0.0, 0, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " values[self._minargs:] = [values[self._minargs:]]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Return_L437_C8", "label": "return", "type": "return", "loc": [437, 437], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L432_C4", "vector": [13, 2, 0.9048, 0.0021, 2, 0.97, 1.0, 0, 0, 0, 0, 0, 0, 8, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._arguments.arg_coercer(values), {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L439_C4", "label": "_expects_varargs", "type": "function", "loc": [439, 440], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L426_C0", "vector": [2, 1, 0.9099, 0.0041, 1, 0.1, 0.6667, 935, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "_expects_varargs", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _expects_varargs(self):\n return self._maxargs == sys.maxint"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Return_L440_C8", "label": "return", "type": "return", "loc": [440, 440], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L439_C4", "vector": [13, 2, 0.911, 0.0021, 2, 0.23, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._maxargs == sys.maxint"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L442_C4", "label": "_last_is_not_list", "type": "function", "loc": [442, 444], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L426_C0", "vector": [2, 1, 0.9172, 0.0062, 1, 0.1, 1.0, 690, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "_last_is_not_list", "arg_names": ["self", "args"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _last_is_not_list(self, args):\n return not (len(args) == self._minargs + 1\n and isinstance(args[-1], (list, tuple, ArrayType)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Return_L443_C8", "label": "return", "type": "return", "loc": [443, 444], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L442_C4", "vector": [13, 2, 0.9182, 0.0041, 2, 0.97, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return not (len(args) == self._minargs + 1\n and isinstance(args[-1], (list, tuple, ArrayType)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L447_C0", "label": "_ArgLimitChecker", "type": "class", "loc": [447, 483], "level": 0, "parent": null, "vector": [3, 0, 0.9627, 0.0766, 0, 0.66, 1.0, 456, 0, 6, 0, 0, 186, 0, 12], "semantic": {"name": "_ArgLimitChecker", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class _ArgLimitChecker(object):\n\n def __init__(self, minargs, maxargs, name, type_):\n self.minargs = minargs\n self.maxargs = maxargs\n self._name = name\n self._type = type_\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L449_C4", "label": "__init__", "type": "function", "loc": [449, 453], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L447_C0", "vector": [2, 1, 0.9337, 0.0104, 1, 0.12, 0.0, 555, 0, 5, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "minargs", "maxargs", "name", "type_"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, minargs, maxargs, name, type_):\n self.minargs = minargs\n self.maxargs = maxargs\n self._name = name\n self._type = type_"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L450_C8", "label": "self.minargs =", "type": "assigned_variable", "loc": [450, 450], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L449_C4", "vector": [14, 2, 0.9317, 0.0021, 2, 0.98, 0.0, 421, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.minargs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.minargs = minargs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L451_C8", "label": "self.maxargs =", "type": "assigned_variable", "loc": [451, 451], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L449_C4", "vector": [14, 2, 0.9337, 0.0021, 2, 0.98, 0.3333, 289, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.maxargs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.maxargs = maxargs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L452_C8", "label": "self._name =", "type": "assigned_variable", "loc": [452, 452], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L449_C4", "vector": [14, 2, 0.9358, 0.0021, 2, 0.98, 0.6667, 257, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._name = name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L453_C8", "label": "self._type =", "type": "assigned_variable", "loc": [453, 453], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L449_C4", "vector": [14, 2, 0.9379, 0.0021, 2, 0.98, 1.0, 313, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._type", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._type = type_"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L455_C4", "label": "check_arg_limits", "type": "function", "loc": [455, 456], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L447_C0", "vector": [2, 1, 0.9431, 0.0041, 1, 0.12, 0.2, 324, 0, 3, 0, 0, 0, 0, 3], "semantic": {"name": "check_arg_limits", "arg_names": ["self", "args", "namedargs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def check_arg_limits(self, args, namedargs={}):\n self._check_arg_limits(len(args) + len(namedargs))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Expr_L456_C8", "label": "_check_arg_limits()", "type": "expression", "loc": [456, 456], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L455_C4", "vector": [8, 2, 0.9441, 0.0021, 2, 0.58, 0.0, 906, 3, 1, 0, 0, 0, 0, 3], "semantic": {"name": "_check_arg_limits", "arg_names": [], "import_names": [], "rhs_call_name": "_check_arg_limits", "annotation": ""}, "snippet": " self._check_arg_limits(len(args) + len(namedargs))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L458_C4", "label": "check_arg_limits_for_dry_run", "type": "function", "loc": [458, 463], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L447_C0", "vector": [2, 1, 0.9534, 0.0124, 1, 0.12, 0.4, 100, 0, 2, 0, 0, 0, 0, 4], "semantic": {"name": "check_arg_limits_for_dry_run", "arg_names": ["self", "args"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def check_arg_limits_for_dry_run(self, args):\n arg_count = len(args)\n scalar_arg_count = len([a for a in args if not is_list_var(a)])\n if scalar_arg_count <= self.minargs and arg_count - scalar_arg_count:\n arg_count = self.minargs\n self._check_arg_limits(arg_count)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L459_C8", "label": "arg_count = len()", "type": "assigned_variable", "loc": [459, 459], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L458_C4", "vector": [14, 2, 0.9503, 0.0021, 2, 0.28, 0.0, 223, 3, 1, 0, 0, 890, 10, 1], "semantic": {"name": "arg_count", "arg_names": [], "import_names": [], "rhs_call_name": "len", "annotation": ""}, "snippet": " arg_count = len(args)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L460_C8", "label": "scalar_arg_count = len()", "type": "assigned_variable", "loc": [460, 460], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L458_C4", "vector": [14, 2, 0.9524, 0.0021, 2, 0.28, 0.3333, 224, 3, 1, 0, 0, 890, 10, 2], "semantic": {"name": "scalar_arg_count", "arg_names": [], "import_names": [], "rhs_call_name": "len", "annotation": ""}, "snippet": " scalar_arg_count = len([a for a in args if not is_list_var(a)])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L461_C8", "label": "if", "type": "if", "loc": [461, 462], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L458_C4", "vector": [4, 2, 0.9555, 0.0041, 2, 0.28, 0.6667, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if scalar_arg_count <= self.minargs and arg_count - scalar_arg_count:\n arg_count = self.minargs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L462_C12", "label": "arg_count =", "type": "assigned_variable", "loc": [462, 462], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L461_C8", "vector": [14, 3, 0.9565, 0.0021, 3, 0.02, 0.0, 223, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "arg_count", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " arg_count = self.minargs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Expr_L463_C8", "label": "_check_arg_limits()", "type": "expression", "loc": [463, 463], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L458_C4", "vector": [8, 2, 0.9586, 0.0021, 2, 0.28, 1.0, 906, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_check_arg_limits", "arg_names": [], "import_names": [], "rhs_call_name": "_check_arg_limits", "annotation": ""}, "snippet": " self._check_arg_limits(arg_count)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L465_C4", "label": "_check_arg_limits", "type": "function", "loc": [465, 467], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L447_C0", "vector": [2, 1, 0.9648, 0.0062, 1, 0.12, 0.6, 906, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "_check_arg_limits", "arg_names": ["self", "arg_count"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _check_arg_limits(self, arg_count):\n if not self.minargs <= arg_count <= self.maxargs:\n self._raise_inv_args(arg_count)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L466_C8", "label": "if", "type": "if", "loc": [466, 467], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L465_C4", "vector": [4, 2, 0.9658, 0.0041, 2, 0.91, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not self.minargs <= arg_count <= self.maxargs:\n self._raise_inv_args(arg_count)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Expr_L467_C12", "label": "_raise_inv_args()", "type": "expression", "loc": [467, 467], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L466_C8", "vector": [8, 3, 0.9669, 0.0021, 3, 0.89, 0.0, 547, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_raise_inv_args", "arg_names": [], "import_names": [], "rhs_call_name": "_raise_inv_args", "annotation": ""}, "snippet": " self._raise_inv_args(arg_count)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L469_C4", "label": "check_missing_args", "type": "function", "loc": [469, 472], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L447_C0", "vector": [2, 1, 0.9741, 0.0083, 1, 0.12, 0.8, 32, 0, 3, 0, 0, 0, 0, 2], "semantic": {"name": "check_missing_args", "arg_names": ["self", "args", "arg_count"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def check_missing_args(self, args, arg_count):\n for a in args:\n if isinstance(a, _MissingArg):\n self._raise_inv_args(arg_count)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:For_L470_C8", "label": "for a", "type": "for", "loc": [470, 472], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L469_C4", "vector": [6, 2, 0.9752, 0.0062, 2, 0.43, 0.0, 475, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "a", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for a in args:\n if isinstance(a, _MissingArg):\n self._raise_inv_args(arg_count)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L471_C12", "label": "if", "type": "if", "loc": [471, 472], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:For_L470_C8", "vector": [4, 3, 0.9762, 0.0041, 3, 0.6, 0.0, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if isinstance(a, _MissingArg):\n self._raise_inv_args(arg_count)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Expr_L472_C16", "label": "_raise_inv_args()", "type": "expression", "loc": [472, 472], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L471_C12", "vector": [8, 4, 0.9772, 0.0021, 4, 0.36, 0.0, 547, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_raise_inv_args", "arg_names": [], "import_names": [], "rhs_call_name": "_raise_inv_args", "annotation": ""}, "snippet": " self._raise_inv_args(arg_count)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L474_C4", "label": "_raise_inv_args", "type": "function", "loc": [474, 483], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L447_C0", "vector": [2, 1, 0.9907, 0.0207, 1, 0.12, 1.0, 547, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "_raise_inv_args", "arg_names": ["self", "arg_count"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _raise_inv_args(self, arg_count):\n minend = utils.plural_or_not(self.minargs)\n if self.minargs == self.maxargs:\n exptxt = \"%d argument%s\" % (self.minargs, minend)\n elif self.maxargs != sys.maxint:\n exptxt = \"%d to %d arguments\" % (self.minargs, self.maxargs)\n else:\n exptxt = \"at least %d argument%s\" % (self.minargs, minend)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L475_C8", "label": "minend = plural_or_not()", "type": "assigned_variable", "loc": [475, 475], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L474_C4", "vector": [14, 2, 0.9834, 0.0021, 2, 0.13, 0.0, 320, 3, 1, 0, 0, 673, 10, 1], "semantic": {"name": "minend", "arg_names": [], "import_names": [], "rhs_call_name": "plural_or_not", "annotation": ""}, "snippet": " minend = utils.plural_or_not(self.minargs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L476_C8", "label": "if", "type": "if", "loc": [476, 481], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L474_C4", "vector": [4, 2, 0.9907, 0.0124, 2, 0.13, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.minargs == self.maxargs:\n exptxt = \"%d argument%s\" % (self.minargs, minend)\n elif self.maxargs != sys.maxint:\n exptxt = \"%d to %d arguments\" % (self.minargs, self.maxargs)\n else:\n exptxt = \"at least %d argument%s\" % (self.minargs, minend)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L477_C12", "label": "exptxt =", "type": "assigned_variable", "loc": [477, 477], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L476_C8", "vector": [14, 3, 0.9876, 0.0021, 3, 0.15, 0.0, 58, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "exptxt", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " exptxt = \"%d argument%s\" % (self.minargs, minend)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L478_C8", "label": "if", "type": "if", "loc": [478, 481], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L476_C8", "vector": [4, 3, 0.9928, 0.0083, 3, 0.15, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif self.maxargs != sys.maxint:\n exptxt = \"%d to %d arguments\" % (self.minargs, self.maxargs)\n else:\n exptxt = \"at least %d argument%s\" % (self.minargs, minend)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L479_C12", "label": "exptxt =", "type": "assigned_variable", "loc": [479, 479], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L478_C8", "vector": [14, 4, 0.9917, 0.0021, 4, 0.07, 0.0, 58, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "exptxt", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " exptxt = \"%d to %d arguments\" % (self.minargs, self.maxargs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L481_C12", "label": "exptxt =", "type": "assigned_variable", "loc": [481, 481], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L478_C8", "vector": [14, 4, 0.9959, 0.0021, 4, 0.07, 1.0, 58, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "exptxt", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " exptxt = \"at least %d argument%s\" % (self.minargs, minend)"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:ImportFrom_L24_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L28_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L30_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L30_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L31_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L30_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L33_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L36_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L36_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L37_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L36_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L38_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L36_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L39_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L36_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Return_L40_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L42_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L43_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Expr_L44_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Expr_L45_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Return_L46_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L48_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L48_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Return_L49_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L51_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L51_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Expr_L52_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L54_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Expr_L55_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L57_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L57_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L58_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L58_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Return_L59_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L57_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L60_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L57_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Expr_L63_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L65_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L65_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Return_L66_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L69_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L71_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L71_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Return_L72_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L69_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L74_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L74_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Expr_L75_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L74_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L81_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L74_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L82_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L82_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L83_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L74_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L84_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L74_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Return_L85_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L88_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L90_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L90_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Expr_L91_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L90_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L92_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L88_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L94_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L94_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Return_L95_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L88_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L97_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L97_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L98_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L97_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L99_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L97_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Return_L100_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L88_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L102_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L102_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L103_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L102_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Return_L104_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L88_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L106_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L106_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Try_L107_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:Try_L107_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Return_L108_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:Try_L107_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Return_L110_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L88_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L112_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L112_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L113_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L113_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Return_L114_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L113_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Return_L116_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L88_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L118_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L118_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L119_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L118_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L120_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L120_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L121_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L120_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L122_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L120_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L124_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L118_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Return_L125_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L88_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L127_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L127_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L128_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L127_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:For_L129_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:For_L129_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L130_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:For_L129_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L131_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L131_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L132_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:For_L129_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L133_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L133_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L134_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L127_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Return_L135_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L138_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L140_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L140_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Return_L141_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L138_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L143_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L143_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L144_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L144_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Return_L145_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L143_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Try_L146_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:Try_L146_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L147_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:Try_L146_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Return_L149_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L138_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L153_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L153_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L154_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L154_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Return_L155_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L153_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L156_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L153_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L157_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L153_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L158_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L153_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:For_L159_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:For_L159_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L160_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:For_L159_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L162_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L162_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L163_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:For_L159_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L165_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L165_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L166_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L165_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Expr_L167_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L165_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Expr_L168_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:For_L159_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L170_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:For_L159_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Expr_L172_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L153_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Return_L173_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L176_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L178_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L178_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Expr_L179_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L178_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L180_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L176_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L182_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L182_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L183_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L182_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Return_L184_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L187_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L188_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L191_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L192_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L191_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L194_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L194_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L195_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L195_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L196_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L194_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Expr_L197_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L194_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Return_L198_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L201_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L203_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L203_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L204_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L203_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L205_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L203_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L206_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L203_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L207_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L201_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L210_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L210_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Expr_L211_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L210_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L223_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L210_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L224_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L210_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L225_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L210_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:For_L226_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:For_L226_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L227_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:For_L226_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L229_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L229_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L230_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:For_L226_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L232_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:For_L226_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L233_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:For_L226_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L235_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:For_L226_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Expr_L237_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:For_L226_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L238_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L238_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Expr_L239_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L210_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Return_L240_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L201_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L242_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L242_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L243_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L243_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Return_L244_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L242_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Return_L245_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L201_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L247_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L247_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Expr_L248_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L247_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L249_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L247_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L250_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L247_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L251_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L251_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Return_L252_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L247_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Return_L253_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L201_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L255_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L255_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Return_L256_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L201_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L258_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L258_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L259_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L258_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Expr_L260_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L258_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L261_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L258_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Expr_L263_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L258_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Return_L264_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L201_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L266_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L266_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L267_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L266_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L268_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L266_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L269_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L266_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Return_L270_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L201_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L272_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L272_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L273_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L272_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:For_L274_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:For_L274_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Expr_L275_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L272_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:For_L276_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:For_L276_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Expr_L277_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L272_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Return_L278_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L201_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L280_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L280_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L281_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L280_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Return_L282_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L201_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L284_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L284_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:For_L285_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:For_L285_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L286_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L284_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Return_L287_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L201_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L289_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L289_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L290_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L289_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:For_L291_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:For_L291_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L292_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L289_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L293_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L293_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L294_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L289_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Expr_L295_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L201_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L297_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L297_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L298_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L298_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Return_L299_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L297_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Return_L300_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L201_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L302_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L302_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L303_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L302_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Expr_L304_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L201_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L306_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L306_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L307_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L306_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:For_L308_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:For_L308_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Expr_L309_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L306_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Return_L310_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L313_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L314_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L318_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L320_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L320_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L321_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L320_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L322_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L318_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L324_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L324_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L325_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L324_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Expr_L327_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L324_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L328_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L318_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L330_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L330_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Return_L331_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L334_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L336_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L336_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L337_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L336_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L338_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L334_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L340_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L340_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L341_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L340_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Return_L342_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L334_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L344_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L344_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L345_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L344_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L346_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L344_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L347_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L344_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:For_L348_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:For_L348_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L349_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:For_L348_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L350_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:For_L348_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L352_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L352_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Expr_L353_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L352_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Return_L355_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:For_L348_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Expr_L356_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:For_L348_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L357_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L344_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Return_L358_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L334_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L360_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L360_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L361_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L360_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L362_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L360_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:For_L363_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:For_L363_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L364_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L364_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L365_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L360_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Return_L367_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L334_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L369_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L369_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Return_L370_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L334_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L372_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L372_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L373_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L373_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L374_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L373_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Return_L375_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L372_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Return_L376_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L334_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L378_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L378_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L379_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L378_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Return_L380_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L334_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L382_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L382_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L383_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L383_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Return_L384_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L382_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L385_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L385_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Return_L386_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L382_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Return_L387_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L334_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L389_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L389_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Return_L390_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L334_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L392_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L392_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Return_L393_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L334_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L395_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L395_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L396_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L395_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:For_L397_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:For_L397_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L398_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L395_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Return_L399_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L334_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L401_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L401_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Return_L402_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L334_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L404_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L404_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Return_L405_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L408_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L410_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L410_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Return_L411_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L408_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L413_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L413_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Return_L414_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L417_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L419_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L419_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Return_L420_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L417_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L422_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L422_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Return_L423_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L426_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L428_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L428_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L429_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L428_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L430_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L426_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L432_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L432_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L433_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L432_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Expr_L434_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L432_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L435_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L435_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L436_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L432_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Return_L437_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L426_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L439_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L439_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Return_L440_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L426_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L442_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L442_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Return_L443_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L447_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L449_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L449_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L450_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L449_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L451_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L449_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L452_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L449_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L453_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L447_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L455_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L455_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Expr_L456_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L447_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L458_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L458_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L459_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L458_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L460_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L458_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L461_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L461_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L462_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L458_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Expr_L463_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L447_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L465_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L465_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L466_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L466_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Expr_L467_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L447_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L469_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L469_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:For_L470_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:For_L470_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L471_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L471_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Expr_L472_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:ClassDef_L447_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L474_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L474_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L475_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:FunctionDef_L474_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L476_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L476_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L477_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L476_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L478_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L478_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L479_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99815:If_L478_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99815:Assign_L481_C12"}] |
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import inspect
from robot import utils
class _RunKeywordRegister:
def __init__(self):
self._libs = {}
def register_run_keyword(self, libname, keyword, args_to_process=None):
if args_to_process is None:
args_to_process = self._get_args_from_method(keyword)
keyword = keyword.__name__
if libname not in self._libs:
self._libs[libname] = utils.NormalizedDict(ignore=['_'])
self._libs[libname][keyword] = int(args_to_process)
def get_args_to_process(self, libname, kwname):
if libname in self._libs and kwname in self._libs[libname]:
return self._libs[libname][kwname]
return -1
def is_run_keyword(self, libname, kwname):
return self.get_args_to_process(libname, kwname) >= 0
def _get_args_from_method(self, method):
if inspect.ismethod(method):
return method.im_func.func_code.co_argcount -1
elif inspect.isfunction(method):
return method.func_code.co_argcount
raise ValueError("Needs function or method!")
RUN_KW_REGISTER = _RunKeywordRegister()
| ajibawa-2023/Python-Code-Large/train/row_99816 | 24 | 50 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99816:Import_L16_C0", "label": "inspect import inspect", "type": "import", "loc": [16, 16], "level": 0, "parent": null, "vector": [1, 0, 0.32, 0.02, 0, 0.66, 0.0, 878, 0, 1, 0, 0, 878, 0, 0], "semantic": {"name": "inspect", "arg_names": [], "import_names": ["inspect"], "rhs_call_name": "", "annotation": ""}, "snippet": "import inspect"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99816:ImportFrom_L18_C0", "label": "from robot import utils", "type": "import", "loc": [18, 18], "level": 0, "parent": null, "vector": [1, 0, 0.36, 0.02, 0, 0.66, 0.3333, 735, 0, 1, 0, 0, 735, 0, 0], "semantic": {"name": "robot", "arg_names": [], "import_names": ["utils"], "rhs_call_name": "", "annotation": ""}, "snippet": "from robot import utils"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99816:ClassDef_L21_C0", "label": "_RunKeywordRegister", "type": "class", "loc": [21, 47], "level": 0, "parent": null, "vector": [3, 0, 0.68, 0.54, 0, 0.66, 0.6667, 153, 0, 5, 0, 0, 0, 0, 7], "semantic": {"name": "_RunKeywordRegister", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class _RunKeywordRegister:\n\n def __init__(self):\n self._libs = {}\n\n def register_run_keyword(self, libname, keyword, args_to_process=None):\n if args_to_process is None:\n args_to_process = self._get_args_from_method(keyword)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99816:FunctionDef_L23_C4", "label": "__init__", "type": "function", "loc": [23, 24], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99816:ClassDef_L21_C0", "vector": [2, 1, 0.47, 0.04, 1, 0.48, 0.0, 555, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self):\n self._libs = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99816:Assign_L24_C8", "label": "self._libs =", "type": "assigned_variable", "loc": [24, 24], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99816:FunctionDef_L23_C4", "vector": [14, 2, 0.48, 0.02, 2, 0.42, 0.0, 750, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "self._libs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._libs = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99816:FunctionDef_L26_C4", "label": "register_run_keyword", "type": "function", "loc": [26, 32], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99816:ClassDef_L21_C0", "vector": [2, 1, 0.58, 0.14, 1, 0.48, 0.25, 962, 0, 4, 0, 0, 0, 0, 3], "semantic": {"name": "register_run_keyword", "arg_names": ["self", "libname", "keyword", "args_to_process"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def register_run_keyword(self, libname, keyword, args_to_process=None):\n if args_to_process is None:\n args_to_process = self._get_args_from_method(keyword)\n keyword = keyword.__name__\n if libname not in self._libs:\n self._libs[libname] = utils.NormalizedDict(ignore=['_'])\n self._libs[libname][keyword] = int(args_to_process)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99816:If_L27_C8", "label": "if", "type": "if", "loc": [27, 29], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99816:FunctionDef_L26_C4", "vector": [4, 2, 0.56, 0.06, 2, 0.0, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if args_to_process is None:\n args_to_process = self._get_args_from_method(keyword)\n keyword = keyword.__name__"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99816:Assign_L28_C12", "label": "args_to_process = _get_args_from_method()", "type": "assigned_variable", "loc": [28, 28], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99816:If_L27_C8", "vector": [14, 3, 0.56, 0.02, 3, 0.98, 0.0, 465, 3, 1, 0, 0, 464, 10, 1], "semantic": {"name": "args_to_process", "arg_names": [], "import_names": [], "rhs_call_name": "_get_args_from_method", "annotation": ""}, "snippet": " args_to_process = self._get_args_from_method(keyword)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99816:Assign_L29_C12", "label": "keyword =", "type": "assigned_variable", "loc": [29, 29], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99816:If_L27_C8", "vector": [14, 3, 0.58, 0.02, 3, 0.98, 1.0, 454, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "keyword", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " keyword = keyword.__name__"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99816:If_L30_C8", "label": "if", "type": "if", "loc": [30, 31], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99816:FunctionDef_L26_C4", "vector": [4, 2, 0.61, 0.04, 2, 0.0, 0.5, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if libname not in self._libs:\n self._libs[libname] = utils.NormalizedDict(ignore=['_'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99816:Assign_L31_C12", "label": " = NormalizedDict()", "type": "assigned_variable", "loc": [31, 31], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99816:If_L30_C8", "vector": [14, 3, 0.62, 0.02, 3, 0.89, 0.0, 0, 3, 1, 0, 0, 696, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "NormalizedDict", "annotation": ""}, "snippet": " self._libs[libname] = utils.NormalizedDict(ignore=['_'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99816:Assign_L32_C8", "label": " = int()", "type": "assigned_variable", "loc": [32, 32], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99816:FunctionDef_L26_C4", "vector": [14, 2, 0.64, 0.02, 2, 0.0, 1.0, 0, 3, 1, 0, 0, 901, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "int", "annotation": ""}, "snippet": " self._libs[libname][keyword] = int(args_to_process)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99816:FunctionDef_L34_C4", "label": "get_args_to_process", "type": "function", "loc": [34, 37], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99816:ClassDef_L21_C0", "vector": [2, 1, 0.71, 0.08, 1, 0.48, 0.5, 548, 0, 3, 1, 0, 0, 0, 0], "semantic": {"name": "get_args_to_process", "arg_names": ["self", "libname", "kwname"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_args_to_process(self, libname, kwname):\n if libname in self._libs and kwname in self._libs[libname]:\n return self._libs[libname][kwname]\n return -1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99816:If_L35_C8", "label": "if", "type": "if", "loc": [35, 36], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99816:FunctionDef_L34_C4", "vector": [4, 2, 0.71, 0.04, 2, 0.01, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if libname in self._libs and kwname in self._libs[libname]:\n return self._libs[libname][kwname]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99816:Return_L36_C12", "label": "return", "type": "return", "loc": [36, 36], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99816:If_L35_C8", "vector": [13, 3, 0.72, 0.02, 3, 0.38, 0.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._libs[libname][kwname]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99816:Return_L37_C8", "label": "return", "type": "return", "loc": [37, 37], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99816:FunctionDef_L34_C4", "vector": [13, 2, 0.74, 0.02, 2, 0.01, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return -1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99816:FunctionDef_L39_C4", "label": "is_run_keyword", "type": "function", "loc": [39, 40], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99816:ClassDef_L21_C0", "vector": [2, 1, 0.79, 0.04, 1, 0.48, 0.75, 779, 0, 3, 1, 0, 0, 0, 1], "semantic": {"name": "is_run_keyword", "arg_names": ["self", "libname", "kwname"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def is_run_keyword(self, libname, kwname):\n return self.get_args_to_process(libname, kwname) >= 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99816:Return_L40_C8", "label": "return", "type": "return", "loc": [40, 40], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99816:FunctionDef_L39_C4", "vector": [13, 2, 0.8, 0.02, 2, 0.21, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.get_args_to_process(libname, kwname) >= 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99816:FunctionDef_L42_C4", "label": "_get_args_from_method", "type": "function", "loc": [42, 47], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99816:ClassDef_L21_C0", "vector": [2, 1, 0.89, 0.12, 1, 0.48, 1.0, 464, 0, 2, 1, 0, 0, 0, 3], "semantic": {"name": "_get_args_from_method", "arg_names": ["self", "method"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _get_args_from_method(self, method):\n if inspect.ismethod(method):\n return method.im_func.func_code.co_argcount -1\n elif inspect.isfunction(method):\n return method.func_code.co_argcount\n raise ValueError(\"Needs function or method!\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99816:If_L43_C8", "label": "if", "type": "if", "loc": [43, 46], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99816:FunctionDef_L42_C4", "vector": [4, 2, 0.89, 0.08, 2, 0.15, 0.0, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if inspect.ismethod(method):\n return method.im_func.func_code.co_argcount -1\n elif inspect.isfunction(method):\n return method.func_code.co_argcount"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99816:Return_L44_C12", "label": "return", "type": "return", "loc": [44, 44], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99816:If_L43_C8", "vector": [13, 3, 0.88, 0.02, 3, 0.09, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return method.im_func.func_code.co_argcount -1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99816:If_L45_C8", "label": "if", "type": "if", "loc": [45, 46], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99816:If_L43_C8", "vector": [4, 3, 0.91, 0.04, 3, 0.09, 1.0, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif inspect.isfunction(method):\n return method.func_code.co_argcount"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99816:Return_L46_C12", "label": "return", "type": "return", "loc": [46, 46], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99816:If_L45_C8", "vector": [13, 4, 0.92, 0.02, 4, 0.87, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return method.func_code.co_argcount"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99816:Assign_L50_C0", "label": "RUN_KW_REGISTER = _RunKeywordRegister()", "type": "assigned_variable", "loc": [50, 50], "level": 0, "parent": null, "vector": [14, 0, 1.0, 0.02, 0, 0.66, 1.0, 568, 3, 0, 0, 0, 153, 10, 1], "semantic": {"name": "RUN_KW_REGISTER", "arg_names": [], "import_names": [], "rhs_call_name": "_RunKeywordRegister", "annotation": ""}, "snippet": "RUN_KW_REGISTER = _RunKeywordRegister()"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99816:ClassDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99816:FunctionDef_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99816:FunctionDef_L23_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99816:Assign_L24_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99816:ClassDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99816:FunctionDef_L26_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99816:FunctionDef_L26_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99816:If_L27_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99816:If_L27_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99816:Assign_L28_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99816:If_L27_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99816:Assign_L29_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99816:FunctionDef_L26_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99816:If_L30_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99816:If_L30_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99816:Assign_L31_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99816:FunctionDef_L26_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99816:Assign_L32_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99816:ClassDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99816:FunctionDef_L34_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99816:FunctionDef_L34_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99816:If_L35_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99816:If_L35_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99816:Return_L36_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99816:FunctionDef_L34_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99816:Return_L37_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99816:ClassDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99816:FunctionDef_L39_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99816:FunctionDef_L39_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99816:Return_L40_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99816:ClassDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99816:FunctionDef_L42_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99816:FunctionDef_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99816:If_L43_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99816:If_L43_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99816:Return_L44_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99816:If_L43_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99816:If_L45_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99816:If_L45_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99816:Return_L46_C12"}] |
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from model import TestSuite
from keywords import Keyword
from testlibraries import TestLibrary
from runkwregister import RUN_KW_REGISTER
from signalhandler import STOP_SIGNAL_MONITOR
def UserLibrary(path):
"""Create a user library instance from given resource file.
This is used at least by libdoc.py."""
from robot.parsing import ResourceFile
from robot import utils
from arguments import UserKeywordArguments
from userkeyword import UserLibrary as RuntimeUserLibrary
resource = ResourceFile(path)
ret = RuntimeUserLibrary(resource.keyword_table.keywords, path)
for handler in ret.handlers.values(): # This is done normally only at runtime.
handler.arguments = UserKeywordArguments(handler._keyword_args,
handler.longname)
handler.doc = utils.unescape(handler._doc)
ret.doc = resource.setting_table.doc.value
return ret
class _Namespaces:
def __init__(self):
self._namespaces = []
self.current = None
def start_suite(self, namespace):
self._namespaces.append(self.current)
self.current = namespace
def end_suite(self):
self.current = self._namespaces.pop()
def __iter__(self):
namespaces = self._namespaces + [self.current]
return iter([ns for ns in namespaces if ns is not None])
# Hook to namespaces
NAMESPACES = _Namespaces()
| ajibawa-2023/Python-Code-Large/train/row_99819 | 31 | 61 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99819:ImportFrom_L16_C0", "label": "from model import TestSuite", "type": "import", "loc": [16, 16], "level": 0, "parent": null, "vector": [1, 0, 0.2623, 0.0164, 0, 0.66, 0.0, 722, 0, 1, 0, 0, 722, 0, 0], "semantic": {"name": "model", "arg_names": [], "import_names": ["TestSuite"], "rhs_call_name": "", "annotation": ""}, "snippet": "from model import TestSuite"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99819:ImportFrom_L17_C0", "label": "from keywords import Keyword", "type": "import", "loc": [17, 17], "level": 0, "parent": null, "vector": [1, 0, 0.2787, 0.0164, 0, 0.66, 0.1429, 211, 0, 1, 0, 0, 211, 0, 0], "semantic": {"name": "keywords", "arg_names": [], "import_names": ["Keyword"], "rhs_call_name": "", "annotation": ""}, "snippet": "from keywords import Keyword"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99819:ImportFrom_L18_C0", "label": "from testlibraries import TestLibrary", "type": "import", "loc": [18, 18], "level": 0, "parent": null, "vector": [1, 0, 0.2951, 0.0164, 0, 0.66, 0.2857, 497, 0, 1, 0, 0, 497, 0, 0], "semantic": {"name": "testlibraries", "arg_names": [], "import_names": ["TestLibrary"], "rhs_call_name": "", "annotation": ""}, "snippet": "from testlibraries import TestLibrary"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99819:ImportFrom_L19_C0", "label": "from runkwregister import RUN_KW_REGISTER", "type": "import", "loc": [19, 19], "level": 0, "parent": null, "vector": [1, 0, 0.3115, 0.0164, 0, 0.66, 0.4286, 661, 0, 1, 0, 0, 661, 0, 0], "semantic": {"name": "runkwregister", "arg_names": [], "import_names": ["RUN_KW_REGISTER"], "rhs_call_name": "", "annotation": ""}, "snippet": "from runkwregister import RUN_KW_REGISTER"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99819:ImportFrom_L20_C0", "label": "from signalhandler import STOP_SIGNAL_MONITOR", "type": "import", "loc": [20, 20], "level": 0, "parent": null, "vector": [1, 0, 0.3279, 0.0164, 0, 0.66, 0.5714, 831, 0, 1, 0, 0, 831, 0, 0], "semantic": {"name": "signalhandler", "arg_names": [], "import_names": ["STOP_SIGNAL_MONITOR"], "rhs_call_name": "", "annotation": ""}, "snippet": "from signalhandler import STOP_SIGNAL_MONITOR"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99819:FunctionDef_L23_C0", "label": "UserLibrary", "type": "function", "loc": [23, 39], "level": 0, "parent": null, "vector": [2, 0, 0.5082, 0.2787, 0, 0.66, 0.7143, 296, 0, 1, 1, 0, 0, 0, 5], "semantic": {"name": "UserLibrary", "arg_names": ["path"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def UserLibrary(path):\n \"\"\"Create a user library instance from given resource file.\n\n This is used at least by libdoc.py.\"\"\"\n from robot.parsing import ResourceFile\n from robot import utils\n from arguments import UserKeywordArguments\n from userkeyword import UserLibrary as RuntimeUserLibrary"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99819:Expr_L24_C4", "label": "expression", "type": "expression", "loc": [24, 26], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99819:FunctionDef_L23_C0", "vector": [8, 1, 0.4098, 0.0492, 1, 0.27, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Create a user library instance from given resource file.\n\n This is used at least by libdoc.py.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99819:ImportFrom_L27_C4", "label": "from robot.parsing import ResourceFile", "type": "import", "loc": [27, 27], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99819:FunctionDef_L23_C0", "vector": [1, 1, 0.4426, 0.0164, 1, 0.27, 0.1111, 990, 0, 1, 0, 0, 990, 0, 0], "semantic": {"name": "robot.parsing", "arg_names": [], "import_names": ["ResourceFile"], "rhs_call_name": "", "annotation": ""}, "snippet": " from robot.parsing import ResourceFile"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99819:ImportFrom_L28_C4", "label": "from robot import utils", "type": "import", "loc": [28, 28], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99819:FunctionDef_L23_C0", "vector": [1, 1, 0.459, 0.0164, 1, 0.27, 0.2222, 735, 0, 1, 0, 0, 735, 0, 0], "semantic": {"name": "robot", "arg_names": [], "import_names": ["utils"], "rhs_call_name": "", "annotation": ""}, "snippet": " from robot import utils"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99819:ImportFrom_L29_C4", "label": "from arguments import UserKeywordArguments", "type": "import", "loc": [29, 29], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99819:FunctionDef_L23_C0", "vector": [1, 1, 0.4754, 0.0164, 1, 0.27, 0.3333, 426, 0, 1, 0, 0, 426, 0, 0], "semantic": {"name": "arguments", "arg_names": [], "import_names": ["UserKeywordArguments"], "rhs_call_name": "", "annotation": ""}, "snippet": " from arguments import UserKeywordArguments"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99819:ImportFrom_L30_C4", "label": "from userkeyword import RuntimeUserLibrary", "type": "import", "loc": [30, 30], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99819:FunctionDef_L23_C0", "vector": [1, 1, 0.4918, 0.0164, 1, 0.27, 0.4444, 362, 0, 1, 0, 0, 362, 0, 0], "semantic": {"name": "userkeyword", "arg_names": [], "import_names": ["RuntimeUserLibrary"], "rhs_call_name": "", "annotation": ""}, "snippet": " from userkeyword import UserLibrary as RuntimeUserLibrary"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99819:Assign_L32_C4", "label": "resource = ResourceFile()", "type": "assigned_variable", "loc": [32, 32], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99819:FunctionDef_L23_C0", "vector": [14, 1, 0.5246, 0.0164, 1, 0.27, 0.5556, 559, 3, 1, 0, 0, 764, 10, 1], "semantic": {"name": "resource", "arg_names": [], "import_names": [], "rhs_call_name": "ResourceFile", "annotation": ""}, "snippet": " resource = ResourceFile(path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99819:Assign_L33_C4", "label": "ret = RuntimeUserLibrary()", "type": "assigned_variable", "loc": [33, 33], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99819:FunctionDef_L23_C0", "vector": [14, 1, 0.541, 0.0164, 1, 0.27, 0.6667, 501, 3, 2, 0, 0, 284, 10, 1], "semantic": {"name": "ret", "arg_names": [], "import_names": [], "rhs_call_name": "RuntimeUserLibrary", "annotation": ""}, "snippet": " ret = RuntimeUserLibrary(resource.keyword_table.keywords, path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99819:For_L34_C4", "label": "for handler", "type": "for", "loc": [34, 37], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99819:FunctionDef_L23_C0", "vector": [6, 1, 0.582, 0.0656, 1, 0.27, 0.7778, 388, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "handler", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for handler in ret.handlers.values(): # This is done normally only at runtime.\n handler.arguments = UserKeywordArguments(handler._keyword_args,\n handler.longname)\n handler.doc = utils.unescape(handler._doc)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99819:Assign_L35_C8", "label": "handler.arguments = UserKeywordArguments()", "type": "assigned_variable", "loc": [35, 36], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99819:For_L34_C4", "vector": [14, 2, 0.582, 0.0328, 2, 0.79, 0.0, 481, 3, 2, 0, 0, 34, 10, 1], "semantic": {"name": "handler.arguments", "arg_names": [], "import_names": [], "rhs_call_name": "UserKeywordArguments", "annotation": ""}, "snippet": " handler.arguments = UserKeywordArguments(handler._keyword_args,\n handler.longname)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99819:Assign_L37_C8", "label": "handler.doc = unescape()", "type": "assigned_variable", "loc": [37, 37], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99819:For_L34_C4", "vector": [14, 2, 0.6066, 0.0164, 2, 0.79, 1.0, 405, 3, 1, 0, 0, 32, 10, 1], "semantic": {"name": "handler.doc", "arg_names": [], "import_names": [], "rhs_call_name": "unescape", "annotation": ""}, "snippet": " handler.doc = utils.unescape(handler._doc)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99819:Assign_L38_C4", "label": "ret.doc =", "type": "assigned_variable", "loc": [38, 38], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99819:FunctionDef_L23_C0", "vector": [14, 1, 0.623, 0.0164, 1, 0.27, 0.8889, 189, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ret.doc", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ret.doc = resource.setting_table.doc.value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99819:Return_L39_C4", "label": "return", "type": "return", "loc": [39, 39], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99819:FunctionDef_L23_C0", "vector": [13, 1, 0.6393, 0.0164, 1, 0.27, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ret"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99819:ClassDef_L42_C0", "label": "_Namespaces", "type": "class", "loc": [42, 57], "level": 0, "parent": null, "vector": [3, 0, 0.8115, 0.2623, 0, 0.66, 0.8571, 568, 0, 4, 0, 0, 0, 0, 3], "semantic": {"name": "_Namespaces", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class _Namespaces:\n\n def __init__(self):\n self._namespaces = []\n self.current = None\n\n def start_suite(self, namespace):\n self._namespaces.append(self.current)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99819:FunctionDef_L44_C4", "label": "__init__", "type": "function", "loc": [44, 46], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99819:ClassDef_L42_C0", "vector": [2, 1, 0.7377, 0.0492, 1, 0.74, 0.0, 555, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self):\n self._namespaces = []\n self.current = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99819:Assign_L45_C8", "label": "self._namespaces =", "type": "assigned_variable", "loc": [45, 45], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99819:FunctionDef_L44_C4", "vector": [14, 2, 0.7377, 0.0164, 2, 0.93, 0.0, 188, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self._namespaces", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._namespaces = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99819:Assign_L46_C8", "label": "self.current =", "type": "assigned_variable", "loc": [46, 46], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99819:FunctionDef_L44_C4", "vector": [14, 2, 0.7541, 0.0164, 2, 0.93, 1.0, 197, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.current", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.current = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99819:FunctionDef_L48_C4", "label": "start_suite", "type": "function", "loc": [48, 50], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99819:ClassDef_L42_C0", "vector": [2, 1, 0.8033, 0.0492, 1, 0.74, 0.3333, 38, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "start_suite", "arg_names": ["self", "namespace"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def start_suite(self, namespace):\n self._namespaces.append(self.current)\n self.current = namespace"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99819:Expr_L49_C8", "label": "append()", "type": "expression", "loc": [49, 49], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99819:FunctionDef_L48_C4", "vector": [8, 2, 0.8033, 0.0164, 2, 0.97, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self._namespaces.append(self.current)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99819:Assign_L50_C8", "label": "self.current =", "type": "assigned_variable", "loc": [50, 50], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99819:FunctionDef_L48_C4", "vector": [14, 2, 0.8197, 0.0164, 2, 0.97, 1.0, 197, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.current", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.current = namespace"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99819:FunctionDef_L52_C4", "label": "end_suite", "type": "function", "loc": [52, 53], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99819:ClassDef_L42_C0", "vector": [2, 1, 0.8607, 0.0328, 1, 0.74, 0.6667, 81, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "end_suite", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def end_suite(self):\n self.current = self._namespaces.pop()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99819:Assign_L53_C8", "label": "self.current = pop()", "type": "assigned_variable", "loc": [53, 53], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99819:FunctionDef_L52_C4", "vector": [14, 2, 0.8689, 0.0164, 2, 0.97, 0.0, 197, 3, 0, 0, 0, 969, 10, 1], "semantic": {"name": "self.current", "arg_names": [], "import_names": [], "rhs_call_name": "pop", "annotation": ""}, "snippet": " self.current = self._namespaces.pop()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99819:FunctionDef_L55_C4", "label": "__iter__", "type": "function", "loc": [55, 57], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99819:ClassDef_L42_C0", "vector": [2, 1, 0.918, 0.0492, 1, 0.74, 1.0, 891, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "__iter__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __iter__(self):\n namespaces = self._namespaces + [self.current]\n return iter([ns for ns in namespaces if ns is not None])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99819:Assign_L56_C8", "label": "namespaces =", "type": "assigned_variable", "loc": [56, 56], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99819:FunctionDef_L55_C4", "vector": [14, 2, 0.918, 0.0164, 2, 0.52, 0.0, 93, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "namespaces", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " namespaces = self._namespaces + [self.current]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99819:Return_L57_C8", "label": "return", "type": "return", "loc": [57, 57], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99819:FunctionDef_L55_C4", "vector": [13, 2, 0.9344, 0.0164, 2, 0.52, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return iter([ns for ns in namespaces if ns is not None])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99819:Assign_L61_C0", "label": "NAMESPACES = _Namespaces()", "type": "assigned_variable", "loc": [61, 61], "level": 0, "parent": null, "vector": [14, 0, 1.0, 0.0164, 0, 0.66, 1.0, 623, 3, 0, 0, 0, 568, 10, 1], "semantic": {"name": "NAMESPACES", "arg_names": [], "import_names": [], "rhs_call_name": "_Namespaces", "annotation": ""}, "snippet": "NAMESPACES = _Namespaces()"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99819:FunctionDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99819:Expr_L24_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99819:FunctionDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99819:ImportFrom_L27_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99819:FunctionDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99819:ImportFrom_L28_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99819:FunctionDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99819:ImportFrom_L29_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99819:FunctionDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99819:ImportFrom_L30_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99819:FunctionDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99819:Assign_L32_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99819:FunctionDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99819:Assign_L33_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99819:FunctionDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99819:For_L34_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99819:For_L34_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99819:Assign_L35_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99819:For_L34_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99819:Assign_L37_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99819:FunctionDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99819:Assign_L38_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99819:FunctionDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99819:Return_L39_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99819:ClassDef_L42_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99819:FunctionDef_L44_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99819:FunctionDef_L44_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99819:Assign_L45_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99819:FunctionDef_L44_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99819:Assign_L46_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99819:ClassDef_L42_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99819:FunctionDef_L48_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99819:FunctionDef_L48_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99819:Expr_L49_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99819:FunctionDef_L48_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99819:Assign_L50_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99819:ClassDef_L42_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99819:FunctionDef_L52_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99819:FunctionDef_L52_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99819:Assign_L53_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99819:ClassDef_L42_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99819:FunctionDef_L55_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99819:FunctionDef_L55_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99819:Assign_L56_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99819:FunctionDef_L55_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99819:Return_L57_C8"}] |
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import sys
from java.lang import Byte, Short, Integer, Long, Boolean, Float, Double
class ArgumentCoercer:
def __init__(self, signatures):
types = self._parse_types(signatures)
self._coercers = [_CoercionFunction(t, i+1) for i, t in types]
def _parse_types(self, signatures):
types = {}
for sig in signatures:
for index, arg in enumerate(sig.args):
types.setdefault(index, []).append(arg)
return sorted(types.items())
def __call__(self, args):
return [coercer(arg) for coercer, arg in zip(self._coercers, args)]
class _CoercionFunction:
_bool_types = [Boolean]
_int_types = [Byte, Short, Integer, Long]
_float_types = [Float, Double]
_bool_primitives = ['boolean']
_int_primitives = ['byte', 'short', 'int', 'long']
_float_primitives = ['float', 'double']
_bool_primitives = ["<type 'boolean'>"]
_int_primitives = ["<type '%s'>" % p for p in _int_primitives]
_float_primitives = ["<type '%s'>" % p for p in _float_primitives]
def __init__(self, arg_types, position):
self._position = position
self.__coercer = None
for arg in arg_types:
if not (self._set_bool(arg) or
self._set_int(arg) or
self._set_float(arg)):
self.__coercer = self._no_coercion
def __call__(self, arg):
if not isinstance(arg, basestring):
return arg
return self.__coercer(arg)
def _set_bool(self, arg):
return self._set_coercer(arg, self._bool_types,
self._bool_primitives, self._to_bool)
def _set_int(self, arg):
return self._set_coercer(arg, self._int_types,
self._int_primitives, self._to_int)
def _set_float(self, arg):
return self._set_coercer(arg, self._float_types,
self._float_primitives, self._to_float)
def _set_coercer(self, arg, type_list, primitive_list, coercer):
if arg in type_list or str(arg) in primitive_list:
if self.__coercer is None:
self.__coercer = coercer
elif self.__coercer != coercer:
self.__coercer = self._no_coercion
return True
return False
def _to_bool(self, arg):
try:
return {'false': False, 'true': True}[arg.lower()]
except KeyError:
self._coercion_failed('boolean')
def _to_int(self, arg):
try:
return int(arg)
except ValueError:
self._coercion_failed('integer')
def _to_float(self, arg):
try:
return float(arg)
except ValueError:
self._coercion_failed('floating point number')
def _no_coercion(self, arg):
return arg
def _coercion_failed(self, arg_type):
raise ValueError('Argument at position %d cannot be coerced to %s'
% (self._position, arg_type))
| ajibawa-2023/Python-Code-Large/train/row_99820 | 63 | 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_99820:Import_L15_C0", "label": "sys import sys", "type": "import", "loc": [15, 15], "level": 0, "parent": null, "vector": [1, 0, 0.1429, 0.0095, 0, 0.66, 0.0, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sys"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99820:ImportFrom_L16_C0", "label": "from java.lang import Byte, Short, Integer\u2026", "type": "import", "loc": [16, 16], "level": 0, "parent": null, "vector": [1, 0, 0.1524, 0.0095, 0, 0.66, 0.3333, 100, 0, 7, 0, 0, 100, 0, 0], "semantic": {"name": "java.lang", "arg_names": [], "import_names": ["Byte", "Short", "Integer", "Long", "Boolean", "Float", "Double"], "rhs_call_name": "", "annotation": ""}, "snippet": "from java.lang import Byte, Short, Integer, Long, Boolean, Float, Double"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99820:ClassDef_L19_C0", "label": "ArgumentCoercer", "type": "class", "loc": [19, 33], "level": 0, "parent": null, "vector": [3, 0, 0.2476, 0.1429, 0, 0.66, 0.6667, 639, 0, 3, 0, 0, 0, 0, 9], "semantic": {"name": "ArgumentCoercer", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class ArgumentCoercer:\n\n def __init__(self, signatures):\n types = self._parse_types(signatures)\n self._coercers = [_CoercionFunction(t, i+1) for i, t in types]\n\n def _parse_types(self, signatures):\n types = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99820:FunctionDef_L21_C4", "label": "__init__", "type": "function", "loc": [21, 23], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99820:ClassDef_L19_C0", "vector": [2, 1, 0.2095, 0.0286, 1, 0.7, 0.0, 555, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": ["self", "signatures"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, signatures):\n types = self._parse_types(signatures)\n self._coercers = [_CoercionFunction(t, i+1) for i, t in types]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99820:Assign_L22_C8", "label": "types = _parse_types()", "type": "assigned_variable", "loc": [22, 22], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99820:FunctionDef_L21_C4", "vector": [14, 2, 0.2095, 0.0095, 2, 0.88, 0.0, 209, 3, 1, 0, 0, 180, 10, 1], "semantic": {"name": "types", "arg_names": [], "import_names": [], "rhs_call_name": "_parse_types", "annotation": ""}, "snippet": " types = self._parse_types(signatures)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99820:Assign_L23_C8", "label": "self._coercers =", "type": "assigned_variable", "loc": [23, 23], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99820:FunctionDef_L21_C4", "vector": [14, 2, 0.219, 0.0095, 2, 0.88, 1.0, 957, 5, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self._coercers", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._coercers = [_CoercionFunction(t, i+1) for i, t in types]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99820:FunctionDef_L25_C4", "label": "_parse_types", "type": "function", "loc": [25, 30], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99820:ClassDef_L19_C0", "vector": [2, 1, 0.2619, 0.0571, 1, 0.7, 0.5, 180, 0, 2, 1, 0, 0, 0, 5], "semantic": {"name": "_parse_types", "arg_names": ["self", "signatures"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _parse_types(self, signatures):\n types = {}\n for sig in signatures:\n for index, arg in enumerate(sig.args):\n types.setdefault(index, []).append(arg)\n return sorted(types.items())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99820:Assign_L26_C8", "label": "types =", "type": "assigned_variable", "loc": [26, 26], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99820:FunctionDef_L25_C4", "vector": [14, 2, 0.2476, 0.0095, 2, 0.84, 0.0, 209, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "types", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " types = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99820:For_L27_C8", "label": "for sig", "type": "for", "loc": [27, 29], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99820:FunctionDef_L25_C4", "vector": [6, 2, 0.2667, 0.0286, 2, 0.84, 0.5, 899, 2, 0, 0, 0, 0, 0, 3], "semantic": {"name": "sig", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for sig in signatures:\n for index, arg in enumerate(sig.args):\n types.setdefault(index, []).append(arg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99820:For_L28_C12", "label": "for index, arg", "type": "for", "loc": [28, 29], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99820:For_L27_C8", "vector": [6, 3, 0.2714, 0.019, 3, 0.57, 0.0, 759, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "index, arg", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for index, arg in enumerate(sig.args):\n types.setdefault(index, []).append(arg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99820:Expr_L29_C16", "label": "append()", "type": "expression", "loc": [29, 29], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99820:For_L28_C12", "vector": [8, 4, 0.2762, 0.0095, 4, 0.27, 0.0, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " types.setdefault(index, []).append(arg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99820:Return_L30_C8", "label": "return", "type": "return", "loc": [30, 30], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99820:FunctionDef_L25_C4", "vector": [13, 2, 0.2857, 0.0095, 2, 0.84, 1.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return sorted(types.items())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99820:FunctionDef_L32_C4", "label": "__call__", "type": "function", "loc": [32, 33], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99820:ClassDef_L19_C0", "vector": [2, 1, 0.3095, 0.019, 1, 0.7, 1.0, 319, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "__call__", "arg_names": ["self", "args"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __call__(self, args):\n return [coercer(arg) for coercer, arg in zip(self._coercers, args)]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99820:Return_L33_C8", "label": "return", "type": "return", "loc": [33, 33], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99820:FunctionDef_L32_C4", "vector": [13, 2, 0.3143, 0.0095, 2, 0.33, 0.0, 0, 5, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return [coercer(arg) for coercer, arg in zip(self._coercers, args)]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99820:ClassDef_L36_C0", "label": "_CoercionFunction", "type": "class", "loc": [36, 105], "level": 0, "parent": null, "vector": [3, 0, 0.6714, 0.6667, 0, 0.66, 1.0, 18, 0, 11, 0, 0, 0, 0, 16], "semantic": {"name": "_CoercionFunction", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class _CoercionFunction:\n _bool_types = [Boolean]\n _int_types = [Byte, Short, Integer, Long]\n _float_types = [Float, Double]\n _bool_primitives = ['boolean']\n _int_primitives = ['byte', 'short', 'int', 'long']\n _float_primitives = ['float', 'double']\n _bool_primitives = [\"<type 'boolean'>\"]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99820:Assign_L37_C4", "label": "_bool_types =", "type": "assigned_variable", "loc": [37, 37], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99820:ClassDef_L36_C0", "vector": [14, 1, 0.3524, 0.0095, 1, 0.05, 0.0, 724, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "_bool_types", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " _bool_types = [Boolean]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99820:Assign_L38_C4", "label": "_int_types =", "type": "assigned_variable", "loc": [38, 38], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99820:ClassDef_L36_C0", "vector": [14, 1, 0.3619, 0.0095, 1, 0.05, 0.0526, 315, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "_int_types", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " _int_types = [Byte, Short, Integer, Long]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99820:Assign_L39_C4", "label": "_float_types =", "type": "assigned_variable", "loc": [39, 39], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99820:ClassDef_L36_C0", "vector": [14, 1, 0.3714, 0.0095, 1, 0.05, 0.1053, 219, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "_float_types", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " _float_types = [Float, Double]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99820:Assign_L40_C4", "label": "_bool_primitives =", "type": "assigned_variable", "loc": [40, 40], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99820:ClassDef_L36_C0", "vector": [14, 1, 0.381, 0.0095, 1, 0.05, 0.1579, 863, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "_bool_primitives", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " _bool_primitives = ['boolean']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99820:Assign_L41_C4", "label": "_int_primitives =", "type": "assigned_variable", "loc": [41, 41], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99820:ClassDef_L36_C0", "vector": [14, 1, 0.3905, 0.0095, 1, 0.05, 0.2105, 859, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "_int_primitives", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " _int_primitives = ['byte', 'short', 'int', 'long']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99820:Assign_L42_C4", "label": "_float_primitives =", "type": "assigned_variable", "loc": [42, 42], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99820:ClassDef_L36_C0", "vector": [14, 1, 0.4, 0.0095, 1, 0.05, 0.2632, 182, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "_float_primitives", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " _float_primitives = ['float', 'double']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99820:Assign_L43_C4", "label": "_bool_primitives =", "type": "assigned_variable", "loc": [43, 43], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99820:ClassDef_L36_C0", "vector": [14, 1, 0.4095, 0.0095, 1, 0.05, 0.3158, 863, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "_bool_primitives", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " _bool_primitives = [\"<type 'boolean'>\"]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99820:Assign_L44_C4", "label": "_int_primitives =", "type": "assigned_variable", "loc": [44, 44], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99820:ClassDef_L36_C0", "vector": [14, 1, 0.419, 0.0095, 1, 0.05, 0.3684, 859, 5, 0, 0, 0, 0, 0, 0], "semantic": {"name": "_int_primitives", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " _int_primitives = [\"<type '%s'>\" % p for p in _int_primitives]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99820:Assign_L45_C4", "label": "_float_primitives =", "type": "assigned_variable", "loc": [45, 45], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99820:ClassDef_L36_C0", "vector": [14, 1, 0.4286, 0.0095, 1, 0.05, 0.4211, 182, 5, 0, 0, 0, 0, 0, 0], "semantic": {"name": "_float_primitives", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " _float_primitives = [\"<type '%s'>\" % p for p in _float_primitives]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99820:FunctionDef_L47_C4", "label": "__init__", "type": "function", "loc": [47, 54], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99820:ClassDef_L36_C0", "vector": [2, 1, 0.481, 0.0762, 1, 0.05, 0.4737, 555, 0, 3, 0, 0, 0, 0, 3], "semantic": {"name": "__init__", "arg_names": ["self", "arg_types", "position"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, arg_types, position):\n self._position = position\n self.__coercer = None\n for arg in arg_types:\n if not (self._set_bool(arg) or\n self._set_int(arg) or\n self._set_float(arg)):\n self.__coercer = self._no_coercion"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99820:Assign_L48_C8", "label": "self._position =", "type": "assigned_variable", "loc": [48, 48], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99820:FunctionDef_L47_C4", "vector": [14, 2, 0.4571, 0.0095, 2, 0.12, 0.0, 538, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._position", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._position = position"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99820:Assign_L49_C8", "label": "self.__coercer =", "type": "assigned_variable", "loc": [49, 49], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99820:FunctionDef_L47_C4", "vector": [14, 2, 0.4667, 0.0095, 2, 0.12, 0.5, 171, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.__coercer", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.__coercer = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99820:For_L50_C8", "label": "for arg", "type": "for", "loc": [50, 54], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99820:FunctionDef_L47_C4", "vector": [6, 2, 0.4952, 0.0476, 2, 0.12, 1.0, 447, 2, 0, 0, 0, 0, 0, 3], "semantic": {"name": "arg", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for arg in arg_types:\n if not (self._set_bool(arg) or\n self._set_int(arg) or\n self._set_float(arg)):\n self.__coercer = self._no_coercion"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99820:If_L51_C12", "label": "if", "type": "if", "loc": [51, 54], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99820:For_L50_C8", "vector": [4, 3, 0.5, 0.0381, 3, 0.59, 0.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not (self._set_bool(arg) or\n self._set_int(arg) or\n self._set_float(arg)):\n self.__coercer = self._no_coercion"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99820:Assign_L54_C16", "label": "self.__coercer =", "type": "assigned_variable", "loc": [54, 54], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99820:If_L51_C12", "vector": [14, 4, 0.5143, 0.0095, 4, 0.83, 0.0, 171, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.__coercer", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.__coercer = self._no_coercion"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99820:FunctionDef_L56_C4", "label": "__call__", "type": "function", "loc": [56, 59], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99820:ClassDef_L36_C0", "vector": [2, 1, 0.5476, 0.0381, 1, 0.05, 0.5263, 319, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "__call__", "arg_names": ["self", "arg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __call__(self, arg):\n if not isinstance(arg, basestring):\n return arg\n return self.__coercer(arg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99820:If_L57_C8", "label": "if", "type": "if", "loc": [57, 58], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99820:FunctionDef_L56_C4", "vector": [4, 2, 0.5476, 0.019, 2, 0.29, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not isinstance(arg, basestring):\n return arg"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99820:Return_L58_C12", "label": "return", "type": "return", "loc": [58, 58], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99820:If_L57_C8", "vector": [13, 3, 0.5524, 0.0095, 3, 0.62, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return arg"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99820:Return_L59_C8", "label": "return", "type": "return", "loc": [59, 59], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99820:FunctionDef_L56_C4", "vector": [13, 2, 0.5619, 0.0095, 2, 0.29, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.__coercer(arg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99820:FunctionDef_L61_C4", "label": "_set_bool", "type": "function", "loc": [61, 63], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99820:ClassDef_L36_C0", "vector": [2, 1, 0.5905, 0.0286, 1, 0.05, 0.5789, 36, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "_set_bool", "arg_names": ["self", "arg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _set_bool(self, arg):\n return self._set_coercer(arg, self._bool_types,\n self._bool_primitives, self._to_bool)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99820:Return_L62_C8", "label": "return", "type": "return", "loc": [62, 63], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99820:FunctionDef_L61_C4", "vector": [13, 2, 0.5952, 0.019, 2, 0.26, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._set_coercer(arg, self._bool_types,\n self._bool_primitives, self._to_bool)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99820:FunctionDef_L65_C4", "label": "_set_int", "type": "function", "loc": [65, 67], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99820:ClassDef_L36_C0", "vector": [2, 1, 0.6286, 0.0286, 1, 0.05, 0.6316, 916, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "_set_int", "arg_names": ["self", "arg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _set_int(self, arg):\n return self._set_coercer(arg, self._int_types,\n self._int_primitives, self._to_int)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99820:Return_L66_C8", "label": "return", "type": "return", "loc": [66, 67], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99820:FunctionDef_L65_C4", "vector": [13, 2, 0.6333, 0.019, 2, 0.2, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._set_coercer(arg, self._int_types,\n self._int_primitives, self._to_int)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99820:FunctionDef_L69_C4", "label": "_set_float", "type": "function", "loc": [69, 71], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99820:ClassDef_L36_C0", "vector": [2, 1, 0.6667, 0.0286, 1, 0.05, 0.6842, 353, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "_set_float", "arg_names": ["self", "arg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _set_float(self, arg):\n return self._set_coercer(arg, self._float_types,\n self._float_primitives, self._to_float)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99820:Return_L70_C8", "label": "return", "type": "return", "loc": [70, 71], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99820:FunctionDef_L69_C4", "vector": [13, 2, 0.6714, 0.019, 2, 0.13, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._set_coercer(arg, self._float_types,\n self._float_primitives, self._to_float)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99820:FunctionDef_L73_C4", "label": "_set_coercer", "type": "function", "loc": [73, 80], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99820:ClassDef_L36_C0", "vector": [2, 1, 0.7286, 0.0762, 1, 0.05, 0.7368, 675, 0, 5, 1, 0, 0, 0, 1], "semantic": {"name": "_set_coercer", "arg_names": ["self", "arg", "type_list", "primitive_list", "coercer"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _set_coercer(self, arg, type_list, primitive_list, coercer):\n if arg in type_list or str(arg) in primitive_list:\n if self.__coercer is None:\n self.__coercer = coercer\n elif self.__coercer != coercer:\n self.__coercer = self._no_coercion\n return True\n return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99820:If_L74_C8", "label": "if", "type": "if", "loc": [74, 79], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99820:FunctionDef_L73_C4", "vector": [4, 2, 0.7286, 0.0571, 2, 0.41, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if arg in type_list or str(arg) in primitive_list:\n if self.__coercer is None:\n self.__coercer = coercer\n elif self.__coercer != coercer:\n self.__coercer = self._no_coercion\n return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99820:If_L75_C12", "label": "if", "type": "if", "loc": [75, 78], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99820:If_L74_C8", "vector": [4, 3, 0.7286, 0.0381, 3, 0.19, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.__coercer is None:\n self.__coercer = coercer\n elif self.__coercer != coercer:\n self.__coercer = self._no_coercion"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99820:Assign_L76_C16", "label": "self.__coercer =", "type": "assigned_variable", "loc": [76, 76], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99820:If_L75_C12", "vector": [14, 4, 0.7238, 0.0095, 4, 0.26, 0.0, 171, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.__coercer", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.__coercer = coercer"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99820:If_L77_C12", "label": "if", "type": "if", "loc": [77, 78], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99820:If_L75_C12", "vector": [4, 4, 0.7381, 0.019, 4, 0.26, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif self.__coercer != coercer:\n self.__coercer = self._no_coercion"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99820:Assign_L78_C16", "label": "self.__coercer =", "type": "assigned_variable", "loc": [78, 78], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99820:If_L77_C12", "vector": [14, 5, 0.7429, 0.0095, 5, 0.41, 0.0, 171, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.__coercer", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.__coercer = self._no_coercion"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99820:Return_L79_C12", "label": "return", "type": "return", "loc": [79, 79], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99820:If_L74_C8", "vector": [13, 3, 0.7524, 0.0095, 3, 0.19, 1.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99820:Return_L80_C8", "label": "return", "type": "return", "loc": [80, 80], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99820:FunctionDef_L73_C4", "vector": [13, 2, 0.7619, 0.0095, 2, 0.41, 1.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99820:FunctionDef_L82_C4", "label": "_to_bool", "type": "function", "loc": [82, 86], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99820:ClassDef_L36_C0", "vector": [2, 1, 0.8, 0.0476, 1, 0.05, 0.7895, 996, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "_to_bool", "arg_names": ["self", "arg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _to_bool(self, arg):\n try:\n return {'false': False, 'true': True}[arg.lower()]\n except KeyError:\n self._coercion_failed('boolean')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99820:Try_L83_C8", "label": "try", "type": "try", "loc": [83, 86], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99820:FunctionDef_L82_C4", "vector": [7, 2, 0.8048, 0.0381, 2, 0.91, 0.0, 0, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n return {'false': False, 'true': True}[arg.lower()]\n except KeyError:\n self._coercion_failed('boolean')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99820:Return_L84_C12", "label": "return", "type": "return", "loc": [84, 84], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99820:Try_L83_C8", "vector": [13, 3, 0.8, 0.0095, 3, 0.62, 0.0, 0, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return {'false': False, 'true': True}[arg.lower()]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99820:Expr_L86_C12", "label": "_coercion_failed()", "type": "expression", "loc": [86, 86], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99820:Try_L83_C8", "vector": [8, 3, 0.819, 0.0095, 3, 0.62, 0.0, 81, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_coercion_failed", "arg_names": [], "import_names": [], "rhs_call_name": "_coercion_failed", "annotation": ""}, "snippet": " self._coercion_failed('boolean')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99820:FunctionDef_L88_C4", "label": "_to_int", "type": "function", "loc": [88, 92], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99820:ClassDef_L36_C0", "vector": [2, 1, 0.8571, 0.0476, 1, 0.05, 0.8421, 562, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "_to_int", "arg_names": ["self", "arg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _to_int(self, arg):\n try:\n return int(arg)\n except ValueError:\n self._coercion_failed('integer')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99820:Try_L89_C8", "label": "try", "type": "try", "loc": [89, 92], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99820:FunctionDef_L88_C4", "vector": [7, 2, 0.8619, 0.0381, 2, 0.11, 0.0, 0, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n return int(arg)\n except ValueError:\n self._coercion_failed('integer')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99820:Return_L90_C12", "label": "return", "type": "return", "loc": [90, 90], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99820:Try_L89_C8", "vector": [13, 3, 0.8571, 0.0095, 3, 0.6, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return int(arg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99820:Expr_L92_C12", "label": "_coercion_failed()", "type": "expression", "loc": [92, 92], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99820:Try_L89_C8", "vector": [8, 3, 0.8762, 0.0095, 3, 0.6, 0.0, 81, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_coercion_failed", "arg_names": [], "import_names": [], "rhs_call_name": "_coercion_failed", "annotation": ""}, "snippet": " self._coercion_failed('integer')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99820:FunctionDef_L94_C4", "label": "_to_float", "type": "function", "loc": [94, 98], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99820:ClassDef_L36_C0", "vector": [2, 1, 0.9143, 0.0476, 1, 0.05, 0.8947, 645, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "_to_float", "arg_names": ["self", "arg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _to_float(self, arg):\n try:\n return float(arg)\n except ValueError:\n self._coercion_failed('floating point number')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99820:Try_L95_C8", "label": "try", "type": "try", "loc": [95, 98], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99820:FunctionDef_L94_C4", "vector": [7, 2, 0.919, 0.0381, 2, 0.93, 0.0, 0, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n return float(arg)\n except ValueError:\n self._coercion_failed('floating point number')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99820:Return_L96_C12", "label": "return", "type": "return", "loc": [96, 96], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99820:Try_L95_C8", "vector": [13, 3, 0.9143, 0.0095, 3, 0.55, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return float(arg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99820:Expr_L98_C12", "label": "_coercion_failed()", "type": "expression", "loc": [98, 98], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99820:Try_L95_C8", "vector": [8, 3, 0.9333, 0.0095, 3, 0.55, 0.0, 81, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_coercion_failed", "arg_names": [], "import_names": [], "rhs_call_name": "_coercion_failed", "annotation": ""}, "snippet": " self._coercion_failed('floating point number')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99820:FunctionDef_L100_C4", "label": "_no_coercion", "type": "function", "loc": [100, 101], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99820:ClassDef_L36_C0", "vector": [2, 1, 0.9571, 0.019, 1, 0.05, 0.9474, 378, 0, 2, 1, 0, 0, 0, 0], "semantic": {"name": "_no_coercion", "arg_names": ["self", "arg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _no_coercion(self, arg):\n return arg"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99820:Return_L101_C8", "label": "return", "type": "return", "loc": [101, 101], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99820:FunctionDef_L100_C4", "vector": [13, 2, 0.9619, 0.0095, 2, 0.72, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return arg"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99820:FunctionDef_L103_C4", "label": "_coercion_failed", "type": "function", "loc": [103, 105], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99820:ClassDef_L36_C0", "vector": [2, 1, 0.9905, 0.0286, 1, 0.05, 1.0, 81, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "_coercion_failed", "arg_names": ["self", "arg_type"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _coercion_failed(self, arg_type):\n raise ValueError('Argument at position %d cannot be coerced to %s'\n % (self._position, arg_type))"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99820:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99820:FunctionDef_L21_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99820:FunctionDef_L21_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99820:Assign_L22_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99820:FunctionDef_L21_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99820:Assign_L23_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99820:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99820:FunctionDef_L25_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99820:FunctionDef_L25_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99820:Assign_L26_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99820:FunctionDef_L25_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99820:For_L27_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99820:For_L27_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99820:For_L28_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99820:For_L28_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99820:Expr_L29_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99820:FunctionDef_L25_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99820:Return_L30_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99820:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99820:FunctionDef_L32_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99820:FunctionDef_L32_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99820:Return_L33_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99820:ClassDef_L36_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99820:Assign_L37_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99820:ClassDef_L36_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99820:Assign_L38_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99820:ClassDef_L36_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99820:Assign_L39_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99820:ClassDef_L36_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99820:Assign_L40_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99820:ClassDef_L36_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99820:Assign_L41_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99820:ClassDef_L36_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99820:Assign_L42_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99820:ClassDef_L36_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99820:Assign_L43_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99820:ClassDef_L36_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99820:Assign_L44_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99820:ClassDef_L36_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99820:Assign_L45_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99820:ClassDef_L36_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99820:FunctionDef_L47_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99820:FunctionDef_L47_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99820:Assign_L48_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99820:FunctionDef_L47_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99820:Assign_L49_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99820:FunctionDef_L47_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99820:For_L50_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99820:For_L50_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99820:If_L51_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99820:If_L51_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99820:Assign_L54_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99820:ClassDef_L36_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99820:FunctionDef_L56_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99820:FunctionDef_L56_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99820:If_L57_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99820:If_L57_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99820:Return_L58_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99820:FunctionDef_L56_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99820:Return_L59_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99820:ClassDef_L36_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99820:FunctionDef_L61_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99820:FunctionDef_L61_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99820:Return_L62_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99820:ClassDef_L36_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99820:FunctionDef_L65_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99820:FunctionDef_L65_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99820:Return_L66_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99820:ClassDef_L36_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99820:FunctionDef_L69_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99820:FunctionDef_L69_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99820:Return_L70_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99820:ClassDef_L36_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99820:FunctionDef_L73_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99820:FunctionDef_L73_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99820:If_L74_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99820:If_L74_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99820:If_L75_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99820:If_L75_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99820:Assign_L76_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99820:If_L75_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99820:If_L77_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99820:If_L77_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99820:Assign_L78_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99820:If_L74_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99820:Return_L79_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99820:FunctionDef_L73_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99820:Return_L80_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99820:ClassDef_L36_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99820:FunctionDef_L82_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99820:FunctionDef_L82_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99820:Try_L83_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99820:Try_L83_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99820:Return_L84_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99820:Try_L83_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99820:Expr_L86_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99820:ClassDef_L36_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99820:FunctionDef_L88_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99820:FunctionDef_L88_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99820:Try_L89_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99820:Try_L89_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99820:Return_L90_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99820:Try_L89_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99820:Expr_L92_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99820:ClassDef_L36_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99820:FunctionDef_L94_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99820:FunctionDef_L94_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99820:Try_L95_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99820:Try_L95_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99820:Return_L96_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99820:Try_L95_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99820:Expr_L98_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99820:ClassDef_L36_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99820:FunctionDef_L100_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99820:FunctionDef_L100_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99820:Return_L101_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99820:ClassDef_L36_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99820:FunctionDef_L103_C4"}] |
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from robot.variables import GLOBAL_VARIABLES
class ExecutionContext(object):
def __init__(self, namespace, output, dry_run=False):
self.namespace = namespace
self.output = output
self.dry_run = dry_run
self._in_teardown = 0
@property
def teardown(self):
if self._in_teardown:
return True
# TODO: tests and suites should also call start/end_teardown()
test_or_suite = self.namespace.test or self.namespace.suite
return test_or_suite.status != 'RUNNING'
def start_teardown(self):
self._in_teardown += 1
def end_teardown(self):
self._in_teardown -= 1
def get_current_vars(self):
return self.namespace.variables
def end_test(self, test):
self.output.end_test(test)
self.namespace.end_test()
def end_suite(self, suite):
self.output.end_suite(suite)
self.namespace.end_suite()
def output_file_changed(self, filename):
self._set_global_variable('${OUTPUT_FILE}', filename)
def replace_vars_from_setting(self, name, value, errors):
return self.namespace.variables.replace_meta(name, value, errors)
def log_file_changed(self, filename):
self._set_global_variable('${LOG_FILE}', filename)
def set_prev_test_variables(self, test):
self._set_prev_test_variables(self.get_current_vars(), test.name,
test.status, test.message)
def copy_prev_test_vars_to_global(self):
varz = self.get_current_vars()
name, status, message = varz['${PREV_TEST_NAME}'], \
varz['${PREV_TEST_STATUS}'], varz['${PREV_TEST_MESSAGE}']
self._set_prev_test_variables(GLOBAL_VARIABLES, name, status, message)
def _set_prev_test_variables(self, destination, name, status, message):
destination['${PREV_TEST_NAME}'] = name
destination['${PREV_TEST_STATUS}'] = status
destination['${PREV_TEST_MESSAGE}'] = message
def _set_global_variable(self, name, value):
self.namespace.variables.set_global(name, value)
def report_suite_status(self, status, message):
self.get_current_vars()['${SUITE_STATUS}'] = status
self.get_current_vars()['${SUITE_MESSAGE}'] = message
def start_test(self, test):
self.namespace.start_test(test)
self.output.start_test(test)
def set_test_status_before_teardown(self, message, status):
self.namespace.set_test_status_before_teardown(message, status)
def get_handler(self, name):
return self.namespace.get_handler(name)
def start_keyword(self, keyword):
self.output.start_keyword(keyword)
def end_keyword(self, keyword):
self.output.end_keyword(keyword)
def warn(self, message):
self.output.warn(message)
def trace(self, message):
self.output.trace(message)
| ajibawa-2023/Python-Code-Large/train/row_99821 | 58 | 102 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99821:ImportFrom_L15_C0", "label": "from robot.variables import GLOBAL_VARIABLES", "type": "import", "loc": [15, 15], "level": 0, "parent": null, "vector": [1, 0, 0.1471, 0.0098, 0, 0.66, 0.0, 595, 0, 1, 0, 0, 595, 0, 0], "semantic": {"name": "robot.variables", "arg_names": [], "import_names": ["GLOBAL_VARIABLES"], "rhs_call_name": "", "annotation": ""}, "snippet": "from robot.variables import GLOBAL_VARIABLES"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99821:ClassDef_L18_C0", "label": "ExecutionContext", "type": "class", "loc": [18, 102], "level": 0, "parent": null, "vector": [3, 0, 0.5882, 0.8333, 0, 0.66, 1.0, 63, 0, 22, 0, 0, 186, 0, 22], "semantic": {"name": "ExecutionContext", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class ExecutionContext(object):\n\n def __init__(self, namespace, output, dry_run=False):\n self.namespace = namespace\n self.output = output\n self.dry_run = dry_run\n self._in_teardown = 0\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99821:FunctionDef_L20_C4", "label": "__init__", "type": "function", "loc": [20, 24], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99821:ClassDef_L18_C0", "vector": [2, 1, 0.2157, 0.049, 1, 0.92, 0.0, 555, 0, 4, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "namespace", "output", "dry_run"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, namespace, output, dry_run=False):\n self.namespace = namespace\n self.output = output\n self.dry_run = dry_run\n self._in_teardown = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99821:Assign_L21_C8", "label": "self.namespace =", "type": "assigned_variable", "loc": [21, 21], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99821:FunctionDef_L20_C4", "vector": [14, 2, 0.2059, 0.0098, 2, 0.1, 0.0, 313, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.namespace", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.namespace = namespace"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99821:Assign_L22_C8", "label": "self.output =", "type": "assigned_variable", "loc": [22, 22], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99821:FunctionDef_L20_C4", "vector": [14, 2, 0.2157, 0.0098, 2, 0.1, 0.3333, 815, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.output", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.output = output"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99821:Assign_L23_C8", "label": "self.dry_run =", "type": "assigned_variable", "loc": [23, 23], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99821:FunctionDef_L20_C4", "vector": [14, 2, 0.2255, 0.0098, 2, 0.1, 0.6667, 3, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.dry_run", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.dry_run = dry_run"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99821:Assign_L24_C8", "label": "self._in_teardown =", "type": "assigned_variable", "loc": [24, 24], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99821:FunctionDef_L20_C4", "vector": [14, 2, 0.2353, 0.0098, 2, 0.1, 1.0, 154, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self._in_teardown", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._in_teardown = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99821:FunctionDef_L27_C4", "label": "teardown", "type": "function", "loc": [27, 32], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99821:ClassDef_L18_C0", "vector": [2, 1, 0.2892, 0.0588, 1, 0.92, 0.0476, 572, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "teardown", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def teardown(self):\n if self._in_teardown:\n return True\n # TODO: tests and suites should also call start/end_teardown()\n test_or_suite = self.namespace.test or self.namespace.suite\n return test_or_suite.status != 'RUNNING'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99821:If_L28_C8", "label": "if", "type": "if", "loc": [28, 29], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99821:FunctionDef_L27_C4", "vector": [4, 2, 0.2794, 0.0196, 2, 0.12, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self._in_teardown:\n return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99821:Return_L29_C12", "label": "return", "type": "return", "loc": [29, 29], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99821:If_L28_C8", "vector": [13, 3, 0.2843, 0.0098, 3, 0.65, 0.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99821:Assign_L31_C8", "label": "test_or_suite =", "type": "assigned_variable", "loc": [31, 31], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99821:FunctionDef_L27_C4", "vector": [14, 2, 0.3039, 0.0098, 2, 0.12, 0.5, 229, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "test_or_suite", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " test_or_suite = self.namespace.test or self.namespace.suite"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99821:Return_L32_C8", "label": "return", "type": "return", "loc": [32, 32], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99821:FunctionDef_L27_C4", "vector": [13, 2, 0.3137, 0.0098, 2, 0.12, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return test_or_suite.status != 'RUNNING'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99821:FunctionDef_L34_C4", "label": "start_teardown", "type": "function", "loc": [34, 35], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99821:ClassDef_L18_C0", "vector": [2, 1, 0.3382, 0.0196, 1, 0.92, 0.0952, 712, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "start_teardown", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def start_teardown(self):\n self._in_teardown += 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99821:FunctionDef_L37_C4", "label": "end_teardown", "type": "function", "loc": [37, 38], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99821:ClassDef_L18_C0", "vector": [2, 1, 0.3676, 0.0196, 1, 0.92, 0.1429, 481, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "end_teardown", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def end_teardown(self):\n self._in_teardown -= 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99821:FunctionDef_L40_C4", "label": "get_current_vars", "type": "function", "loc": [40, 41], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99821:ClassDef_L18_C0", "vector": [2, 1, 0.3971, 0.0196, 1, 0.92, 0.1905, 356, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "get_current_vars", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_current_vars(self):\n return self.namespace.variables"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99821:Return_L41_C8", "label": "return", "type": "return", "loc": [41, 41], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99821:FunctionDef_L40_C4", "vector": [13, 2, 0.402, 0.0098, 2, 0.31, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.namespace.variables"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99821:FunctionDef_L43_C4", "label": "end_test", "type": "function", "loc": [43, 45], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99821:ClassDef_L18_C0", "vector": [2, 1, 0.4314, 0.0294, 1, 0.92, 0.2381, 220, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "end_test", "arg_names": ["self", "test"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def end_test(self, test):\n self.output.end_test(test)\n self.namespace.end_test()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99821:Expr_L44_C8", "label": "end_test()", "type": "expression", "loc": [44, 44], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99821:FunctionDef_L43_C4", "vector": [8, 2, 0.4314, 0.0098, 2, 0.81, 0.0, 220, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "end_test", "arg_names": [], "import_names": [], "rhs_call_name": "end_test", "annotation": ""}, "snippet": " self.output.end_test(test)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99821:Expr_L45_C8", "label": "end_test()", "type": "expression", "loc": [45, 45], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99821:FunctionDef_L43_C4", "vector": [8, 2, 0.4412, 0.0098, 2, 0.81, 1.0, 220, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "end_test", "arg_names": [], "import_names": [], "rhs_call_name": "end_test", "annotation": ""}, "snippet": " self.namespace.end_test()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99821:FunctionDef_L47_C4", "label": "end_suite", "type": "function", "loc": [47, 49], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99821:ClassDef_L18_C0", "vector": [2, 1, 0.4706, 0.0294, 1, 0.92, 0.2857, 81, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "end_suite", "arg_names": ["self", "suite"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def end_suite(self, suite):\n self.output.end_suite(suite)\n self.namespace.end_suite()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99821:Expr_L48_C8", "label": "end_suite()", "type": "expression", "loc": [48, 48], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99821:FunctionDef_L47_C4", "vector": [8, 2, 0.4706, 0.0098, 2, 0.16, 0.0, 81, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "end_suite", "arg_names": [], "import_names": [], "rhs_call_name": "end_suite", "annotation": ""}, "snippet": " self.output.end_suite(suite)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99821:Expr_L49_C8", "label": "end_suite()", "type": "expression", "loc": [49, 49], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99821:FunctionDef_L47_C4", "vector": [8, 2, 0.4804, 0.0098, 2, 0.16, 1.0, 81, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "end_suite", "arg_names": [], "import_names": [], "rhs_call_name": "end_suite", "annotation": ""}, "snippet": " self.namespace.end_suite()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99821:FunctionDef_L51_C4", "label": "output_file_changed", "type": "function", "loc": [51, 52], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99821:ClassDef_L18_C0", "vector": [2, 1, 0.5049, 0.0196, 1, 0.92, 0.3333, 720, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "output_file_changed", "arg_names": ["self", "filename"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def output_file_changed(self, filename):\n self._set_global_variable('${OUTPUT_FILE}', filename)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99821:Expr_L52_C8", "label": "_set_global_variable()", "type": "expression", "loc": [52, 52], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99821:FunctionDef_L51_C4", "vector": [8, 2, 0.5098, 0.0098, 2, 0.66, 0.0, 26, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "_set_global_variable", "arg_names": [], "import_names": [], "rhs_call_name": "_set_global_variable", "annotation": ""}, "snippet": " self._set_global_variable('${OUTPUT_FILE}', filename)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99821:FunctionDef_L54_C4", "label": "replace_vars_from_setting", "type": "function", "loc": [54, 55], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99821:ClassDef_L18_C0", "vector": [2, 1, 0.5343, 0.0196, 1, 0.92, 0.381, 782, 0, 4, 1, 0, 0, 0, 1], "semantic": {"name": "replace_vars_from_setting", "arg_names": ["self", "name", "value", "errors"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def replace_vars_from_setting(self, name, value, errors):\n return self.namespace.variables.replace_meta(name, value, errors)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99821:Return_L55_C8", "label": "return", "type": "return", "loc": [55, 55], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99821:FunctionDef_L54_C4", "vector": [13, 2, 0.5392, 0.0098, 2, 0.62, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.namespace.variables.replace_meta(name, value, errors)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99821:FunctionDef_L57_C4", "label": "log_file_changed", "type": "function", "loc": [57, 58], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99821:ClassDef_L18_C0", "vector": [2, 1, 0.5637, 0.0196, 1, 0.92, 0.4286, 929, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "log_file_changed", "arg_names": ["self", "filename"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def log_file_changed(self, filename):\n self._set_global_variable('${LOG_FILE}', filename)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99821:Expr_L58_C8", "label": "_set_global_variable()", "type": "expression", "loc": [58, 58], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99821:FunctionDef_L57_C4", "vector": [8, 2, 0.5686, 0.0098, 2, 0.05, 0.0, 26, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "_set_global_variable", "arg_names": [], "import_names": [], "rhs_call_name": "_set_global_variable", "annotation": ""}, "snippet": " self._set_global_variable('${LOG_FILE}', filename)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99821:FunctionDef_L60_C4", "label": "set_prev_test_variables", "type": "function", "loc": [60, 62], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99821:ClassDef_L18_C0", "vector": [2, 1, 0.598, 0.0294, 1, 0.92, 0.4762, 668, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "set_prev_test_variables", "arg_names": ["self", "test"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def set_prev_test_variables(self, test):\n self._set_prev_test_variables(self.get_current_vars(), test.name,\n test.status, test.message)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99821:Expr_L61_C8", "label": "_set_prev_test_variables()", "type": "expression", "loc": [61, 62], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99821:FunctionDef_L60_C4", "vector": [8, 2, 0.6029, 0.0196, 2, 0.64, 0.0, 57, 3, 4, 0, 0, 0, 0, 2], "semantic": {"name": "_set_prev_test_variables", "arg_names": [], "import_names": [], "rhs_call_name": "_set_prev_test_variables", "annotation": ""}, "snippet": " self._set_prev_test_variables(self.get_current_vars(), test.name,\n test.status, test.message)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99821:FunctionDef_L64_C4", "label": "copy_prev_test_vars_to_global", "type": "function", "loc": [64, 68], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99821:ClassDef_L18_C0", "vector": [2, 1, 0.6471, 0.049, 1, 0.92, 0.5238, 864, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "copy_prev_test_vars_to_global", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def copy_prev_test_vars_to_global(self):\n varz = self.get_current_vars()\n name, status, message = varz['${PREV_TEST_NAME}'], \\\n varz['${PREV_TEST_STATUS}'], varz['${PREV_TEST_MESSAGE}']\n self._set_prev_test_variables(GLOBAL_VARIABLES, name, status, message)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99821:Assign_L65_C8", "label": "varz = get_current_vars()", "type": "assigned_variable", "loc": [65, 65], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99821:FunctionDef_L64_C4", "vector": [14, 2, 0.6373, 0.0098, 2, 0.91, 0.0, 120, 3, 0, 0, 0, 356, 10, 1], "semantic": {"name": "varz", "arg_names": [], "import_names": [], "rhs_call_name": "get_current_vars", "annotation": ""}, "snippet": " varz = self.get_current_vars()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99821:Assign_L66_C8", "label": "name, status, message =", "type": "assigned_variable", "loc": [66, 67], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99821:FunctionDef_L64_C4", "vector": [14, 2, 0.652, 0.0196, 2, 0.91, 0.5, 509, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "name, status, message", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " name, status, message = varz['${PREV_TEST_NAME}'], \\\n varz['${PREV_TEST_STATUS}'], varz['${PREV_TEST_MESSAGE}']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99821:Expr_L68_C8", "label": "_set_prev_test_variables()", "type": "expression", "loc": [68, 68], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99821:FunctionDef_L64_C4", "vector": [8, 2, 0.6667, 0.0098, 2, 0.91, 1.0, 57, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "_set_prev_test_variables", "arg_names": [], "import_names": [], "rhs_call_name": "_set_prev_test_variables", "annotation": ""}, "snippet": " self._set_prev_test_variables(GLOBAL_VARIABLES, name, status, message)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99821:FunctionDef_L70_C4", "label": "_set_prev_test_variables", "type": "function", "loc": [70, 73], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99821:ClassDef_L18_C0", "vector": [2, 1, 0.701, 0.0392, 1, 0.92, 0.5714, 57, 0, 5, 0, 0, 0, 0, 0], "semantic": {"name": "_set_prev_test_variables", "arg_names": ["self", "destination", "name", "status", "message"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _set_prev_test_variables(self, destination, name, status, message):\n destination['${PREV_TEST_NAME}'] = name\n destination['${PREV_TEST_STATUS}'] = status\n destination['${PREV_TEST_MESSAGE}'] = message"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99821:Assign_L71_C8", "label": "assign", "type": "assigned_variable", "loc": [71, 71], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99821:FunctionDef_L70_C4", "vector": [14, 2, 0.6961, 0.0098, 2, 0.72, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " destination['${PREV_TEST_NAME}'] = name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99821:Assign_L72_C8", "label": "assign", "type": "assigned_variable", "loc": [72, 72], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99821:FunctionDef_L70_C4", "vector": [14, 2, 0.7059, 0.0098, 2, 0.72, 0.5, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " destination['${PREV_TEST_STATUS}'] = status"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99821:Assign_L73_C8", "label": "assign", "type": "assigned_variable", "loc": [73, 73], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99821:FunctionDef_L70_C4", "vector": [14, 2, 0.7157, 0.0098, 2, 0.72, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " destination['${PREV_TEST_MESSAGE}'] = message"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99821:FunctionDef_L75_C4", "label": "_set_global_variable", "type": "function", "loc": [75, 76], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99821:ClassDef_L18_C0", "vector": [2, 1, 0.7402, 0.0196, 1, 0.92, 0.619, 26, 0, 3, 0, 0, 0, 0, 1], "semantic": {"name": "_set_global_variable", "arg_names": ["self", "name", "value"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _set_global_variable(self, name, value):\n self.namespace.variables.set_global(name, value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99821:Expr_L76_C8", "label": "set_global()", "type": "expression", "loc": [76, 76], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99821:FunctionDef_L75_C4", "vector": [8, 2, 0.7451, 0.0098, 2, 0.54, 0.0, 85, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "set_global", "arg_names": [], "import_names": [], "rhs_call_name": "set_global", "annotation": ""}, "snippet": " self.namespace.variables.set_global(name, value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99821:FunctionDef_L78_C4", "label": "report_suite_status", "type": "function", "loc": [78, 80], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99821:ClassDef_L18_C0", "vector": [2, 1, 0.7745, 0.0294, 1, 0.92, 0.6667, 902, 0, 3, 0, 0, 0, 0, 2], "semantic": {"name": "report_suite_status", "arg_names": ["self", "status", "message"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def report_suite_status(self, status, message):\n self.get_current_vars()['${SUITE_STATUS}'] = status\n self.get_current_vars()['${SUITE_MESSAGE}'] = message"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99821:Assign_L79_C8", "label": "assign", "type": "assigned_variable", "loc": [79, 79], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99821:FunctionDef_L78_C4", "vector": [14, 2, 0.7745, 0.0098, 2, 0.63, 0.0, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.get_current_vars()['${SUITE_STATUS}'] = status"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99821:Assign_L80_C8", "label": "assign", "type": "assigned_variable", "loc": [80, 80], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99821:FunctionDef_L78_C4", "vector": [14, 2, 0.7843, 0.0098, 2, 0.63, 1.0, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.get_current_vars()['${SUITE_MESSAGE}'] = message"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99821:FunctionDef_L82_C4", "label": "start_test", "type": "function", "loc": [82, 84], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99821:ClassDef_L18_C0", "vector": [2, 1, 0.8137, 0.0294, 1, 0.92, 0.7143, 246, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "start_test", "arg_names": ["self", "test"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def start_test(self, test):\n self.namespace.start_test(test)\n self.output.start_test(test)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99821:Expr_L83_C8", "label": "start_test()", "type": "expression", "loc": [83, 83], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99821:FunctionDef_L82_C4", "vector": [8, 2, 0.8137, 0.0098, 2, 0.82, 0.0, 246, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "start_test", "arg_names": [], "import_names": [], "rhs_call_name": "start_test", "annotation": ""}, "snippet": " self.namespace.start_test(test)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99821:Expr_L84_C8", "label": "start_test()", "type": "expression", "loc": [84, 84], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99821:FunctionDef_L82_C4", "vector": [8, 2, 0.8235, 0.0098, 2, 0.82, 1.0, 246, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "start_test", "arg_names": [], "import_names": [], "rhs_call_name": "start_test", "annotation": ""}, "snippet": " self.output.start_test(test)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99821:FunctionDef_L86_C4", "label": "set_test_status_before_teardown", "type": "function", "loc": [86, 87], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99821:ClassDef_L18_C0", "vector": [2, 1, 0.848, 0.0196, 1, 0.92, 0.7619, 196, 0, 3, 0, 0, 0, 0, 1], "semantic": {"name": "set_test_status_before_teardown", "arg_names": ["self", "message", "status"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def set_test_status_before_teardown(self, message, status):\n self.namespace.set_test_status_before_teardown(message, status)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99821:Expr_L87_C8", "label": "set_test_status_before_teardown()", "type": "expression", "loc": [87, 87], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99821:FunctionDef_L86_C4", "vector": [8, 2, 0.8529, 0.0098, 2, 0.88, 0.0, 196, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "set_test_status_before_teardown", "arg_names": [], "import_names": [], "rhs_call_name": "set_test_status_before_teardown", "annotation": ""}, "snippet": " self.namespace.set_test_status_before_teardown(message, status)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99821:FunctionDef_L89_C4", "label": "get_handler", "type": "function", "loc": [89, 90], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99821:ClassDef_L18_C0", "vector": [2, 1, 0.8775, 0.0196, 1, 0.92, 0.8095, 636, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "get_handler", "arg_names": ["self", "name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_handler(self, name):\n return self.namespace.get_handler(name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99821:Return_L90_C8", "label": "return", "type": "return", "loc": [90, 90], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99821:FunctionDef_L89_C4", "vector": [13, 2, 0.8824, 0.0098, 2, 0.76, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.namespace.get_handler(name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99821:FunctionDef_L92_C4", "label": "start_keyword", "type": "function", "loc": [92, 93], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99821:ClassDef_L18_C0", "vector": [2, 1, 0.9069, 0.0196, 1, 0.92, 0.8571, 776, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "start_keyword", "arg_names": ["self", "keyword"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def start_keyword(self, keyword):\n self.output.start_keyword(keyword)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99821:Expr_L93_C8", "label": "start_keyword()", "type": "expression", "loc": [93, 93], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99821:FunctionDef_L92_C4", "vector": [8, 2, 0.9118, 0.0098, 2, 0.26, 0.0, 776, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "start_keyword", "arg_names": [], "import_names": [], "rhs_call_name": "start_keyword", "annotation": ""}, "snippet": " self.output.start_keyword(keyword)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99821:FunctionDef_L95_C4", "label": "end_keyword", "type": "function", "loc": [95, 96], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99821:ClassDef_L18_C0", "vector": [2, 1, 0.9363, 0.0196, 1, 0.92, 0.9048, 959, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "end_keyword", "arg_names": ["self", "keyword"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def end_keyword(self, keyword):\n self.output.end_keyword(keyword)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99821:Expr_L96_C8", "label": "end_keyword()", "type": "expression", "loc": [96, 96], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99821:FunctionDef_L95_C4", "vector": [8, 2, 0.9412, 0.0098, 2, 0.5, 0.0, 959, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "end_keyword", "arg_names": [], "import_names": [], "rhs_call_name": "end_keyword", "annotation": ""}, "snippet": " self.output.end_keyword(keyword)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99821:FunctionDef_L98_C4", "label": "warn", "type": "function", "loc": [98, 99], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99821:ClassDef_L18_C0", "vector": [2, 1, 0.9657, 0.0196, 1, 0.92, 0.9524, 960, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "warn", "arg_names": ["self", "message"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def warn(self, message):\n self.output.warn(message)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99821:Expr_L99_C8", "label": "warn()", "type": "expression", "loc": [99, 99], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99821:FunctionDef_L98_C4", "vector": [8, 2, 0.9706, 0.0098, 2, 0.49, 0.0, 960, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "warn", "arg_names": [], "import_names": [], "rhs_call_name": "warn", "annotation": ""}, "snippet": " self.output.warn(message)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99821:FunctionDef_L101_C4", "label": "trace", "type": "function", "loc": [101, 102], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99821:ClassDef_L18_C0", "vector": [2, 1, 0.9951, 0.0196, 1, 0.92, 1.0, 211, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "trace", "arg_names": ["self", "message"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def trace(self, message):\n self.output.trace(message)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99821:Expr_L102_C8", "label": "trace()", "type": "expression", "loc": [102, 102], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99821:FunctionDef_L101_C4", "vector": [8, 2, 1.0, 0.0098, 2, 0.68, 0.0, 211, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "trace", "arg_names": [], "import_names": [], "rhs_call_name": "trace", "annotation": ""}, "snippet": " self.output.trace(message)"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99821:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99821:FunctionDef_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99821:FunctionDef_L20_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99821:Assign_L21_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99821:FunctionDef_L20_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99821:Assign_L22_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99821:FunctionDef_L20_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99821:Assign_L23_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99821:FunctionDef_L20_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99821:Assign_L24_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99821:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99821:FunctionDef_L27_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99821:FunctionDef_L27_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99821:If_L28_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99821:If_L28_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99821:Return_L29_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99821:FunctionDef_L27_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99821:Assign_L31_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99821:FunctionDef_L27_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99821:Return_L32_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99821:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99821:FunctionDef_L34_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99821:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99821:FunctionDef_L37_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99821:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99821:FunctionDef_L40_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99821:FunctionDef_L40_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99821:Return_L41_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99821:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99821:FunctionDef_L43_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99821:FunctionDef_L43_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99821:Expr_L44_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99821:FunctionDef_L43_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99821:Expr_L45_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99821:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99821:FunctionDef_L47_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99821:FunctionDef_L47_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99821:Expr_L48_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99821:FunctionDef_L47_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99821:Expr_L49_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99821:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99821:FunctionDef_L51_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99821:FunctionDef_L51_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99821:Expr_L52_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99821:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99821:FunctionDef_L54_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99821:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99821:Return_L55_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99821:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99821:FunctionDef_L57_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99821:FunctionDef_L57_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99821:Expr_L58_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99821:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99821:FunctionDef_L60_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99821:FunctionDef_L60_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99821:Expr_L61_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99821:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99821:FunctionDef_L64_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99821:FunctionDef_L64_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99821:Assign_L65_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99821:FunctionDef_L64_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99821:Assign_L66_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99821:FunctionDef_L64_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99821:Expr_L68_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99821:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99821:FunctionDef_L70_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99821:FunctionDef_L70_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99821:Assign_L71_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99821:FunctionDef_L70_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99821:Assign_L72_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99821:FunctionDef_L70_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99821:Assign_L73_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99821:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99821:FunctionDef_L75_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99821:FunctionDef_L75_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99821:Expr_L76_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99821:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99821:FunctionDef_L78_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99821:FunctionDef_L78_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99821:Assign_L79_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99821:FunctionDef_L78_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99821:Assign_L80_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99821:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99821:FunctionDef_L82_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99821:FunctionDef_L82_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99821:Expr_L83_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99821:FunctionDef_L82_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99821:Expr_L84_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99821:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99821:FunctionDef_L86_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99821:FunctionDef_L86_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99821:Expr_L87_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99821:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99821:FunctionDef_L89_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99821:FunctionDef_L89_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99821:Return_L90_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99821:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99821:FunctionDef_L92_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99821:FunctionDef_L92_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99821:Expr_L93_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99821:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99821:FunctionDef_L95_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99821:FunctionDef_L95_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99821:Expr_L96_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99821:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99821:FunctionDef_L98_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99821:FunctionDef_L98_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99821:Expr_L99_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99821:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99821:FunctionDef_L101_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99821:FunctionDef_L101_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99821:Expr_L102_C8"}] |
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import os.path
import copy
from robot.output import LOGGER
from robot.parsing import ResourceFile
from robot.errors import FrameworkError
from robot import utils
from testlibraries import TestLibrary
class Importer:
def __init__(self):
self._library_cache = ImportCache()
self._resource_cache = ImportCache()
def import_library(self, name, args, alias, variables):
lib = TestLibrary(name, args, variables, create_handlers=False)
positional, named = lib.positional_args, lib.named_args
lib = self._import_library(name, positional, named, lib)
if alias and name != alias:
lib = self._copy_library(lib, alias)
LOGGER.info("Imported library '%s' with name '%s'" % (name, alias))
return lib
def import_resource(self, path):
if path in self._resource_cache:
LOGGER.info("Found resource file '%s' from cache" % path)
else:
resource = ResourceFile(path)
self._resource_cache[path] = resource
return self._resource_cache[path]
def _import_library(self, name, positional, named, lib):
key = (name, positional, named)
if key in self._library_cache:
LOGGER.info("Found test library '%s' with arguments %s from cache"
% (name, utils.seq2str2(positional)))
return self._library_cache[key]
lib.create_handlers()
self._library_cache[key] = lib
libtype = lib.__class__.__name__.replace('Library', '').lower()[1:]
LOGGER.info("Imported library '%s' with arguments %s (version %s, "
"%s type, %s scope, %d keywords, source %s)"
% (name, utils.seq2str2(positional), lib.version, libtype,
lib.scope.lower(), len(lib), lib.source))
if len(lib) == 0:
LOGGER.warn("Imported library '%s' contains no keywords" % name)
return lib
def _copy_library(self, lib, newname):
libcopy = copy.copy(lib)
libcopy.name = newname
libcopy.init_scope_handling()
libcopy.handlers = utils.NormalizedDict(ignore=['_'])
for handler in lib.handlers.values():
handcopy = copy.copy(handler)
handcopy.library = libcopy
libcopy.handlers[handler.name] = handcopy
return libcopy
class ImportCache:
"""Keeps track on and optionally caches imported items.
Handles paths in keys case-insensitively on case-insensitive OSes.
Unlike dicts, this storage accepts mutable values in keys.
"""
def __init__(self):
self._keys = []
self._items = []
def __setitem__(self, key, item):
if not isinstance(key, (basestring, tuple)):
raise FrameworkError('Invalid key for ImportCache')
self._keys.append(self._norm_path_key(key))
self._items.append(item)
def add(self, key, item=None):
self.__setitem__(key, item)
def __getitem__(self, key):
key = self._norm_path_key(key)
if key not in self._keys:
raise KeyError
return self._items[self._keys.index(key)]
def __contains__(self, key):
return self._norm_path_key(key) in self._keys
def _norm_path_key(self, key):
if isinstance(key, tuple):
return tuple(self._norm_path_key(k) for k in key)
if isinstance(key, basestring) and os.path.exists(key):
return utils.normpath(key)
return key
| ajibawa-2023/Python-Code-Large/train/row_99823 | 70 | 112 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99823:Import_L15_C0", "label": "os.path import os.path", "type": "import", "loc": [15, 15], "level": 0, "parent": null, "vector": [1, 0, 0.1339, 0.0089, 0, 0.66, 0.0, 79, 0, 1, 0, 0, 79, 0, 0], "semantic": {"name": "os.path", "arg_names": [], "import_names": ["os.path"], "rhs_call_name": "", "annotation": ""}, "snippet": "import os.path"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99823:Import_L16_C0", "label": "copy import copy", "type": "import", "loc": [16, 16], "level": 0, "parent": null, "vector": [1, 0, 0.1429, 0.0089, 0, 0.66, 0.125, 739, 0, 1, 0, 0, 739, 0, 0], "semantic": {"name": "copy", "arg_names": [], "import_names": ["copy"], "rhs_call_name": "", "annotation": ""}, "snippet": "import copy"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99823:ImportFrom_L18_C0", "label": "from robot.output import LOGGER", "type": "import", "loc": [18, 18], "level": 0, "parent": null, "vector": [1, 0, 0.1607, 0.0089, 0, 0.66, 0.25, 596, 0, 1, 0, 0, 596, 0, 0], "semantic": {"name": "robot.output", "arg_names": [], "import_names": ["LOGGER"], "rhs_call_name": "", "annotation": ""}, "snippet": "from robot.output import LOGGER"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99823:ImportFrom_L19_C0", "label": "from robot.parsing import ResourceFile", "type": "import", "loc": [19, 19], "level": 0, "parent": null, "vector": [1, 0, 0.1696, 0.0089, 0, 0.66, 0.375, 990, 0, 1, 0, 0, 990, 0, 0], "semantic": {"name": "robot.parsing", "arg_names": [], "import_names": ["ResourceFile"], "rhs_call_name": "", "annotation": ""}, "snippet": "from robot.parsing import ResourceFile"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99823:ImportFrom_L20_C0", "label": "from robot.errors import FrameworkError", "type": "import", "loc": [20, 20], "level": 0, "parent": null, "vector": [1, 0, 0.1786, 0.0089, 0, 0.66, 0.5, 299, 0, 1, 0, 0, 299, 0, 0], "semantic": {"name": "robot.errors", "arg_names": [], "import_names": ["FrameworkError"], "rhs_call_name": "", "annotation": ""}, "snippet": "from robot.errors import FrameworkError"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99823:ImportFrom_L21_C0", "label": "from robot import utils", "type": "import", "loc": [21, 21], "level": 0, "parent": null, "vector": [1, 0, 0.1875, 0.0089, 0, 0.66, 0.625, 735, 0, 1, 0, 0, 735, 0, 0], "semantic": {"name": "robot", "arg_names": [], "import_names": ["utils"], "rhs_call_name": "", "annotation": ""}, "snippet": "from robot import utils"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99823:ImportFrom_L23_C0", "label": "from testlibraries import TestLibrary", "type": "import", "loc": [23, 23], "level": 0, "parent": null, "vector": [1, 0, 0.2054, 0.0089, 0, 0.66, 0.75, 497, 0, 1, 0, 0, 497, 0, 0], "semantic": {"name": "testlibraries", "arg_names": [], "import_names": ["TestLibrary"], "rhs_call_name": "", "annotation": ""}, "snippet": "from testlibraries import TestLibrary"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99823:ClassDef_L26_C0", "label": "Importer", "type": "class", "loc": [26, 75], "level": 0, "parent": null, "vector": [3, 0, 0.4509, 0.4464, 0, 0.66, 0.875, 75, 0, 5, 0, 0, 0, 0, 24], "semantic": {"name": "Importer", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Importer:\n\n def __init__(self):\n self._library_cache = ImportCache()\n self._resource_cache = ImportCache()\n\n def import_library(self, name, args, alias, variables):\n lib = TestLibrary(name, args, variables, create_handlers=False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99823:FunctionDef_L28_C4", "label": "__init__", "type": "function", "loc": [28, 30], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99823:ClassDef_L26_C0", "vector": [2, 1, 0.2589, 0.0268, 1, 0.96, 0.0, 555, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self):\n self._library_cache = ImportCache()\n self._resource_cache = ImportCache()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99823:Assign_L29_C8", "label": "self._library_cache = ImportCache()", "type": "assigned_variable", "loc": [29, 29], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99823:FunctionDef_L28_C4", "vector": [14, 2, 0.2589, 0.0089, 2, 0.1, 0.0, 634, 3, 0, 0, 0, 737, 10, 1], "semantic": {"name": "self._library_cache", "arg_names": [], "import_names": [], "rhs_call_name": "ImportCache", "annotation": ""}, "snippet": " self._library_cache = ImportCache()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99823:Assign_L30_C8", "label": "self._resource_cache = ImportCache()", "type": "assigned_variable", "loc": [30, 30], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99823:FunctionDef_L28_C4", "vector": [14, 2, 0.2679, 0.0089, 2, 0.1, 1.0, 409, 3, 0, 0, 0, 737, 10, 1], "semantic": {"name": "self._resource_cache", "arg_names": [], "import_names": [], "rhs_call_name": "ImportCache", "annotation": ""}, "snippet": " self._resource_cache = ImportCache()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99823:FunctionDef_L32_C4", "label": "import_library", "type": "function", "loc": [32, 39], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99823:ClassDef_L26_C0", "vector": [2, 1, 0.317, 0.0714, 1, 0.96, 0.25, 507, 0, 5, 1, 0, 0, 0, 4], "semantic": {"name": "import_library", "arg_names": ["self", "name", "args", "alias", "variables"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def import_library(self, name, args, alias, variables):\n lib = TestLibrary(name, args, variables, create_handlers=False)\n positional, named = lib.positional_args, lib.named_args\n lib = self._import_library(name, positional, named, lib)\n if alias and name != alias:\n lib = self._copy_library(lib, alias)\n LOGGER.info(\"Imported library '%s' with name '%s'\" % (name, alias))\n return lib"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99823:Assign_L33_C8", "label": "lib = TestLibrary()", "type": "assigned_variable", "loc": [33, 33], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99823:FunctionDef_L32_C4", "vector": [14, 2, 0.2946, 0.0089, 2, 0.87, 0.0, 115, 3, 4, 0, 0, 300, 10, 1], "semantic": {"name": "lib", "arg_names": [], "import_names": [], "rhs_call_name": "TestLibrary", "annotation": ""}, "snippet": " lib = TestLibrary(name, args, variables, create_handlers=False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99823:Assign_L34_C8", "label": "positional, named =", "type": "assigned_variable", "loc": [34, 34], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99823:FunctionDef_L32_C4", "vector": [14, 2, 0.3036, 0.0089, 2, 0.87, 0.25, 437, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "positional, named", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " positional, named = lib.positional_args, lib.named_args"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99823:Assign_L35_C8", "label": "lib = _import_library()", "type": "assigned_variable", "loc": [35, 35], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99823:FunctionDef_L32_C4", "vector": [14, 2, 0.3125, 0.0089, 2, 0.87, 0.5, 115, 3, 4, 0, 0, 143, 10, 1], "semantic": {"name": "lib", "arg_names": [], "import_names": [], "rhs_call_name": "_import_library", "annotation": ""}, "snippet": " lib = self._import_library(name, positional, named, lib)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99823:If_L36_C8", "label": "if", "type": "if", "loc": [36, 38], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99823:FunctionDef_L32_C4", "vector": [4, 2, 0.3304, 0.0268, 2, 0.87, 0.75, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if alias and name != alias:\n lib = self._copy_library(lib, alias)\n LOGGER.info(\"Imported library '%s' with name '%s'\" % (name, alias))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99823:Assign_L37_C12", "label": "lib = _copy_library()", "type": "assigned_variable", "loc": [37, 37], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99823:If_L36_C8", "vector": [14, 3, 0.3304, 0.0089, 3, 0.22, 0.0, 115, 3, 2, 0, 0, 646, 10, 1], "semantic": {"name": "lib", "arg_names": [], "import_names": [], "rhs_call_name": "_copy_library", "annotation": ""}, "snippet": " lib = self._copy_library(lib, alias)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99823:Expr_L38_C12", "label": "info()", "type": "expression", "loc": [38, 38], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99823:If_L36_C8", "vector": [8, 3, 0.3393, 0.0089, 3, 0.22, 1.0, 730, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "info", "arg_names": [], "import_names": [], "rhs_call_name": "info", "annotation": ""}, "snippet": " LOGGER.info(\"Imported library '%s' with name '%s'\" % (name, alias))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99823:Return_L39_C8", "label": "return", "type": "return", "loc": [39, 39], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99823:FunctionDef_L32_C4", "vector": [13, 2, 0.3482, 0.0089, 2, 0.87, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return lib"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99823:FunctionDef_L41_C4", "label": "import_resource", "type": "function", "loc": [41, 47], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99823:ClassDef_L26_C0", "vector": [2, 1, 0.3929, 0.0625, 1, 0.96, 0.5, 277, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "import_resource", "arg_names": ["self", "path"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def import_resource(self, path):\n if path in self._resource_cache:\n LOGGER.info(\"Found resource file '%s' from cache\" % path)\n else:\n resource = ResourceFile(path)\n self._resource_cache[path] = resource\n return self._resource_cache[path]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99823:If_L42_C8", "label": "if", "type": "if", "loc": [42, 46], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99823:FunctionDef_L41_C4", "vector": [4, 2, 0.3929, 0.0446, 2, 0.51, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if path in self._resource_cache:\n LOGGER.info(\"Found resource file '%s' from cache\" % path)\n else:\n resource = ResourceFile(path)\n self._resource_cache[path] = resource"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99823:Expr_L43_C12", "label": "info()", "type": "expression", "loc": [43, 43], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99823:If_L42_C8", "vector": [8, 3, 0.3839, 0.0089, 3, 0.83, 0.0, 730, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "info", "arg_names": [], "import_names": [], "rhs_call_name": "info", "annotation": ""}, "snippet": " LOGGER.info(\"Found resource file '%s' from cache\" % path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99823:Assign_L45_C12", "label": "resource = ResourceFile()", "type": "assigned_variable", "loc": [45, 45], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99823:If_L42_C8", "vector": [14, 3, 0.4018, 0.0089, 3, 0.83, 0.5, 559, 3, 1, 0, 0, 764, 10, 1], "semantic": {"name": "resource", "arg_names": [], "import_names": [], "rhs_call_name": "ResourceFile", "annotation": ""}, "snippet": " resource = ResourceFile(path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99823:Assign_L46_C12", "label": "assign", "type": "assigned_variable", "loc": [46, 46], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99823:If_L42_C8", "vector": [14, 3, 0.4107, 0.0089, 3, 0.83, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._resource_cache[path] = resource"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99823:Return_L47_C8", "label": "return", "type": "return", "loc": [47, 47], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99823:FunctionDef_L41_C4", "vector": [13, 2, 0.4196, 0.0089, 2, 0.51, 1.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._resource_cache[path]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99823:FunctionDef_L49_C4", "label": "_import_library", "type": "function", "loc": [49, 64], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99823:ClassDef_L26_C0", "vector": [2, 1, 0.5045, 0.1429, 1, 0.96, 0.75, 143, 0, 5, 1, 0, 0, 0, 11], "semantic": {"name": "_import_library", "arg_names": ["self", "name", "positional", "named", "lib"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _import_library(self, name, positional, named, lib):\n key = (name, positional, named)\n if key in self._library_cache:\n LOGGER.info(\"Found test library '%s' with arguments %s from cache\"\n % (name, utils.seq2str2(positional)))\n return self._library_cache[key]\n lib.create_handlers()\n self._library_cache[key] = lib"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99823:Assign_L50_C8", "label": "key =", "type": "assigned_variable", "loc": [50, 50], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99823:FunctionDef_L49_C4", "vector": [14, 2, 0.4464, 0.0089, 2, 0.1, 0.0, 230, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "key", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " key = (name, positional, named)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99823:If_L51_C8", "label": "if", "type": "if", "loc": [51, 54], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99823:FunctionDef_L49_C4", "vector": [4, 2, 0.4688, 0.0357, 2, 0.1, 0.1429, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if key in self._library_cache:\n LOGGER.info(\"Found test library '%s' with arguments %s from cache\"\n % (name, utils.seq2str2(positional)))\n return self._library_cache[key]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99823:Expr_L52_C12", "label": "info()", "type": "expression", "loc": [52, 53], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99823:If_L51_C8", "vector": [8, 3, 0.4688, 0.0179, 3, 0.9, 0.0, 730, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "info", "arg_names": [], "import_names": [], "rhs_call_name": "info", "annotation": ""}, "snippet": " LOGGER.info(\"Found test library '%s' with arguments %s from cache\"\n % (name, utils.seq2str2(positional)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99823:Return_L54_C12", "label": "return", "type": "return", "loc": [54, 54], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99823:If_L51_C8", "vector": [13, 3, 0.4821, 0.0089, 3, 0.9, 1.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._library_cache[key]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99823:Expr_L55_C8", "label": "create_handlers()", "type": "expression", "loc": [55, 55], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99823:FunctionDef_L49_C4", "vector": [8, 2, 0.4911, 0.0089, 2, 0.1, 0.2857, 457, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "create_handlers", "arg_names": [], "import_names": [], "rhs_call_name": "create_handlers", "annotation": ""}, "snippet": " lib.create_handlers()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99823:Assign_L56_C8", "label": "assign", "type": "assigned_variable", "loc": [56, 56], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99823:FunctionDef_L49_C4", "vector": [14, 2, 0.5, 0.0089, 2, 0.1, 0.4286, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._library_cache[key] = lib"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99823:Assign_L57_C8", "label": "libtype =", "type": "assigned_variable", "loc": [57, 57], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99823:FunctionDef_L49_C4", "vector": [14, 2, 0.5089, 0.0089, 2, 0.1, 0.5714, 523, 6, 0, 0, 0, 0, 0, 2], "semantic": {"name": "libtype", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " libtype = lib.__class__.__name__.replace('Library', '').lower()[1:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99823:Expr_L58_C8", "label": "info()", "type": "expression", "loc": [58, 61], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99823:FunctionDef_L49_C4", "vector": [8, 2, 0.5312, 0.0357, 2, 0.1, 0.7143, 730, 3, 1, 0, 0, 0, 0, 4], "semantic": {"name": "info", "arg_names": [], "import_names": [], "rhs_call_name": "info", "annotation": ""}, "snippet": " LOGGER.info(\"Imported library '%s' with arguments %s (version %s, \"\n \"%s type, %s scope, %d keywords, source %s)\"\n % (name, utils.seq2str2(positional), lib.version, libtype,\n lib.scope.lower(), len(lib), lib.source))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99823:If_L62_C8", "label": "if", "type": "if", "loc": [62, 63], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99823:FunctionDef_L49_C4", "vector": [4, 2, 0.558, 0.0179, 2, 0.1, 0.8571, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(lib) == 0:\n LOGGER.warn(\"Imported library '%s' contains no keywords\" % name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99823:Expr_L63_C12", "label": "warn()", "type": "expression", "loc": [63, 63], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99823:If_L62_C8", "vector": [8, 3, 0.5625, 0.0089, 3, 0.8, 0.0, 960, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "warn", "arg_names": [], "import_names": [], "rhs_call_name": "warn", "annotation": ""}, "snippet": " LOGGER.warn(\"Imported library '%s' contains no keywords\" % name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99823:Return_L64_C8", "label": "return", "type": "return", "loc": [64, 64], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99823:FunctionDef_L49_C4", "vector": [13, 2, 0.5714, 0.0089, 2, 0.1, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return lib"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99823:FunctionDef_L66_C4", "label": "_copy_library", "type": "function", "loc": [66, 75], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99823:ClassDef_L26_C0", "vector": [2, 1, 0.6295, 0.0893, 1, 0.96, 1.0, 646, 0, 3, 1, 0, 0, 0, 5], "semantic": {"name": "_copy_library", "arg_names": ["self", "lib", "newname"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _copy_library(self, lib, newname):\n libcopy = copy.copy(lib)\n libcopy.name = newname\n libcopy.init_scope_handling()\n libcopy.handlers = utils.NormalizedDict(ignore=['_'])\n for handler in lib.handlers.values():\n handcopy = copy.copy(handler)\n handcopy.library = libcopy"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99823:Assign_L67_C8", "label": "libcopy = copy()", "type": "assigned_variable", "loc": [67, 67], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99823:FunctionDef_L66_C4", "vector": [14, 2, 0.5982, 0.0089, 2, 0.1, 0.0, 489, 3, 1, 0, 0, 739, 10, 1], "semantic": {"name": "libcopy", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " libcopy = copy.copy(lib)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99823:Assign_L68_C8", "label": "libcopy.name =", "type": "assigned_variable", "loc": [68, 68], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99823:FunctionDef_L66_C4", "vector": [14, 2, 0.6071, 0.0089, 2, 0.1, 0.2, 39, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "libcopy.name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " libcopy.name = newname"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99823:Expr_L69_C8", "label": "init_scope_handling()", "type": "expression", "loc": [69, 69], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99823:FunctionDef_L66_C4", "vector": [8, 2, 0.6161, 0.0089, 2, 0.1, 0.4, 956, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "init_scope_handling", "arg_names": [], "import_names": [], "rhs_call_name": "init_scope_handling", "annotation": ""}, "snippet": " libcopy.init_scope_handling()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99823:Assign_L70_C8", "label": "libcopy.handlers = NormalizedDict()", "type": "assigned_variable", "loc": [70, 70], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99823:FunctionDef_L66_C4", "vector": [14, 2, 0.625, 0.0089, 2, 0.1, 0.6, 648, 3, 1, 0, 0, 696, 10, 1], "semantic": {"name": "libcopy.handlers", "arg_names": [], "import_names": [], "rhs_call_name": "NormalizedDict", "annotation": ""}, "snippet": " libcopy.handlers = utils.NormalizedDict(ignore=['_'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99823:For_L71_C8", "label": "for handler", "type": "for", "loc": [71, 74], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99823:FunctionDef_L66_C4", "vector": [6, 2, 0.6473, 0.0357, 2, 0.1, 0.8, 388, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "handler", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for handler in lib.handlers.values():\n handcopy = copy.copy(handler)\n handcopy.library = libcopy\n libcopy.handlers[handler.name] = handcopy"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99823:Assign_L72_C12", "label": "handcopy = copy()", "type": "assigned_variable", "loc": [72, 72], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99823:For_L71_C8", "vector": [14, 3, 0.6429, 0.0089, 3, 0.87, 0.0, 291, 3, 1, 0, 0, 739, 10, 1], "semantic": {"name": "handcopy", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " handcopy = copy.copy(handler)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99823:Assign_L73_C12", "label": "handcopy.library =", "type": "assigned_variable", "loc": [73, 73], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99823:For_L71_C8", "vector": [14, 3, 0.6518, 0.0089, 3, 0.87, 0.5, 372, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "handcopy.library", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " handcopy.library = libcopy"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99823:Assign_L74_C12", "label": "assign", "type": "assigned_variable", "loc": [74, 74], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99823:For_L71_C8", "vector": [14, 3, 0.6607, 0.0089, 3, 0.87, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " libcopy.handlers[handler.name] = handcopy"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99823:Return_L75_C8", "label": "return", "type": "return", "loc": [75, 75], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99823:FunctionDef_L66_C4", "vector": [13, 2, 0.6696, 0.0089, 2, 0.1, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return libcopy"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99823:ClassDef_L78_C0", "label": "ImportCache", "type": "class", "loc": [78, 112], "level": 0, "parent": null, "vector": [3, 0, 0.8482, 0.3125, 0, 0.66, 1.0, 737, 0, 6, 0, 0, 0, 0, 15], "semantic": {"name": "ImportCache", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class ImportCache:\n \"\"\"Keeps track on and optionally caches imported items.\n\n Handles paths in keys case-insensitively on case-insensitive OSes.\n Unlike dicts, this storage accepts mutable values in keys.\n \"\"\"\n\n def __init__(self):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99823:Expr_L79_C4", "label": "expression", "type": "expression", "loc": [79, 83], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99823:ClassDef_L78_C0", "vector": [8, 1, 0.7232, 0.0446, 1, 0.98, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Keeps track on and optionally caches imported items.\n\n Handles paths in keys case-insensitively on case-insensitive OSes.\n Unlike dicts, this storage accepts mutable values in keys.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99823:FunctionDef_L85_C4", "label": "__init__", "type": "function", "loc": [85, 87], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99823:ClassDef_L78_C0", "vector": [2, 1, 0.7679, 0.0268, 1, 0.98, 0.1667, 555, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self):\n self._keys = []\n self._items = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99823:Assign_L86_C8", "label": "self._keys =", "type": "assigned_variable", "loc": [86, 86], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99823:FunctionDef_L85_C4", "vector": [14, 2, 0.7679, 0.0089, 2, 0.7, 0.0, 589, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self._keys", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._keys = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99823:Assign_L87_C8", "label": "self._items =", "type": "assigned_variable", "loc": [87, 87], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99823:FunctionDef_L85_C4", "vector": [14, 2, 0.7768, 0.0089, 2, 0.7, 1.0, 539, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self._items", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._items = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99823:FunctionDef_L89_C4", "label": "__setitem__", "type": "function", "loc": [89, 93], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99823:ClassDef_L78_C0", "vector": [2, 1, 0.8125, 0.0446, 1, 0.98, 0.3333, 343, 0, 3, 0, 0, 0, 0, 5], "semantic": {"name": "__setitem__", "arg_names": ["self", "key", "item"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __setitem__(self, key, item):\n if not isinstance(key, (basestring, tuple)):\n raise FrameworkError('Invalid key for ImportCache')\n self._keys.append(self._norm_path_key(key))\n self._items.append(item)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99823:If_L90_C8", "label": "if", "type": "if", "loc": [90, 91], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99823:FunctionDef_L89_C4", "vector": [4, 2, 0.808, 0.0179, 2, 0.37, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not isinstance(key, (basestring, tuple)):\n raise FrameworkError('Invalid key for ImportCache')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99823:Expr_L92_C8", "label": "append()", "type": "expression", "loc": [92, 92], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99823:FunctionDef_L89_C4", "vector": [8, 2, 0.8214, 0.0089, 2, 0.37, 0.5, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self._keys.append(self._norm_path_key(key))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99823:Expr_L93_C8", "label": "append()", "type": "expression", "loc": [93, 93], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99823:FunctionDef_L89_C4", "vector": [8, 2, 0.8304, 0.0089, 2, 0.37, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self._items.append(item)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99823:FunctionDef_L95_C4", "label": "add", "type": "function", "loc": [95, 96], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99823:ClassDef_L78_C0", "vector": [2, 1, 0.8527, 0.0179, 1, 0.98, 0.5, 241, 0, 3, 0, 0, 0, 0, 1], "semantic": {"name": "add", "arg_names": ["self", "key", "item"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def add(self, key, item=None):\n self.__setitem__(key, item)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99823:Expr_L96_C8", "label": "__setitem__()", "type": "expression", "loc": [96, 96], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99823:FunctionDef_L95_C4", "vector": [8, 2, 0.8571, 0.0089, 2, 0.3, 0.0, 343, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "__setitem__", "arg_names": [], "import_names": [], "rhs_call_name": "__setitem__", "annotation": ""}, "snippet": " self.__setitem__(key, item)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99823:FunctionDef_L98_C4", "label": "__getitem__", "type": "function", "loc": [98, 102], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99823:ClassDef_L78_C0", "vector": [2, 1, 0.8929, 0.0446, 1, 0.98, 0.6667, 698, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "__getitem__", "arg_names": ["self", "key"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __getitem__(self, key):\n key = self._norm_path_key(key)\n if key not in self._keys:\n raise KeyError\n return self._items[self._keys.index(key)]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99823:Assign_L99_C8", "label": "key = _norm_path_key()", "type": "assigned_variable", "loc": [99, 99], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99823:FunctionDef_L98_C4", "vector": [14, 2, 0.8839, 0.0089, 2, 0.06, 0.0, 230, 3, 1, 0, 0, 804, 10, 1], "semantic": {"name": "key", "arg_names": [], "import_names": [], "rhs_call_name": "_norm_path_key", "annotation": ""}, "snippet": " key = self._norm_path_key(key)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99823:If_L100_C8", "label": "if", "type": "if", "loc": [100, 101], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99823:FunctionDef_L98_C4", "vector": [4, 2, 0.8973, 0.0179, 2, 0.06, 0.5, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if key not in self._keys:\n raise KeyError"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99823:Return_L102_C8", "label": "return", "type": "return", "loc": [102, 102], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99823:FunctionDef_L98_C4", "vector": [13, 2, 0.9107, 0.0089, 2, 0.06, 1.0, 0, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._items[self._keys.index(key)]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99823:FunctionDef_L104_C4", "label": "__contains__", "type": "function", "loc": [104, 105], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99823:ClassDef_L78_C0", "vector": [2, 1, 0.933, 0.0179, 1, 0.98, 0.8333, 456, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "__contains__", "arg_names": ["self", "key"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __contains__(self, key):\n return self._norm_path_key(key) in self._keys"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99823:Return_L105_C8", "label": "return", "type": "return", "loc": [105, 105], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99823:FunctionDef_L104_C4", "vector": [13, 2, 0.9375, 0.0089, 2, 0.16, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._norm_path_key(key) in self._keys"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99823:FunctionDef_L107_C4", "label": "_norm_path_key", "type": "function", "loc": [107, 112], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99823:ClassDef_L78_C0", "vector": [2, 1, 0.9777, 0.0536, 1, 0.98, 1.0, 804, 0, 2, 1, 0, 0, 0, 6], "semantic": {"name": "_norm_path_key", "arg_names": ["self", "key"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _norm_path_key(self, key):\n if isinstance(key, tuple):\n return tuple(self._norm_path_key(k) for k in key)\n if isinstance(key, basestring) and os.path.exists(key):\n return utils.normpath(key)\n return key"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99823:If_L108_C8", "label": "if", "type": "if", "loc": [108, 109], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99823:FunctionDef_L107_C4", "vector": [4, 2, 0.9688, 0.0179, 2, 0.55, 0.0, 0, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if isinstance(key, tuple):\n return tuple(self._norm_path_key(k) for k in key)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99823:Return_L109_C12", "label": "return", "type": "return", "loc": [109, 109], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99823:If_L108_C8", "vector": [13, 3, 0.9732, 0.0089, 3, 0.39, 0.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return tuple(self._norm_path_key(k) for k in key)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99823:If_L110_C8", "label": "if", "type": "if", "loc": [110, 111], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99823:FunctionDef_L107_C4", "vector": [4, 2, 0.9866, 0.0179, 2, 0.55, 0.5, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if isinstance(key, basestring) and os.path.exists(key):\n return utils.normpath(key)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99823:Return_L111_C12", "label": "return", "type": "return", "loc": [111, 111], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99823:If_L110_C8", "vector": [13, 3, 0.9911, 0.0089, 3, 0.48, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return utils.normpath(key)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99823:Return_L112_C8", "label": "return", "type": "return", "loc": [112, 112], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99823:FunctionDef_L107_C4", "vector": [13, 2, 1.0, 0.0089, 2, 0.55, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return key"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99823:ClassDef_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99823:FunctionDef_L28_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99823:FunctionDef_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99823:Assign_L29_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99823:FunctionDef_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99823:Assign_L30_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99823:ClassDef_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99823:FunctionDef_L32_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99823:FunctionDef_L32_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99823:Assign_L33_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99823:FunctionDef_L32_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99823:Assign_L34_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99823:FunctionDef_L32_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99823:Assign_L35_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99823:FunctionDef_L32_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99823:If_L36_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99823:If_L36_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99823:Assign_L37_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99823:If_L36_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99823:Expr_L38_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99823:FunctionDef_L32_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99823:Return_L39_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99823:ClassDef_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99823:FunctionDef_L41_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99823:FunctionDef_L41_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99823:If_L42_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99823:If_L42_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99823:Expr_L43_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99823:If_L42_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99823:Assign_L45_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99823:If_L42_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99823:Assign_L46_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99823:FunctionDef_L41_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99823:Return_L47_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99823:ClassDef_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99823:FunctionDef_L49_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99823:FunctionDef_L49_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99823:Assign_L50_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99823:FunctionDef_L49_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99823:If_L51_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99823:If_L51_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99823:Expr_L52_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99823:If_L51_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99823:Return_L54_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99823:FunctionDef_L49_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99823:Expr_L55_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99823:FunctionDef_L49_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99823:Assign_L56_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99823:FunctionDef_L49_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99823:Assign_L57_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99823:FunctionDef_L49_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99823:Expr_L58_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99823:FunctionDef_L49_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99823:If_L62_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99823:If_L62_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99823:Expr_L63_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99823:FunctionDef_L49_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99823:Return_L64_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99823:ClassDef_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99823:FunctionDef_L66_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99823:FunctionDef_L66_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99823:Assign_L67_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99823:FunctionDef_L66_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99823:Assign_L68_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99823:FunctionDef_L66_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99823:Expr_L69_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99823:FunctionDef_L66_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99823:Assign_L70_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99823:FunctionDef_L66_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99823:For_L71_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99823:For_L71_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99823:Assign_L72_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99823:For_L71_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99823:Assign_L73_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99823:For_L71_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99823:Assign_L74_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99823:FunctionDef_L66_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99823:Return_L75_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99823:ClassDef_L78_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99823:Expr_L79_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99823:ClassDef_L78_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99823:FunctionDef_L85_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99823:FunctionDef_L85_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99823:Assign_L86_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99823:FunctionDef_L85_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99823:Assign_L87_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99823:ClassDef_L78_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99823:FunctionDef_L89_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99823:FunctionDef_L89_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99823:If_L90_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99823:FunctionDef_L89_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99823:Expr_L92_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99823:FunctionDef_L89_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99823:Expr_L93_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99823:ClassDef_L78_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99823:FunctionDef_L95_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99823:FunctionDef_L95_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99823:Expr_L96_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99823:ClassDef_L78_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99823:FunctionDef_L98_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99823:FunctionDef_L98_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99823:Assign_L99_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99823:FunctionDef_L98_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99823:If_L100_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99823:FunctionDef_L98_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99823:Return_L102_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99823:ClassDef_L78_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99823:FunctionDef_L104_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99823:FunctionDef_L104_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99823:Return_L105_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99823:ClassDef_L78_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99823:FunctionDef_L107_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99823:FunctionDef_L107_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99823:If_L108_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99823:If_L108_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99823:Return_L109_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99823:FunctionDef_L107_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99823:If_L110_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99823:If_L110_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99823:Return_L111_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99823:FunctionDef_L107_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99823:Return_L112_C8"}] |
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import os
import inspect
from robot import utils
from robot.errors import DataError
from robot.common import BaseLibrary
from robot.output import LOGGER
from handlers import Handler, InitHandler, DynamicHandler
if utils.is_jython:
from org.python.core import PyReflectedFunction, PyReflectedConstructor
from java.lang import Object
else:
Object = None
def TestLibrary(name, args=None, variables=None, create_handlers=True):
libcode, source = utils.import_(name)
libclass = _get_lib_class(libcode)
lib = libclass(libcode, source, name, args or [], variables)
if create_handlers:
lib.create_handlers()
return lib
def _get_lib_class(libcode):
if inspect.ismodule(libcode):
return _ModuleLibrary
if _DynamicMethod(libcode, 'get_keyword_names'):
if _DynamicMethod(libcode, 'run_keyword'):
return _DynamicLibrary
else:
return _HybridLibrary
return _ClassLibrary
class _DynamicMethod(object):
def __init__(self, libcode, underscore_name, default=None):
self._method = self._get_method(libcode, underscore_name)
self._default = default
def __call__(self, *args):
if not self._method:
return self._default
try:
return self._method(*args)
except:
raise DataError("Calling dynamic method '%s' failed: %s"
% (self._method.__name__, utils.get_error_message()))
def __nonzero__(self):
return self._method is not None
def _get_method(self, libcode, underscore_name):
for name in underscore_name, self._getCamelCaseName(underscore_name):
method = getattr(libcode, name, None)
if callable(method):
return method
return None
def _getCamelCaseName(self, underscore_name):
tokens = underscore_name.split('_')
return ''.join([tokens[0]] + [t.capitalize() for t in tokens[1:]])
class _BaseTestLibrary(BaseLibrary):
supports_named_arguments = False # this attribute is for libdoc
_log_success = LOGGER.debug
_log_failure = LOGGER.info
_log_failure_details = LOGGER.debug
def __init__(self, libcode, source, name, args, variables):
if os.path.exists(name):
name = os.path.splitext(os.path.basename(os.path.abspath(name)))[0]
self.source = source
self.version = self._get_version(libcode)
self.name = name
self.orig_name = name # Stores original name also after copying
self.positional_args = []
self.named_args = {}
self._instance_cache = []
self._libinst = None
if libcode is not None:
self.doc = inspect.getdoc(libcode) or ''
self.scope = self._get_scope(libcode)
self._libcode = libcode
self.init = self._create_init_handler(libcode)
self.positional_args, self.named_args = self.init.arguments.resolve(args, variables)
def create_handlers(self):
if self._libcode:
self._libinst = self.get_instance()
self.handlers = self._create_handlers(self._libinst)
self.init_scope_handling()
def start_suite(self):
pass
def end_suite(self):
pass
def start_test(self):
pass
def end_test(self):
pass
def _get_version(self, code):
try:
return str(code.ROBOT_LIBRARY_VERSION)
except AttributeError:
try:
return str(code.__version__)
except AttributeError:
return '<unknown>'
def _create_init_handler(self, libcode):
init_method = getattr(libcode, '__init__', None)
if not self._valid_init(init_method):
init_method = None
return InitHandler(self, init_method)
def _valid_init(self, init_method):
if inspect.ismethod(init_method):
return True
if utils.is_jython and isinstance(init_method, PyReflectedConstructor):
return True
return False
def init_scope_handling(self):
if self.scope == 'GLOBAL':
return
self._libinst = None
self.start_suite = self._caching_start
self.end_suite = self._restoring_end
if self.scope == 'TESTCASE':
self.start_test = self._caching_start
self.end_test = self._restoring_end
def _caching_start(self):
self._instance_cache.append(self._libinst)
self._libinst = None
def _restoring_end(self):
self._libinst = self._instance_cache.pop()
def _get_scope(self, libcode):
try:
scope = libcode.ROBOT_LIBRARY_SCOPE
scope = utils.normalize(scope, ignore=['_']).upper()
except (AttributeError, TypeError):
scope = 'TESTCASE'
return scope if scope in ['GLOBAL','TESTSUITE'] else 'TESTCASE'
def get_instance(self):
if self._libinst is None:
self._libinst = self._get_instance()
return self._libinst
def _get_instance(self):
try:
return self._libcode(*self.positional_args, **self.named_args)
except:
self._raise_creating_instance_failed()
def _create_handlers(self, libcode):
handlers = utils.NormalizedDict(ignore=['_'])
for name in self._get_handler_names(libcode):
method = self._try_to_get_handler_method(libcode, name)
if method:
handler = self._try_to_create_handler(name, method)
if handler:
handlers[name] = handler
self._log_success("Created keyword '%s'" % handler.name)
return handlers
def _get_handler_names(self, libcode):
return [name for name in dir(libcode)
if not name.startswith(('_', 'ROBOT_LIBRARY_'))]
def _try_to_get_handler_method(self, libcode, name):
try:
return self._get_handler_method(libcode, name)
except:
self._report_adding_keyword_failed(name)
def _report_adding_keyword_failed(self, name):
msg, details = utils.get_error_details()
self._log_failure("Adding keyword '%s' to library '%s' failed: %s"
% (name, self.name, msg))
if details:
self._log_failure_details('Details:\n%s' % details)
def _get_handler_method(self, libcode, name):
method = getattr(libcode, name)
if not inspect.isroutine(method):
raise DataError('Not a method or function')
return method
def _try_to_create_handler(self, name, method):
try:
return self._create_handler(name, method)
except:
self._report_adding_keyword_failed(name)
def _create_handler(self, handler_name, handler_method):
return Handler(self, handler_name, handler_method)
def _raise_creating_instance_failed(self):
msg, details = utils.get_error_details()
if self.positional_args:
args = "argument%s %s" % (utils.plural_or_not(self.positional_args),
utils.seq2str(self.positional_args))
else:
args = "no arguments"
raise DataError("Creating an instance of the test library '%s' with %s "
"failed: %s\n%s" % (self.name, args, msg, details))
class _ClassLibrary(_BaseTestLibrary):
supports_named_arguments = True # this attribute is for libdoc
def _get_handler_method(self, libinst, name):
# Type is checked before using getattr to avoid calling properties,
# most importantly bean properties generated by Jython (issue 188).
for item in (libinst,) + inspect.getmro(libinst.__class__):
if item in (object, Object):
continue
if not (hasattr(item, '__dict__') and name in item.__dict__):
continue
self._validate_handler(item.__dict__[name])
return getattr(libinst, name)
raise DataError('No non-implicit implementation found')
def _validate_handler(self, handler):
if not self._is_routine(handler):
raise DataError('Not a method or function')
if self._is_implicit_java_or_jython_method(handler):
raise DataError('Implicit methods are ignored')
def _is_routine(self, handler):
# inspect.isroutine doesn't work with methods from Java classes
# prior to Jython 2.5.2: http://bugs.jython.org/issue1223
return inspect.isroutine(handler) or self._is_java_method(handler)
def _is_java_method(self, handler):
return utils.is_jython and isinstance(handler, PyReflectedFunction)
def _is_implicit_java_or_jython_method(self, handler):
if not self._is_java_method(handler):
return False
for signature in handler.argslist[:handler.nargs]:
cls = signature.declaringClass
if not (cls is Object or self._is_created_by_jython(handler, cls)):
return False
return True
def _is_created_by_jython(self, handler, cls):
proxy_methods = getattr(cls, '__supernames__', []) + ['classDictInit']
return handler.__name__ in proxy_methods
class _ModuleLibrary(_BaseTestLibrary):
supports_named_arguments = True # this attribute is for libdoc
def _get_scope(self, libcode):
return 'GLOBAL'
def _get_handler_method(self, libcode, name):
method = _BaseTestLibrary._get_handler_method(self, libcode, name)
if hasattr(libcode, '__all__') and name not in libcode.__all__:
raise DataError('Not exposed as a keyword')
return method
def get_instance(self):
self.init.arguments.check_arg_limits(self.positional_args)
return self._libcode
def _create_init_handler(self, libcode):
return InitHandler(self, None)
class _HybridLibrary(_BaseTestLibrary):
_log_failure = LOGGER.warn
def _get_handler_names(self, instance):
try:
return instance.get_keyword_names()
except AttributeError:
return instance.getKeywordNames()
class _DynamicLibrary(_BaseTestLibrary):
_log_failure = LOGGER.warn
def __init__(self, libcode, source, name, args, variables=None):
_BaseTestLibrary.__init__(self, libcode, source, name, args, variables)
self._get_kw_doc = \
_DynamicMethod(libcode, 'get_keyword_documentation', default='')
self._get_kw_args = \
_DynamicMethod(libcode, 'get_keyword_arguments', default=None)
def _get_handler_names(self, instance):
try:
return instance.get_keyword_names()
except AttributeError:
return instance.getKeywordNames()
def _get_handler_method(self, instance, name_is_ignored):
try:
return instance.run_keyword
except AttributeError:
return instance.runKeyword
def _create_handler(self, handler_name, handler_method):
doc = self._get_kw_doc(self._libinst, handler_name)
argspec = self._get_kw_args(self._libinst, handler_name)
return DynamicHandler(self, handler_name, handler_method, doc, argspec)
| ajibawa-2023/Python-Code-Large/train/row_99824 | 221 | 334 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99824:Import_L15_C0", "label": "os import os", "type": "import", "loc": [15, 15], "level": 0, "parent": null, "vector": [1, 0, 0.0449, 0.003, 0, 0.66, 0.0, 688, 0, 1, 0, 0, 688, 0, 0], "semantic": {"name": "os", "arg_names": [], "import_names": ["os"], "rhs_call_name": "", "annotation": ""}, "snippet": "import os"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:Import_L16_C0", "label": "inspect import inspect", "type": "import", "loc": [16, 16], "level": 0, "parent": null, "vector": [1, 0, 0.0479, 0.003, 0, 0.66, 0.0667, 878, 0, 1, 0, 0, 878, 0, 0], "semantic": {"name": "inspect", "arg_names": [], "import_names": ["inspect"], "rhs_call_name": "", "annotation": ""}, "snippet": "import inspect"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:ImportFrom_L18_C0", "label": "from robot import utils", "type": "import", "loc": [18, 18], "level": 0, "parent": null, "vector": [1, 0, 0.0539, 0.003, 0, 0.66, 0.1333, 735, 0, 1, 0, 0, 735, 0, 0], "semantic": {"name": "robot", "arg_names": [], "import_names": ["utils"], "rhs_call_name": "", "annotation": ""}, "snippet": "from robot import utils"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:ImportFrom_L19_C0", "label": "from robot.errors import DataError", "type": "import", "loc": [19, 19], "level": 0, "parent": null, "vector": [1, 0, 0.0569, 0.003, 0, 0.66, 0.2, 299, 0, 1, 0, 0, 299, 0, 0], "semantic": {"name": "robot.errors", "arg_names": [], "import_names": ["DataError"], "rhs_call_name": "", "annotation": ""}, "snippet": "from robot.errors import DataError"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:ImportFrom_L20_C0", "label": "from robot.common import BaseLibrary", "type": "import", "loc": [20, 20], "level": 0, "parent": null, "vector": [1, 0, 0.0599, 0.003, 0, 0.66, 0.2667, 355, 0, 1, 0, 0, 355, 0, 0], "semantic": {"name": "robot.common", "arg_names": [], "import_names": ["BaseLibrary"], "rhs_call_name": "", "annotation": ""}, "snippet": "from robot.common import BaseLibrary"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:ImportFrom_L21_C0", "label": "from robot.output import LOGGER", "type": "import", "loc": [21, 21], "level": 0, "parent": null, "vector": [1, 0, 0.0629, 0.003, 0, 0.66, 0.3333, 596, 0, 1, 0, 0, 596, 0, 0], "semantic": {"name": "robot.output", "arg_names": [], "import_names": ["LOGGER"], "rhs_call_name": "", "annotation": ""}, "snippet": "from robot.output import LOGGER"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:ImportFrom_L23_C0", "label": "from handlers import Handler, InitHandler, DynamicHandler", "type": "import", "loc": [23, 23], "level": 0, "parent": null, "vector": [1, 0, 0.0689, 0.003, 0, 0.66, 0.4, 183, 0, 3, 0, 0, 183, 0, 0], "semantic": {"name": "handlers", "arg_names": [], "import_names": ["Handler", "InitHandler", "DynamicHandler"], "rhs_call_name": "", "annotation": ""}, "snippet": "from handlers import Handler, InitHandler, DynamicHandler"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:If_L25_C0", "label": "if", "type": "if", "loc": [25, 29], "level": 0, "parent": null, "vector": [4, 0, 0.0808, 0.015, 0, 0.66, 0.4667, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if utils.is_jython:\n from org.python.core import PyReflectedFunction, PyReflectedConstructor\n from java.lang import Object\nelse:\n Object = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:ImportFrom_L26_C4", "label": "from org.python.core import PyReflectedFunction, PyReflectedConstructor", "type": "import", "loc": [26, 26], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:If_L25_C0", "vector": [1, 1, 0.0778, 0.003, 1, 0.32, 0.0, 919, 0, 2, 0, 0, 919, 0, 0], "semantic": {"name": "org.python.core", "arg_names": [], "import_names": ["PyReflectedFunction", "PyReflectedConstructor"], "rhs_call_name": "", "annotation": ""}, "snippet": " from org.python.core import PyReflectedFunction, PyReflectedConstructor"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:ImportFrom_L27_C4", "label": "from java.lang import Object", "type": "import", "loc": [27, 27], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:If_L25_C0", "vector": [1, 1, 0.0808, 0.003, 1, 0.32, 0.5, 100, 0, 1, 0, 0, 100, 0, 0], "semantic": {"name": "java.lang", "arg_names": [], "import_names": ["Object"], "rhs_call_name": "", "annotation": ""}, "snippet": " from java.lang import Object"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:Assign_L29_C4", "label": "Object =", "type": "assigned_variable", "loc": [29, 29], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:If_L25_C0", "vector": [14, 1, 0.0868, 0.003, 1, 0.32, 1.0, 867, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "Object", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " Object = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L32_C0", "label": "TestLibrary", "type": "function", "loc": [32, 38], "level": 0, "parent": null, "vector": [2, 0, 0.1048, 0.021, 0, 0.66, 0.5333, 300, 0, 4, 1, 0, 0, 0, 4], "semantic": {"name": "TestLibrary", "arg_names": ["name", "args", "variables", "create_handlers"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def TestLibrary(name, args=None, variables=None, create_handlers=True):\n libcode, source = utils.import_(name)\n libclass = _get_lib_class(libcode)\n lib = libclass(libcode, source, name, args or [], variables)\n if create_handlers:\n lib.create_handlers()\n return lib"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:Assign_L33_C4", "label": "libcode, source = import_()", "type": "assigned_variable", "loc": [33, 33], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L32_C0", "vector": [14, 1, 0.0988, 0.003, 1, 0.12, 0.0, 259, 3, 1, 0, 0, 10, 10, 1], "semantic": {"name": "libcode, source", "arg_names": [], "import_names": [], "rhs_call_name": "import_", "annotation": ""}, "snippet": " libcode, source = utils.import_(name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:Assign_L34_C4", "label": "libclass = _get_lib_class()", "type": "assigned_variable", "loc": [34, 34], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L32_C0", "vector": [14, 1, 0.1018, 0.003, 1, 0.12, 0.25, 159, 3, 1, 0, 0, 768, 10, 1], "semantic": {"name": "libclass", "arg_names": [], "import_names": [], "rhs_call_name": "_get_lib_class", "annotation": ""}, "snippet": " libclass = _get_lib_class(libcode)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:Assign_L35_C4", "label": "lib = libclass()", "type": "assigned_variable", "loc": [35, 35], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L32_C0", "vector": [14, 1, 0.1048, 0.003, 1, 0.12, 0.5, 115, 3, 5, 0, 0, 159, 10, 1], "semantic": {"name": "lib", "arg_names": [], "import_names": [], "rhs_call_name": "libclass", "annotation": ""}, "snippet": " lib = libclass(libcode, source, name, args or [], variables)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:If_L36_C4", "label": "if", "type": "if", "loc": [36, 37], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L32_C0", "vector": [4, 1, 0.1093, 0.006, 1, 0.12, 0.75, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if create_handlers:\n lib.create_handlers()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:Expr_L37_C8", "label": "create_handlers()", "type": "expression", "loc": [37, 37], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:If_L36_C4", "vector": [8, 2, 0.1108, 0.003, 2, 0.48, 0.0, 457, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "create_handlers", "arg_names": [], "import_names": [], "rhs_call_name": "create_handlers", "annotation": ""}, "snippet": " lib.create_handlers()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:Return_L38_C4", "label": "return", "type": "return", "loc": [38, 38], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L32_C0", "vector": [13, 1, 0.1138, 0.003, 1, 0.12, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return lib"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L41_C0", "label": "_get_lib_class", "type": "function", "loc": [41, 49], "level": 0, "parent": null, "vector": [2, 0, 0.1347, 0.0269, 0, 0.66, 0.6, 768, 0, 1, 1, 0, 0, 0, 3], "semantic": {"name": "_get_lib_class", "arg_names": ["libcode"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def _get_lib_class(libcode):\n if inspect.ismodule(libcode):\n return _ModuleLibrary\n if _DynamicMethod(libcode, 'get_keyword_names'):\n if _DynamicMethod(libcode, 'run_keyword'):\n return _DynamicLibrary\n else:\n return _HybridLibrary"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:If_L42_C4", "label": "if", "type": "if", "loc": [42, 43], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L41_C0", "vector": [4, 1, 0.1272, 0.006, 1, 0.23, 0.0, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if inspect.ismodule(libcode):\n return _ModuleLibrary"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:Return_L43_C8", "label": "return", "type": "return", "loc": [43, 43], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:If_L42_C4", "vector": [13, 2, 0.1287, 0.003, 2, 0.54, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return _ModuleLibrary"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:If_L44_C4", "label": "if", "type": "if", "loc": [44, 48], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L41_C0", "vector": [4, 1, 0.1377, 0.015, 1, 0.23, 0.5, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if _DynamicMethod(libcode, 'get_keyword_names'):\n if _DynamicMethod(libcode, 'run_keyword'):\n return _DynamicLibrary\n else:\n return _HybridLibrary"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:If_L45_C8", "label": "if", "type": "if", "loc": [45, 48], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:If_L44_C4", "vector": [4, 2, 0.1392, 0.012, 2, 0.71, 0.0, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if _DynamicMethod(libcode, 'run_keyword'):\n return _DynamicLibrary\n else:\n return _HybridLibrary"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:Return_L46_C12", "label": "return", "type": "return", "loc": [46, 46], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:If_L45_C8", "vector": [13, 3, 0.1377, 0.003, 3, 0.45, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return _DynamicLibrary"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:Return_L48_C12", "label": "return", "type": "return", "loc": [48, 48], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:If_L45_C8", "vector": [13, 3, 0.1437, 0.003, 3, 0.45, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return _HybridLibrary"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:Return_L49_C4", "label": "return", "type": "return", "loc": [49, 49], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L41_C0", "vector": [13, 1, 0.1467, 0.003, 1, 0.23, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return _ClassLibrary"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:ClassDef_L52_C0", "label": "_DynamicMethod", "type": "class", "loc": [52, 79], "level": 0, "parent": null, "vector": [3, 0, 0.1961, 0.0838, 0, 0.66, 0.6667, 812, 0, 5, 0, 0, 186, 0, 10], "semantic": {"name": "_DynamicMethod", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class _DynamicMethod(object):\n\n def __init__(self, libcode, underscore_name, default=None):\n self._method = self._get_method(libcode, underscore_name)\n self._default = default\n\n def __call__(self, *args):\n if not self._method:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L54_C4", "label": "__init__", "type": "function", "loc": [54, 56], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:ClassDef_L52_C0", "vector": [2, 1, 0.1647, 0.009, 1, 0.93, 0.0, 555, 0, 4, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": ["self", "libcode", "underscore_name", "default"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, libcode, underscore_name, default=None):\n self._method = self._get_method(libcode, underscore_name)\n self._default = default"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:Assign_L55_C8", "label": "self._method = _get_method()", "type": "assigned_variable", "loc": [55, 55], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L54_C4", "vector": [14, 2, 0.1647, 0.003, 2, 0.82, 0.0, 910, 3, 2, 0, 0, 195, 10, 1], "semantic": {"name": "self._method", "arg_names": [], "import_names": [], "rhs_call_name": "_get_method", "annotation": ""}, "snippet": " self._method = self._get_method(libcode, underscore_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:Assign_L56_C8", "label": "self._default =", "type": "assigned_variable", "loc": [56, 56], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L54_C4", "vector": [14, 2, 0.1677, 0.003, 2, 0.82, 1.0, 498, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._default", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._default = default"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L58_C4", "label": "__call__", "type": "function", "loc": [58, 65], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:ClassDef_L52_C0", "vector": [2, 1, 0.1841, 0.024, 1, 0.93, 0.25, 319, 0, 2, 1, 0, 0, 0, 3], "semantic": {"name": "__call__", "arg_names": ["self", "args"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __call__(self, *args):\n if not self._method:\n return self._default\n try:\n return self._method(*args)\n except:\n raise DataError(\"Calling dynamic method '%s' failed: %s\"\n % (self._method.__name__, utils.get_error_message()))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:If_L59_C8", "label": "if", "type": "if", "loc": [59, 60], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L58_C4", "vector": [4, 2, 0.1781, 0.006, 2, 0.71, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not self._method:\n return self._default"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:Return_L60_C12", "label": "return", "type": "return", "loc": [60, 60], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:If_L59_C8", "vector": [13, 3, 0.1796, 0.003, 3, 0.21, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._default"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:Try_L61_C8", "label": "try", "type": "try", "loc": [61, 65], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L58_C4", "vector": [7, 2, 0.1886, 0.015, 2, 0.71, 1.0, 0, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n return self._method(*args)\n except:\n raise DataError(\"Calling dynamic method '%s' failed: %s\"\n % (self._method.__name__, utils.get_error_message()))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:Return_L62_C12", "label": "return", "type": "return", "loc": [62, 62], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:Try_L61_C8", "vector": [13, 3, 0.1856, 0.003, 3, 0.86, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._method(*args)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L67_C4", "label": "__nonzero__", "type": "function", "loc": [67, 68], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:ClassDef_L52_C0", "vector": [2, 1, 0.2021, 0.006, 1, 0.93, 0.5, 322, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "__nonzero__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __nonzero__(self):\n return self._method is not None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:Return_L68_C8", "label": "return", "type": "return", "loc": [68, 68], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L67_C4", "vector": [13, 2, 0.2036, 0.003, 2, 0.22, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._method is not None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L70_C4", "label": "_get_method", "type": "function", "loc": [70, 75], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:ClassDef_L52_C0", "vector": [2, 1, 0.2171, 0.018, 1, 0.93, 0.75, 195, 0, 3, 1, 0, 0, 0, 3], "semantic": {"name": "_get_method", "arg_names": ["self", "libcode", "underscore_name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _get_method(self, libcode, underscore_name):\n for name in underscore_name, self._getCamelCaseName(underscore_name):\n method = getattr(libcode, name, None)\n if callable(method):\n return method\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:For_L71_C8", "label": "for name", "type": "for", "loc": [71, 74], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L70_C4", "vector": [6, 2, 0.2171, 0.012, 2, 0.19, 0.0, 57, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for name in underscore_name, self._getCamelCaseName(underscore_name):\n method = getattr(libcode, name, None)\n if callable(method):\n return method"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:Assign_L72_C12", "label": "method = getattr()", "type": "assigned_variable", "loc": [72, 72], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:For_L71_C8", "vector": [14, 3, 0.2156, 0.003, 3, 0.04, 0.0, 445, 3, 3, 0, 0, 121, 10, 1], "semantic": {"name": "method", "arg_names": [], "import_names": [], "rhs_call_name": "getattr", "annotation": ""}, "snippet": " method = getattr(libcode, name, None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:If_L73_C12", "label": "if", "type": "if", "loc": [73, 74], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:For_L71_C8", "vector": [4, 3, 0.2201, 0.006, 3, 0.04, 1.0, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if callable(method):\n return method"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:Return_L74_C16", "label": "return", "type": "return", "loc": [74, 74], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:If_L73_C12", "vector": [13, 4, 0.2216, 0.003, 4, 0.05, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return method"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:Return_L75_C8", "label": "return", "type": "return", "loc": [75, 75], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L70_C4", "vector": [13, 2, 0.2246, 0.003, 2, 0.19, 1.0, 0, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L77_C4", "label": "_getCamelCaseName", "type": "function", "loc": [77, 79], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:ClassDef_L52_C0", "vector": [2, 1, 0.2335, 0.009, 1, 0.93, 1.0, 11, 0, 2, 1, 0, 0, 0, 3], "semantic": {"name": "_getCamelCaseName", "arg_names": ["self", "underscore_name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _getCamelCaseName(self, underscore_name):\n tokens = underscore_name.split('_')\n return ''.join([tokens[0]] + [t.capitalize() for t in tokens[1:]])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:Assign_L78_C8", "label": "tokens = split()", "type": "assigned_variable", "loc": [78, 78], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L77_C4", "vector": [14, 2, 0.2335, 0.003, 2, 0.01, 0.0, 700, 3, 1, 0, 0, 908, 10, 1], "semantic": {"name": "tokens", "arg_names": [], "import_names": [], "rhs_call_name": "split", "annotation": ""}, "snippet": " tokens = underscore_name.split('_')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:Return_L79_C8", "label": "return", "type": "return", "loc": [79, 79], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L77_C4", "vector": [13, 2, 0.2365, 0.003, 2, 0.01, 1.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ''.join([tokens[0]] + [t.capitalize() for t in tokens[1:]])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:ClassDef_L82_C0", "label": "_BaseTestLibrary", "type": "class", "loc": [82, 233], "level": 0, "parent": null, "vector": [3, 0, 0.4716, 0.4551, 0, 0.66, 0.7333, 63, 0, 23, 0, 0, 411, 0, 48], "semantic": {"name": "_BaseTestLibrary", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class _BaseTestLibrary(BaseLibrary):\n supports_named_arguments = False # this attribute is for libdoc\n _log_success = LOGGER.debug\n _log_failure = LOGGER.info\n _log_failure_details = LOGGER.debug\n\n def __init__(self, libcode, source, name, args, variables):\n if os.path.exists(name):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:Assign_L83_C4", "label": "supports_named_arguments =", "type": "assigned_variable", "loc": [83, 83], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:ClassDef_L82_C0", "vector": [14, 1, 0.2485, 0.003, 1, 0.74, 0.0, 278, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "supports_named_arguments", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " supports_named_arguments = False # this attribute is for libdoc"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:Assign_L84_C4", "label": "_log_success =", "type": "assigned_variable", "loc": [84, 84], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:ClassDef_L82_C0", "vector": [14, 1, 0.2515, 0.003, 1, 0.74, 0.0385, 499, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "_log_success", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " _log_success = LOGGER.debug"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:Assign_L85_C4", "label": "_log_failure =", "type": "assigned_variable", "loc": [85, 85], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:ClassDef_L82_C0", "vector": [14, 1, 0.2545, 0.003, 1, 0.74, 0.0769, 344, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "_log_failure", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " _log_failure = LOGGER.info"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:Assign_L86_C4", "label": "_log_failure_details =", "type": "assigned_variable", "loc": [86, 86], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:ClassDef_L82_C0", "vector": [14, 1, 0.2575, 0.003, 1, 0.74, 0.1154, 966, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "_log_failure_details", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " _log_failure_details = LOGGER.debug"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L88_C4", "label": "__init__", "type": "function", "loc": [88, 104], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:ClassDef_L82_C0", "vector": [2, 1, 0.2874, 0.0509, 1, 0.74, 0.1538, 555, 0, 6, 0, 0, 0, 0, 9], "semantic": {"name": "__init__", "arg_names": ["self", "libcode", "source", "name", "args", "variables"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, libcode, source, name, args, variables):\n if os.path.exists(name):\n name = os.path.splitext(os.path.basename(os.path.abspath(name)))[0]\n self.source = source\n self.version = self._get_version(libcode)\n self.name = name\n self.orig_name = name # Stores original name also after copying\n self.positional_args = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:If_L89_C8", "label": "if", "type": "if", "loc": [89, 90], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L88_C4", "vector": [4, 2, 0.268, 0.006, 2, 0.39, 0.0, 0, 3, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if os.path.exists(name):\n name = os.path.splitext(os.path.basename(os.path.abspath(name)))[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:Assign_L90_C12", "label": "name =", "type": "assigned_variable", "loc": [90, 90], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:If_L89_C8", "vector": [14, 3, 0.2695, 0.003, 3, 0.27, 0.0, 57, 6, 0, 0, 0, 0, 0, 3], "semantic": {"name": "name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " name = os.path.splitext(os.path.basename(os.path.abspath(name)))[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:Assign_L91_C8", "label": "self.source =", "type": "assigned_variable", "loc": [91, 91], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L88_C4", "vector": [14, 2, 0.2725, 0.003, 2, 0.39, 0.1111, 848, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.source", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.source = source"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:Assign_L92_C8", "label": "self.version = _get_version()", "type": "assigned_variable", "loc": [92, 92], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L88_C4", "vector": [14, 2, 0.2754, 0.003, 2, 0.39, 0.2222, 686, 3, 1, 0, 0, 602, 10, 1], "semantic": {"name": "self.version", "arg_names": [], "import_names": [], "rhs_call_name": "_get_version", "annotation": ""}, "snippet": " self.version = self._get_version(libcode)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:Assign_L93_C8", "label": "self.name =", "type": "assigned_variable", "loc": [93, 93], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L88_C4", "vector": [14, 2, 0.2784, 0.003, 2, 0.39, 0.3333, 689, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.name = name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:Assign_L94_C8", "label": "self.orig_name =", "type": "assigned_variable", "loc": [94, 94], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L88_C4", "vector": [14, 2, 0.2814, 0.003, 2, 0.39, 0.4444, 479, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.orig_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.orig_name = name # Stores original name also after copying"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:Assign_L95_C8", "label": "self.positional_args =", "type": "assigned_variable", "loc": [95, 95], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L88_C4", "vector": [14, 2, 0.2844, 0.003, 2, 0.39, 0.5556, 446, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.positional_args", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.positional_args = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:Assign_L96_C8", "label": "self.named_args =", "type": "assigned_variable", "loc": [96, 96], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L88_C4", "vector": [14, 2, 0.2874, 0.003, 2, 0.39, 0.6667, 526, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "self.named_args", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.named_args = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:Assign_L97_C8", "label": "self._instance_cache =", "type": "assigned_variable", "loc": [97, 97], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L88_C4", "vector": [14, 2, 0.2904, 0.003, 2, 0.39, 0.7778, 591, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self._instance_cache", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._instance_cache = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:Assign_L98_C8", "label": "self._libinst =", "type": "assigned_variable", "loc": [98, 98], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L88_C4", "vector": [14, 2, 0.2934, 0.003, 2, 0.39, 0.8889, 982, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self._libinst", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._libinst = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:If_L99_C8", "label": "if", "type": "if", "loc": [99, 104], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L88_C4", "vector": [4, 2, 0.3039, 0.018, 2, 0.39, 1.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if libcode is not None:\n self.doc = inspect.getdoc(libcode) or ''\n self.scope = self._get_scope(libcode)\n self._libcode = libcode\n self.init = self._create_init_handler(libcode)\n self.positional_args, self.named_args = self.init.arguments.resolve(args, variables)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:Assign_L100_C12", "label": "self.doc =", "type": "assigned_variable", "loc": [100, 100], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:If_L99_C8", "vector": [14, 3, 0.2994, 0.003, 3, 0.81, 0.0, 114, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self.doc", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.doc = inspect.getdoc(libcode) or ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:Assign_L101_C12", "label": "self.scope = _get_scope()", "type": "assigned_variable", "loc": [101, 101], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:If_L99_C8", "vector": [14, 3, 0.3024, 0.003, 3, 0.81, 0.25, 550, 3, 1, 0, 0, 125, 10, 1], "semantic": {"name": "self.scope", "arg_names": [], "import_names": [], "rhs_call_name": "_get_scope", "annotation": ""}, "snippet": " self.scope = self._get_scope(libcode)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:Assign_L102_C12", "label": "self._libcode =", "type": "assigned_variable", "loc": [102, 102], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:If_L99_C8", "vector": [14, 3, 0.3054, 0.003, 3, 0.81, 0.5, 622, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._libcode", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._libcode = libcode"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:Assign_L103_C12", "label": "self.init = _create_init_handler()", "type": "assigned_variable", "loc": [103, 103], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:If_L99_C8", "vector": [14, 3, 0.3084, 0.003, 3, 0.81, 0.75, 656, 3, 1, 0, 0, 125, 10, 1], "semantic": {"name": "self.init", "arg_names": [], "import_names": [], "rhs_call_name": "_create_init_handler", "annotation": ""}, "snippet": " self.init = self._create_init_handler(libcode)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:Assign_L104_C12", "label": " = resolve()", "type": "assigned_variable", "loc": [104, 104], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:If_L99_C8", "vector": [14, 3, 0.3114, 0.003, 3, 0.81, 1.0, 0, 3, 2, 0, 0, 675, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "resolve", "annotation": ""}, "snippet": " self.positional_args, self.named_args = self.init.arguments.resolve(args, variables)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L106_C4", "label": "create_handlers", "type": "function", "loc": [106, 110], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:ClassDef_L82_C0", "vector": [2, 1, 0.3234, 0.015, 1, 0.74, 0.1923, 457, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "create_handlers", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def create_handlers(self):\n if self._libcode:\n self._libinst = self.get_instance()\n self.handlers = self._create_handlers(self._libinst)\n self.init_scope_handling()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:If_L107_C8", "label": "if", "type": "if", "loc": [107, 110], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L106_C4", "vector": [4, 2, 0.3249, 0.012, 2, 0.52, 0.0, 0, 7, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self._libcode:\n self._libinst = self.get_instance()\n self.handlers = self._create_handlers(self._libinst)\n self.init_scope_handling()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:Assign_L108_C12", "label": "self._libinst = get_instance()", "type": "assigned_variable", "loc": [108, 108], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:If_L107_C8", "vector": [14, 3, 0.3234, 0.003, 3, 0.57, 0.0, 982, 3, 0, 0, 0, 82, 10, 1], "semantic": {"name": "self._libinst", "arg_names": [], "import_names": [], "rhs_call_name": "get_instance", "annotation": ""}, "snippet": " self._libinst = self.get_instance()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:Assign_L109_C12", "label": "self.handlers = _create_handlers()", "type": "assigned_variable", "loc": [109, 109], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:If_L107_C8", "vector": [14, 3, 0.3263, 0.003, 3, 0.57, 0.5, 844, 3, 1, 0, 0, 865, 10, 1], "semantic": {"name": "self.handlers", "arg_names": [], "import_names": [], "rhs_call_name": "_create_handlers", "annotation": ""}, "snippet": " self.handlers = self._create_handlers(self._libinst)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:Expr_L110_C12", "label": "init_scope_handling()", "type": "expression", "loc": [110, 110], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:If_L107_C8", "vector": [8, 3, 0.3293, 0.003, 3, 0.57, 1.0, 956, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "init_scope_handling", "arg_names": [], "import_names": [], "rhs_call_name": "init_scope_handling", "annotation": ""}, "snippet": " self.init_scope_handling()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L112_C4", "label": "start_suite", "type": "function", "loc": [112, 113], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:ClassDef_L82_C0", "vector": [2, 1, 0.3368, 0.006, 1, 0.74, 0.2308, 38, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "start_suite", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def start_suite(self):\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L115_C4", "label": "end_suite", "type": "function", "loc": [115, 116], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:ClassDef_L82_C0", "vector": [2, 1, 0.3458, 0.006, 1, 0.74, 0.2692, 81, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "end_suite", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def end_suite(self):\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L118_C4", "label": "start_test", "type": "function", "loc": [118, 119], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:ClassDef_L82_C0", "vector": [2, 1, 0.3548, 0.006, 1, 0.74, 0.3077, 246, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "start_test", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def start_test(self):\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L121_C4", "label": "end_test", "type": "function", "loc": [121, 122], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:ClassDef_L82_C0", "vector": [2, 1, 0.3638, 0.006, 1, 0.74, 0.3462, 220, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "end_test", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def end_test(self):\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L124_C4", "label": "_get_version", "type": "function", "loc": [124, 131], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:ClassDef_L82_C0", "vector": [2, 1, 0.3817, 0.024, 1, 0.74, 0.3846, 602, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "_get_version", "arg_names": ["self", "code"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _get_version(self, code):\n try:\n return str(code.ROBOT_LIBRARY_VERSION)\n except AttributeError:\n try:\n return str(code.__version__)\n except AttributeError:\n return '<unknown>'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:Try_L125_C8", "label": "try", "type": "try", "loc": [125, 131], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L124_C4", "vector": [7, 2, 0.3832, 0.021, 2, 0.05, 0.0, 0, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n return str(code.ROBOT_LIBRARY_VERSION)\n except AttributeError:\n try:\n return str(code.__version__)\n except AttributeError:\n return '<unknown>'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:Return_L126_C12", "label": "return", "type": "return", "loc": [126, 126], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:Try_L125_C8", "vector": [13, 3, 0.3772, 0.003, 3, 0.21, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return str(code.ROBOT_LIBRARY_VERSION)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:Try_L128_C12", "label": "try", "type": "try", "loc": [128, 131], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:Try_L125_C8", "vector": [7, 3, 0.3877, 0.012, 3, 0.21, 0.0, 0, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n return str(code.__version__)\n except AttributeError:\n return '<unknown>'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:Return_L129_C16", "label": "return", "type": "return", "loc": [129, 129], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:Try_L128_C12", "vector": [13, 4, 0.3862, 0.003, 4, 0.15, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return str(code.__version__)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:Return_L131_C16", "label": "return", "type": "return", "loc": [131, 131], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:Try_L128_C12", "vector": [13, 4, 0.3922, 0.003, 4, 0.15, 0.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return '<unknown>'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L133_C4", "label": "_create_init_handler", "type": "function", "loc": [133, 137], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:ClassDef_L82_C0", "vector": [2, 1, 0.4042, 0.015, 1, 0.74, 0.4231, 125, 0, 2, 1, 0, 0, 0, 3], "semantic": {"name": "_create_init_handler", "arg_names": ["self", "libcode"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _create_init_handler(self, libcode):\n init_method = getattr(libcode, '__init__', None)\n if not self._valid_init(init_method):\n init_method = None\n return InitHandler(self, init_method)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:Assign_L134_C8", "label": "init_method = getattr()", "type": "assigned_variable", "loc": [134, 134], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L133_C4", "vector": [14, 2, 0.4012, 0.003, 2, 0.48, 0.0, 748, 3, 3, 0, 0, 121, 10, 1], "semantic": {"name": "init_method", "arg_names": [], "import_names": [], "rhs_call_name": "getattr", "annotation": ""}, "snippet": " init_method = getattr(libcode, '__init__', None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:If_L135_C8", "label": "if", "type": "if", "loc": [135, 136], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L133_C4", "vector": [4, 2, 0.4057, 0.006, 2, 0.48, 0.5, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not self._valid_init(init_method):\n init_method = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:Assign_L136_C12", "label": "init_method =", "type": "assigned_variable", "loc": [136, 136], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:If_L135_C8", "vector": [14, 3, 0.4072, 0.003, 3, 0.99, 0.0, 748, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "init_method", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " init_method = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:Return_L137_C8", "label": "return", "type": "return", "loc": [137, 137], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L133_C4", "vector": [13, 2, 0.4102, 0.003, 2, 0.48, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return InitHandler(self, init_method)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L139_C4", "label": "_valid_init", "type": "function", "loc": [139, 144], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:ClassDef_L82_C0", "vector": [2, 1, 0.4237, 0.018, 1, 0.74, 0.4615, 576, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "_valid_init", "arg_names": ["self", "init_method"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _valid_init(self, init_method):\n if inspect.ismethod(init_method):\n return True\n if utils.is_jython and isinstance(init_method, PyReflectedConstructor):\n return True\n return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:If_L140_C8", "label": "if", "type": "if", "loc": [140, 141], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L139_C4", "vector": [4, 2, 0.4207, 0.006, 2, 0.84, 0.0, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if inspect.ismethod(init_method):\n return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:Return_L141_C12", "label": "return", "type": "return", "loc": [141, 141], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:If_L140_C8", "vector": [13, 3, 0.4222, 0.003, 3, 0.83, 0.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:If_L142_C8", "label": "if", "type": "if", "loc": [142, 143], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L139_C4", "vector": [4, 2, 0.4266, 0.006, 2, 0.84, 0.5, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if utils.is_jython and isinstance(init_method, PyReflectedConstructor):\n return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:Return_L143_C12", "label": "return", "type": "return", "loc": [143, 143], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:If_L142_C8", "vector": [13, 3, 0.4281, 0.003, 3, 0.14, 0.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:Return_L144_C8", "label": "return", "type": "return", "loc": [144, 144], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L139_C4", "vector": [13, 2, 0.4311, 0.003, 2, 0.84, 1.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L146_C4", "label": "init_scope_handling", "type": "function", "loc": [146, 154], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:ClassDef_L82_C0", "vector": [2, 1, 0.4491, 0.0269, 1, 0.74, 0.5, 956, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "init_scope_handling", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def init_scope_handling(self):\n if self.scope == 'GLOBAL':\n return\n self._libinst = None\n self.start_suite = self._caching_start\n self.end_suite = self._restoring_end\n if self.scope == 'TESTCASE':\n self.start_test = self._caching_start"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:If_L147_C8", "label": "if", "type": "if", "loc": [147, 148], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L146_C4", "vector": [4, 2, 0.4416, 0.006, 2, 0.87, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.scope == 'GLOBAL':\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:Return_L148_C12", "label": "return", "type": "return", "loc": [148, 148], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:If_L147_C8", "vector": [13, 3, 0.4431, 0.003, 3, 0.85, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:Assign_L149_C8", "label": "self._libinst =", "type": "assigned_variable", "loc": [149, 149], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L146_C4", "vector": [14, 2, 0.4461, 0.003, 2, 0.87, 0.25, 982, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self._libinst", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._libinst = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:Assign_L150_C8", "label": "self.start_suite =", "type": "assigned_variable", "loc": [150, 150], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L146_C4", "vector": [14, 2, 0.4491, 0.003, 2, 0.87, 0.5, 26, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.start_suite", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.start_suite = self._caching_start"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:Assign_L151_C8", "label": "self.end_suite =", "type": "assigned_variable", "loc": [151, 151], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L146_C4", "vector": [14, 2, 0.4521, 0.003, 2, 0.87, 0.75, 800, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.end_suite", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.end_suite = self._restoring_end"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:If_L152_C8", "label": "if", "type": "if", "loc": [152, 154], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L146_C4", "vector": [4, 2, 0.4581, 0.009, 2, 0.87, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.scope == 'TESTCASE':\n self.start_test = self._caching_start\n self.end_test = self._restoring_end"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:Assign_L153_C12", "label": "self.start_test =", "type": "assigned_variable", "loc": [153, 153], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:If_L152_C8", "vector": [14, 3, 0.4581, 0.003, 3, 0.65, 0.0, 100, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.start_test", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.start_test = self._caching_start"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:Assign_L154_C12", "label": "self.end_test =", "type": "assigned_variable", "loc": [154, 154], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:If_L152_C8", "vector": [14, 3, 0.4611, 0.003, 3, 0.65, 1.0, 898, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.end_test", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.end_test = self._restoring_end"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L156_C4", "label": "_caching_start", "type": "function", "loc": [156, 158], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:ClassDef_L82_C0", "vector": [2, 1, 0.4701, 0.009, 1, 0.74, 0.5385, 251, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_caching_start", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _caching_start(self):\n self._instance_cache.append(self._libinst)\n self._libinst = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:Expr_L157_C8", "label": "append()", "type": "expression", "loc": [157, 157], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L156_C4", "vector": [8, 2, 0.4701, 0.003, 2, 0.15, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self._instance_cache.append(self._libinst)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:Assign_L158_C8", "label": "self._libinst =", "type": "assigned_variable", "loc": [158, 158], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L156_C4", "vector": [14, 2, 0.4731, 0.003, 2, 0.15, 1.0, 982, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self._libinst", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._libinst = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L160_C4", "label": "_restoring_end", "type": "function", "loc": [160, 161], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:ClassDef_L82_C0", "vector": [2, 1, 0.4805, 0.006, 1, 0.74, 0.5769, 235, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_restoring_end", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _restoring_end(self):\n self._libinst = self._instance_cache.pop()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:Assign_L161_C8", "label": "self._libinst = pop()", "type": "assigned_variable", "loc": [161, 161], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L160_C4", "vector": [14, 2, 0.482, 0.003, 2, 0.27, 0.0, 982, 3, 0, 0, 0, 969, 10, 1], "semantic": {"name": "self._libinst", "arg_names": [], "import_names": [], "rhs_call_name": "pop", "annotation": ""}, "snippet": " self._libinst = self._instance_cache.pop()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L163_C4", "label": "_get_scope", "type": "function", "loc": [163, 169], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:ClassDef_L82_C0", "vector": [2, 1, 0.497, 0.021, 1, 0.74, 0.6154, 125, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "_get_scope", "arg_names": ["self", "libcode"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _get_scope(self, libcode):\n try:\n scope = libcode.ROBOT_LIBRARY_SCOPE\n scope = utils.normalize(scope, ignore=['_']).upper()\n except (AttributeError, TypeError):\n scope = 'TESTCASE'\n return scope if scope in ['GLOBAL','TESTSUITE'] else 'TESTCASE'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:Try_L164_C8", "label": "try", "type": "try", "loc": [164, 168], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L163_C4", "vector": [7, 2, 0.497, 0.015, 2, 0.5, 0.0, 0, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n scope = libcode.ROBOT_LIBRARY_SCOPE\n scope = utils.normalize(scope, ignore=['_']).upper()\n except (AttributeError, TypeError):\n scope = 'TESTCASE'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:Assign_L165_C12", "label": "scope =", "type": "assigned_variable", "loc": [165, 165], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:Try_L164_C8", "vector": [14, 3, 0.494, 0.003, 3, 0.91, 0.0, 334, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "scope", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " scope = libcode.ROBOT_LIBRARY_SCOPE"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:Assign_L166_C12", "label": "scope = upper()", "type": "assigned_variable", "loc": [166, 166], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:Try_L164_C8", "vector": [14, 3, 0.497, 0.003, 3, 0.91, 1.0, 334, 3, 0, 0, 0, 347, 10, 2], "semantic": {"name": "scope", "arg_names": [], "import_names": [], "rhs_call_name": "upper", "annotation": ""}, "snippet": " scope = utils.normalize(scope, ignore=['_']).upper()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:Assign_L168_C12", "label": "scope =", "type": "assigned_variable", "loc": [168, 168], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:Try_L164_C8", "vector": [14, 3, 0.503, 0.003, 3, 0.91, 0.0, 334, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "scope", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " scope = 'TESTCASE'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:Return_L169_C8", "label": "return", "type": "return", "loc": [169, 169], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L163_C4", "vector": [13, 2, 0.506, 0.003, 2, 0.5, 1.0, 0, 8, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return scope if scope in ['GLOBAL','TESTSUITE'] else 'TESTCASE'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L171_C4", "label": "get_instance", "type": "function", "loc": [171, 174], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:ClassDef_L82_C0", "vector": [2, 1, 0.5165, 0.012, 1, 0.74, 0.6538, 82, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "get_instance", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_instance(self):\n if self._libinst is None:\n self._libinst = self._get_instance()\n return self._libinst"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:If_L172_C8", "label": "if", "type": "if", "loc": [172, 173], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L171_C4", "vector": [4, 2, 0.5165, 0.006, 2, 0.5, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self._libinst is None:\n self._libinst = self._get_instance()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:Assign_L173_C12", "label": "self._libinst = _get_instance()", "type": "assigned_variable", "loc": [173, 173], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:If_L172_C8", "vector": [14, 3, 0.518, 0.003, 3, 0.82, 0.0, 982, 3, 0, 0, 0, 663, 10, 1], "semantic": {"name": "self._libinst", "arg_names": [], "import_names": [], "rhs_call_name": "_get_instance", "annotation": ""}, "snippet": " self._libinst = self._get_instance()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:Return_L174_C8", "label": "return", "type": "return", "loc": [174, 174], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L171_C4", "vector": [13, 2, 0.521, 0.003, 2, 0.5, 1.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._libinst"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L176_C4", "label": "_get_instance", "type": "function", "loc": [176, 180], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:ClassDef_L82_C0", "vector": [2, 1, 0.5329, 0.015, 1, 0.74, 0.6923, 663, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "_get_instance", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _get_instance(self):\n try:\n return self._libcode(*self.positional_args, **self.named_args)\n except:\n self._raise_creating_instance_failed()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:Try_L177_C8", "label": "try", "type": "try", "loc": [177, 180], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L176_C4", "vector": [7, 2, 0.5344, 0.012, 2, 0.19, 0.0, 0, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n return self._libcode(*self.positional_args, **self.named_args)\n except:\n self._raise_creating_instance_failed()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:Return_L178_C12", "label": "return", "type": "return", "loc": [178, 178], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:Try_L177_C8", "vector": [13, 3, 0.5329, 0.003, 3, 0.33, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._libcode(*self.positional_args, **self.named_args)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:Expr_L180_C12", "label": "_raise_creating_instance_failed()", "type": "expression", "loc": [180, 180], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:Try_L177_C8", "vector": [8, 3, 0.5389, 0.003, 3, 0.33, 0.0, 591, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_raise_creating_instance_failed", "arg_names": [], "import_names": [], "rhs_call_name": "_raise_creating_instance_failed", "annotation": ""}, "snippet": " self._raise_creating_instance_failed()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L182_C4", "label": "_create_handlers", "type": "function", "loc": [182, 191], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:ClassDef_L82_C0", "vector": [2, 1, 0.5584, 0.0299, 1, 0.74, 0.7308, 865, 0, 2, 1, 0, 0, 0, 5], "semantic": {"name": "_create_handlers", "arg_names": ["self", "libcode"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _create_handlers(self, libcode):\n handlers = utils.NormalizedDict(ignore=['_'])\n for name in self._get_handler_names(libcode):\n method = self._try_to_get_handler_method(libcode, name)\n if method:\n handler = self._try_to_create_handler(name, method)\n if handler:\n handlers[name] = handler"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:Assign_L183_C8", "label": "handlers = NormalizedDict()", "type": "assigned_variable", "loc": [183, 183], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L182_C4", "vector": [14, 2, 0.5479, 0.003, 2, 0.98, 0.0, 183, 3, 1, 0, 0, 696, 10, 1], "semantic": {"name": "handlers", "arg_names": [], "import_names": [], "rhs_call_name": "NormalizedDict", "annotation": ""}, "snippet": " handlers = utils.NormalizedDict(ignore=['_'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:For_L184_C8", "label": "for name", "type": "for", "loc": [184, 190], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L182_C4", "vector": [6, 2, 0.5599, 0.021, 2, 0.98, 0.5, 57, 3, 0, 0, 0, 0, 0, 4], "semantic": {"name": "name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for name in self._get_handler_names(libcode):\n method = self._try_to_get_handler_method(libcode, name)\n if method:\n handler = self._try_to_create_handler(name, method)\n if handler:\n handlers[name] = handler\n self._log_success(\"Created keyword '%s'\" % handler.name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:Assign_L185_C12", "label": "method = _try_to_get_handler_method()", "type": "assigned_variable", "loc": [185, 185], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:For_L184_C8", "vector": [14, 3, 0.5539, 0.003, 3, 0.82, 0.0, 445, 3, 2, 0, 0, 742, 10, 1], "semantic": {"name": "method", "arg_names": [], "import_names": [], "rhs_call_name": "_try_to_get_handler_method", "annotation": ""}, "snippet": " method = self._try_to_get_handler_method(libcode, name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:If_L186_C12", "label": "if", "type": "if", "loc": [186, 190], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:For_L184_C8", "vector": [4, 3, 0.5629, 0.015, 3, 0.82, 1.0, 0, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if method:\n handler = self._try_to_create_handler(name, method)\n if handler:\n handlers[name] = handler\n self._log_success(\"Created keyword '%s'\" % handler.name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:Assign_L187_C16", "label": "handler = _try_to_create_handler()", "type": "assigned_variable", "loc": [187, 187], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:If_L186_C12", "vector": [14, 4, 0.5599, 0.003, 4, 0.18, 0.0, 388, 3, 2, 0, 0, 27, 10, 1], "semantic": {"name": "handler", "arg_names": [], "import_names": [], "rhs_call_name": "_try_to_create_handler", "annotation": ""}, "snippet": " handler = self._try_to_create_handler(name, method)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:If_L188_C16", "label": "if", "type": "if", "loc": [188, 190], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:If_L186_C12", "vector": [4, 4, 0.5659, 0.009, 4, 0.18, 1.0, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if handler:\n handlers[name] = handler\n self._log_success(\"Created keyword '%s'\" % handler.name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:Assign_L189_C20", "label": "assign", "type": "assigned_variable", "loc": [189, 189], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:If_L188_C16", "vector": [14, 5, 0.5659, 0.003, 5, 0.09, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " handlers[name] = handler"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:Expr_L190_C20", "label": "_log_success()", "type": "expression", "loc": [190, 190], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:If_L188_C16", "vector": [8, 5, 0.5689, 0.003, 5, 0.09, 1.0, 499, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_log_success", "arg_names": [], "import_names": [], "rhs_call_name": "_log_success", "annotation": ""}, "snippet": " self._log_success(\"Created keyword '%s'\" % handler.name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:Return_L191_C8", "label": "return", "type": "return", "loc": [191, 191], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L182_C4", "vector": [13, 2, 0.5719, 0.003, 2, 0.98, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return handlers"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L193_C4", "label": "_get_handler_names", "type": "function", "loc": [193, 195], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:ClassDef_L82_C0", "vector": [2, 1, 0.5808, 0.009, 1, 0.74, 0.7692, 305, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "_get_handler_names", "arg_names": ["self", "libcode"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _get_handler_names(self, libcode):\n return [name for name in dir(libcode)\n if not name.startswith(('_', 'ROBOT_LIBRARY_'))]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:Return_L194_C8", "label": "return", "type": "return", "loc": [194, 195], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L193_C4", "vector": [13, 2, 0.5823, 0.006, 2, 0.36, 0.0, 0, 5, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return [name for name in dir(libcode)\n if not name.startswith(('_', 'ROBOT_LIBRARY_'))]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L197_C4", "label": "_try_to_get_handler_method", "type": "function", "loc": [197, 201], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:ClassDef_L82_C0", "vector": [2, 1, 0.5958, 0.015, 1, 0.74, 0.8077, 742, 0, 3, 1, 0, 0, 0, 2], "semantic": {"name": "_try_to_get_handler_method", "arg_names": ["self", "libcode", "name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _try_to_get_handler_method(self, libcode, name):\n try:\n return self._get_handler_method(libcode, name)\n except:\n self._report_adding_keyword_failed(name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:Try_L198_C8", "label": "try", "type": "try", "loc": [198, 201], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L197_C4", "vector": [7, 2, 0.5973, 0.012, 2, 0.64, 0.0, 0, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n return self._get_handler_method(libcode, name)\n except:\n self._report_adding_keyword_failed(name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:Return_L199_C12", "label": "return", "type": "return", "loc": [199, 199], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:Try_L198_C8", "vector": [13, 3, 0.5958, 0.003, 3, 0.13, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._get_handler_method(libcode, name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:Expr_L201_C12", "label": "_report_adding_keyword_failed()", "type": "expression", "loc": [201, 201], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:Try_L198_C8", "vector": [8, 3, 0.6018, 0.003, 3, 0.13, 0.0, 16, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_report_adding_keyword_failed", "arg_names": [], "import_names": [], "rhs_call_name": "_report_adding_keyword_failed", "annotation": ""}, "snippet": " self._report_adding_keyword_failed(name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L203_C4", "label": "_report_adding_keyword_failed", "type": "function", "loc": [203, 208], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:ClassDef_L82_C0", "vector": [2, 1, 0.6153, 0.018, 1, 0.74, 0.8462, 16, 0, 2, 0, 0, 0, 0, 3], "semantic": {"name": "_report_adding_keyword_failed", "arg_names": ["self", "name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _report_adding_keyword_failed(self, name):\n msg, details = utils.get_error_details()\n self._log_failure(\"Adding keyword '%s' to library '%s' failed: %s\"\n % (name, self.name, msg))\n if details:\n self._log_failure_details('Details:\\n%s' % details)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:Assign_L204_C8", "label": "msg, details = get_error_details()", "type": "assigned_variable", "loc": [204, 204], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L203_C4", "vector": [14, 2, 0.6108, 0.003, 2, 0.95, 0.0, 814, 3, 0, 0, 0, 692, 10, 1], "semantic": {"name": "msg, details", "arg_names": [], "import_names": [], "rhs_call_name": "get_error_details", "annotation": ""}, "snippet": " msg, details = utils.get_error_details()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:Expr_L205_C8", "label": "_log_failure()", "type": "expression", "loc": [205, 206], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L203_C4", "vector": [8, 2, 0.6153, 0.006, 2, 0.95, 0.5, 344, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_log_failure", "arg_names": [], "import_names": [], "rhs_call_name": "_log_failure", "annotation": ""}, "snippet": " self._log_failure(\"Adding keyword '%s' to library '%s' failed: %s\"\n % (name, self.name, msg))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:If_L207_C8", "label": "if", "type": "if", "loc": [207, 208], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L203_C4", "vector": [4, 2, 0.6213, 0.006, 2, 0.95, 1.0, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if details:\n self._log_failure_details('Details:\\n%s' % details)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:Expr_L208_C12", "label": "_log_failure_details()", "type": "expression", "loc": [208, 208], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:If_L207_C8", "vector": [8, 3, 0.6228, 0.003, 3, 0.62, 0.0, 966, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_log_failure_details", "arg_names": [], "import_names": [], "rhs_call_name": "_log_failure_details", "annotation": ""}, "snippet": " self._log_failure_details('Details:\\n%s' % details)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L210_C4", "label": "_get_handler_method", "type": "function", "loc": [210, 214], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:ClassDef_L82_C0", "vector": [2, 1, 0.6347, 0.015, 1, 0.74, 0.8846, 558, 0, 3, 1, 0, 0, 0, 3], "semantic": {"name": "_get_handler_method", "arg_names": ["self", "libcode", "name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _get_handler_method(self, libcode, name):\n method = getattr(libcode, name)\n if not inspect.isroutine(method):\n raise DataError('Not a method or function')\n return method"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:Assign_L211_C8", "label": "method = getattr()", "type": "assigned_variable", "loc": [211, 211], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L210_C4", "vector": [14, 2, 0.6317, 0.003, 2, 0.72, 0.0, 445, 3, 2, 0, 0, 121, 10, 1], "semantic": {"name": "method", "arg_names": [], "import_names": [], "rhs_call_name": "getattr", "annotation": ""}, "snippet": " method = getattr(libcode, name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:If_L212_C8", "label": "if", "type": "if", "loc": [212, 213], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L210_C4", "vector": [4, 2, 0.6362, 0.006, 2, 0.72, 0.5, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not inspect.isroutine(method):\n raise DataError('Not a method or function')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:Return_L214_C8", "label": "return", "type": "return", "loc": [214, 214], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L210_C4", "vector": [13, 2, 0.6407, 0.003, 2, 0.72, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return method"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L216_C4", "label": "_try_to_create_handler", "type": "function", "loc": [216, 220], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:ClassDef_L82_C0", "vector": [2, 1, 0.6527, 0.015, 1, 0.74, 0.9231, 27, 0, 3, 1, 0, 0, 0, 2], "semantic": {"name": "_try_to_create_handler", "arg_names": ["self", "name", "method"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _try_to_create_handler(self, name, method):\n try:\n return self._create_handler(name, method)\n except:\n self._report_adding_keyword_failed(name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:Try_L217_C8", "label": "try", "type": "try", "loc": [217, 220], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L216_C4", "vector": [7, 2, 0.6542, 0.012, 2, 0.81, 0.0, 0, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n return self._create_handler(name, method)\n except:\n self._report_adding_keyword_failed(name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:Return_L218_C12", "label": "return", "type": "return", "loc": [218, 218], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:Try_L217_C8", "vector": [13, 3, 0.6527, 0.003, 3, 0.13, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._create_handler(name, method)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:Expr_L220_C12", "label": "_report_adding_keyword_failed()", "type": "expression", "loc": [220, 220], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:Try_L217_C8", "vector": [8, 3, 0.6587, 0.003, 3, 0.13, 0.0, 16, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_report_adding_keyword_failed", "arg_names": [], "import_names": [], "rhs_call_name": "_report_adding_keyword_failed", "annotation": ""}, "snippet": " self._report_adding_keyword_failed(name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L222_C4", "label": "_create_handler", "type": "function", "loc": [222, 223], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:ClassDef_L82_C0", "vector": [2, 1, 0.6662, 0.006, 1, 0.74, 0.9615, 80, 0, 3, 1, 0, 0, 0, 1], "semantic": {"name": "_create_handler", "arg_names": ["self", "handler_name", "handler_method"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _create_handler(self, handler_name, handler_method):\n return Handler(self, handler_name, handler_method)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:Return_L223_C8", "label": "return", "type": "return", "loc": [223, 223], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L222_C4", "vector": [13, 2, 0.6677, 0.003, 2, 0.85, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return Handler(self, handler_name, handler_method)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L225_C4", "label": "_raise_creating_instance_failed", "type": "function", "loc": [225, 233], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:ClassDef_L82_C0", "vector": [2, 1, 0.6856, 0.0269, 1, 0.74, 1.0, 591, 0, 1, 0, 0, 0, 0, 4], "semantic": {"name": "_raise_creating_instance_failed", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _raise_creating_instance_failed(self):\n msg, details = utils.get_error_details()\n if self.positional_args:\n args = \"argument%s %s\" % (utils.plural_or_not(self.positional_args),\n utils.seq2str(self.positional_args))\n else:\n args = \"no arguments\"\n raise DataError(\"Creating an instance of the test library '%s' with %s \""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:Assign_L226_C8", "label": "msg, details = get_error_details()", "type": "assigned_variable", "loc": [226, 226], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L225_C4", "vector": [14, 2, 0.6766, 0.003, 2, 0.86, 0.0, 814, 3, 0, 0, 0, 692, 10, 1], "semantic": {"name": "msg, details", "arg_names": [], "import_names": [], "rhs_call_name": "get_error_details", "annotation": ""}, "snippet": " msg, details = utils.get_error_details()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:If_L227_C8", "label": "if", "type": "if", "loc": [227, 231], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L225_C4", "vector": [4, 2, 0.6856, 0.015, 2, 0.86, 1.0, 0, 7, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.positional_args:\n args = \"argument%s %s\" % (utils.plural_or_not(self.positional_args),\n utils.seq2str(self.positional_args))\n else:\n args = \"no arguments\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:Assign_L228_C12", "label": "args =", "type": "assigned_variable", "loc": [228, 229], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:If_L227_C8", "vector": [14, 3, 0.6841, 0.006, 3, 0.06, 0.0, 805, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "args", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " args = \"argument%s %s\" % (utils.plural_or_not(self.positional_args),\n utils.seq2str(self.positional_args))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:Assign_L231_C12", "label": "args =", "type": "assigned_variable", "loc": [231, 231], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:If_L227_C8", "vector": [14, 3, 0.6916, 0.003, 3, 0.06, 1.0, 805, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "args", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " args = \"no arguments\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:ClassDef_L236_C0", "label": "_ClassLibrary", "type": "class", "loc": [236, 276], "level": 0, "parent": null, "vector": [3, 0, 0.7665, 0.1228, 0, 0.66, 0.8, 359, 0, 6, 0, 0, 63, 0, 15], "semantic": {"name": "_ClassLibrary", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class _ClassLibrary(_BaseTestLibrary):\n supports_named_arguments = True # this attribute is for libdoc\n\n def _get_handler_method(self, libinst, name):\n # Type is checked before using getattr to avoid calling properties,\n # most importantly bean properties generated by Jython (issue 188).\n for item in (libinst,) + inspect.getmro(libinst.__class__):\n if item in (object, Object):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:Assign_L237_C4", "label": "supports_named_arguments =", "type": "assigned_variable", "loc": [237, 237], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:ClassDef_L236_C0", "vector": [14, 1, 0.7096, 0.003, 1, 0.35, 0.0, 278, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "supports_named_arguments", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " supports_named_arguments = True # this attribute is for libdoc"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L239_C4", "label": "_get_handler_method", "type": "function", "loc": [239, 249], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:ClassDef_L236_C0", "vector": [2, 1, 0.7305, 0.0329, 1, 0.35, 0.1667, 558, 0, 3, 1, 0, 0, 0, 5], "semantic": {"name": "_get_handler_method", "arg_names": ["self", "libinst", "name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _get_handler_method(self, libinst, name):\n # Type is checked before using getattr to avoid calling properties,\n # most importantly bean properties generated by Jython (issue 188).\n for item in (libinst,) + inspect.getmro(libinst.__class__):\n if item in (object, Object):\n continue\n if not (hasattr(item, '__dict__') and name in item.__dict__):\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:For_L242_C8", "label": "for item", "type": "for", "loc": [242, 248], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L239_C4", "vector": [6, 2, 0.7335, 0.021, 2, 0.61, 0.0, 434, 4, 0, 0, 0, 0, 0, 4], "semantic": {"name": "item", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for item in (libinst,) + inspect.getmro(libinst.__class__):\n if item in (object, Object):\n continue\n if not (hasattr(item, '__dict__') and name in item.__dict__):\n continue\n self._validate_handler(item.__dict__[name])\n return getattr(libinst, name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:If_L243_C12", "label": "if", "type": "if", "loc": [243, 244], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:For_L242_C8", "vector": [4, 3, 0.729, 0.006, 3, 0.82, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if item in (object, Object):\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:If_L245_C12", "label": "if", "type": "if", "loc": [245, 246], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:For_L242_C8", "vector": [4, 3, 0.735, 0.006, 3, 0.82, 0.3333, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not (hasattr(item, '__dict__') and name in item.__dict__):\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:Expr_L247_C12", "label": "_validate_handler()", "type": "expression", "loc": [247, 247], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:For_L242_C8", "vector": [8, 3, 0.7395, 0.003, 3, 0.82, 0.6667, 195, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_validate_handler", "arg_names": [], "import_names": [], "rhs_call_name": "_validate_handler", "annotation": ""}, "snippet": " self._validate_handler(item.__dict__[name])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:Return_L248_C12", "label": "return", "type": "return", "loc": [248, 248], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:For_L242_C8", "vector": [13, 3, 0.7425, 0.003, 3, 0.82, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return getattr(libinst, name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L251_C4", "label": "_validate_handler", "type": "function", "loc": [251, 255], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:ClassDef_L236_C0", "vector": [2, 1, 0.7575, 0.015, 1, 0.35, 0.3333, 195, 0, 2, 0, 0, 0, 0, 4], "semantic": {"name": "_validate_handler", "arg_names": ["self", "handler"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _validate_handler(self, handler):\n if not self._is_routine(handler):\n raise DataError('Not a method or function')\n if self._is_implicit_java_or_jython_method(handler):\n raise DataError('Implicit methods are ignored')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:If_L252_C8", "label": "if", "type": "if", "loc": [252, 253], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L251_C4", "vector": [4, 2, 0.756, 0.006, 2, 0.2, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not self._is_routine(handler):\n raise DataError('Not a method or function')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:If_L254_C8", "label": "if", "type": "if", "loc": [254, 255], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L251_C4", "vector": [4, 2, 0.762, 0.006, 2, 0.2, 1.0, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self._is_implicit_java_or_jython_method(handler):\n raise DataError('Implicit methods are ignored')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L257_C4", "label": "_is_routine", "type": "function", "loc": [257, 260], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:ClassDef_L236_C0", "vector": [2, 1, 0.774, 0.012, 1, 0.35, 0.5, 916, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "_is_routine", "arg_names": ["self", "handler"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _is_routine(self, handler):\n # inspect.isroutine doesn't work with methods from Java classes\n # prior to Jython 2.5.2: http://bugs.jython.org/issue1223\n return inspect.isroutine(handler) or self._is_java_method(handler)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:Return_L260_C8", "label": "return", "type": "return", "loc": [260, 260], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L257_C4", "vector": [13, 2, 0.7784, 0.003, 2, 0.21, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return inspect.isroutine(handler) or self._is_java_method(handler)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L262_C4", "label": "_is_java_method", "type": "function", "loc": [262, 263], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:ClassDef_L236_C0", "vector": [2, 1, 0.7859, 0.006, 1, 0.35, 0.6667, 95, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "_is_java_method", "arg_names": ["self", "handler"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _is_java_method(self, handler):\n return utils.is_jython and isinstance(handler, PyReflectedFunction)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:Return_L263_C8", "label": "return", "type": "return", "loc": [263, 263], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L262_C4", "vector": [13, 2, 0.7874, 0.003, 2, 0.78, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return utils.is_jython and isinstance(handler, PyReflectedFunction)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L265_C4", "label": "_is_implicit_java_or_jython_method", "type": "function", "loc": [265, 272], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:ClassDef_L236_C0", "vector": [2, 1, 0.8039, 0.024, 1, 0.35, 0.8333, 817, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "_is_implicit_java_or_jython_method", "arg_names": ["self", "handler"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _is_implicit_java_or_jython_method(self, handler):\n if not self._is_java_method(handler):\n return False\n for signature in handler.argslist[:handler.nargs]:\n cls = signature.declaringClass\n if not (cls is Object or self._is_created_by_jython(handler, cls)):\n return False\n return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:If_L266_C8", "label": "if", "type": "if", "loc": [266, 267], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L265_C4", "vector": [4, 2, 0.7979, 0.006, 2, 0.5, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not self._is_java_method(handler):\n return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:Return_L267_C12", "label": "return", "type": "return", "loc": [267, 267], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:If_L266_C8", "vector": [13, 3, 0.7994, 0.003, 3, 0.59, 0.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:For_L268_C8", "label": "for signature", "type": "for", "loc": [268, 271], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L265_C4", "vector": [6, 2, 0.8069, 0.012, 2, 0.5, 0.5, 932, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "signature", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for signature in handler.argslist[:handler.nargs]:\n cls = signature.declaringClass\n if not (cls is Object or self._is_created_by_jython(handler, cls)):\n return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:Assign_L269_C12", "label": "cls =", "type": "assigned_variable", "loc": [269, 269], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:For_L268_C8", "vector": [14, 3, 0.8054, 0.003, 3, 0.14, 0.0, 594, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "cls", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cls = signature.declaringClass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:If_L270_C12", "label": "if", "type": "if", "loc": [270, 271], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:For_L268_C8", "vector": [4, 3, 0.8099, 0.006, 3, 0.14, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not (cls is Object or self._is_created_by_jython(handler, cls)):\n return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:Return_L271_C16", "label": "return", "type": "return", "loc": [271, 271], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:If_L270_C12", "vector": [13, 4, 0.8114, 0.003, 4, 0.33, 0.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:Return_L272_C8", "label": "return", "type": "return", "loc": [272, 272], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L265_C4", "vector": [13, 2, 0.8144, 0.003, 2, 0.5, 1.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L274_C4", "label": "_is_created_by_jython", "type": "function", "loc": [274, 276], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:ClassDef_L236_C0", "vector": [2, 1, 0.8234, 0.009, 1, 0.35, 1.0, 387, 0, 3, 1, 0, 0, 0, 1], "semantic": {"name": "_is_created_by_jython", "arg_names": ["self", "handler", "cls"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _is_created_by_jython(self, handler, cls):\n proxy_methods = getattr(cls, '__supernames__', []) + ['classDictInit']\n return handler.__name__ in proxy_methods"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:Assign_L275_C8", "label": "proxy_methods =", "type": "assigned_variable", "loc": [275, 275], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L274_C4", "vector": [14, 2, 0.8234, 0.003, 2, 0.14, 0.0, 718, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "proxy_methods", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " proxy_methods = getattr(cls, '__supernames__', []) + ['classDictInit']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:Return_L276_C8", "label": "return", "type": "return", "loc": [276, 276], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L274_C4", "vector": [13, 2, 0.8263, 0.003, 2, 0.14, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return handler.__name__ in proxy_methods"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:ClassDef_L279_C0", "label": "_ModuleLibrary", "type": "class", "loc": [279, 296], "level": 0, "parent": null, "vector": [3, 0, 0.8608, 0.0539, 0, 0.66, 0.8667, 550, 0, 4, 0, 0, 63, 0, 5], "semantic": {"name": "_ModuleLibrary", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class _ModuleLibrary(_BaseTestLibrary):\n supports_named_arguments = True # this attribute is for libdoc\n\n def _get_scope(self, libcode):\n return 'GLOBAL'\n\n def _get_handler_method(self, libcode, name):\n method = _BaseTestLibrary._get_handler_method(self, libcode, name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:Assign_L280_C4", "label": "supports_named_arguments =", "type": "assigned_variable", "loc": [280, 280], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:ClassDef_L279_C0", "vector": [14, 1, 0.8383, 0.003, 1, 0.11, 0.0, 278, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "supports_named_arguments", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " supports_named_arguments = True # this attribute is for libdoc"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L282_C4", "label": "_get_scope", "type": "function", "loc": [282, 283], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:ClassDef_L279_C0", "vector": [2, 1, 0.8458, 0.006, 1, 0.11, 0.25, 125, 0, 2, 1, 0, 0, 0, 0], "semantic": {"name": "_get_scope", "arg_names": ["self", "libcode"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _get_scope(self, libcode):\n return 'GLOBAL'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:Return_L283_C8", "label": "return", "type": "return", "loc": [283, 283], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L282_C4", "vector": [13, 2, 0.8473, 0.003, 2, 0.73, 0.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 'GLOBAL'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L285_C4", "label": "_get_handler_method", "type": "function", "loc": [285, 289], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:ClassDef_L279_C0", "vector": [2, 1, 0.8593, 0.015, 1, 0.11, 0.5, 558, 0, 3, 1, 0, 0, 0, 3], "semantic": {"name": "_get_handler_method", "arg_names": ["self", "libcode", "name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _get_handler_method(self, libcode, name):\n method = _BaseTestLibrary._get_handler_method(self, libcode, name)\n if hasattr(libcode, '__all__') and name not in libcode.__all__:\n raise DataError('Not exposed as a keyword')\n return method"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:Assign_L286_C8", "label": "method = _get_handler_method()", "type": "assigned_variable", "loc": [286, 286], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L285_C4", "vector": [14, 2, 0.8563, 0.003, 2, 0.98, 0.0, 445, 3, 3, 0, 0, 558, 10, 1], "semantic": {"name": "method", "arg_names": [], "import_names": [], "rhs_call_name": "_get_handler_method", "annotation": ""}, "snippet": " method = _BaseTestLibrary._get_handler_method(self, libcode, name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:If_L287_C8", "label": "if", "type": "if", "loc": [287, 288], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L285_C4", "vector": [4, 2, 0.8608, 0.006, 2, 0.98, 0.5, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if hasattr(libcode, '__all__') and name not in libcode.__all__:\n raise DataError('Not exposed as a keyword')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:Return_L289_C8", "label": "return", "type": "return", "loc": [289, 289], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L285_C4", "vector": [13, 2, 0.8653, 0.003, 2, 0.98, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return method"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L291_C4", "label": "get_instance", "type": "function", "loc": [291, 293], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:ClassDef_L279_C0", "vector": [2, 1, 0.8743, 0.009, 1, 0.11, 0.75, 82, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "get_instance", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_instance(self):\n self.init.arguments.check_arg_limits(self.positional_args)\n return self._libcode"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:Expr_L292_C8", "label": "check_arg_limits()", "type": "expression", "loc": [292, 292], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L291_C4", "vector": [8, 2, 0.8743, 0.003, 2, 0.78, 0.0, 324, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "check_arg_limits", "arg_names": [], "import_names": [], "rhs_call_name": "check_arg_limits", "annotation": ""}, "snippet": " self.init.arguments.check_arg_limits(self.positional_args)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:Return_L293_C8", "label": "return", "type": "return", "loc": [293, 293], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L291_C4", "vector": [13, 2, 0.8772, 0.003, 2, 0.78, 1.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._libcode"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L295_C4", "label": "_create_init_handler", "type": "function", "loc": [295, 296], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:ClassDef_L279_C0", "vector": [2, 1, 0.8847, 0.006, 1, 0.11, 1.0, 125, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "_create_init_handler", "arg_names": ["self", "libcode"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _create_init_handler(self, libcode):\n return InitHandler(self, None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:Return_L296_C8", "label": "return", "type": "return", "loc": [296, 296], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L295_C4", "vector": [13, 2, 0.8862, 0.003, 2, 0.55, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return InitHandler(self, None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:ClassDef_L299_C0", "label": "_HybridLibrary", "type": "class", "loc": [299, 306], "level": 0, "parent": null, "vector": [3, 0, 0.9057, 0.024, 0, 0.66, 0.9333, 871, 0, 1, 0, 0, 63, 0, 2], "semantic": {"name": "_HybridLibrary", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class _HybridLibrary(_BaseTestLibrary):\n _log_failure = LOGGER.warn\n\n def _get_handler_names(self, instance):\n try:\n return instance.get_keyword_names()\n except AttributeError:\n return instance.getKeywordNames()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:Assign_L300_C4", "label": "_log_failure =", "type": "assigned_variable", "loc": [300, 300], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:ClassDef_L299_C0", "vector": [14, 1, 0.8982, 0.003, 1, 0.64, 0.0, 344, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "_log_failure", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " _log_failure = LOGGER.warn"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L302_C4", "label": "_get_handler_names", "type": "function", "loc": [302, 306], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:ClassDef_L299_C0", "vector": [2, 1, 0.9102, 0.015, 1, 0.64, 1.0, 305, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "_get_handler_names", "arg_names": ["self", "instance"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _get_handler_names(self, instance):\n try:\n return instance.get_keyword_names()\n except AttributeError:\n return instance.getKeywordNames()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:Try_L303_C8", "label": "try", "type": "try", "loc": [303, 306], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L302_C4", "vector": [7, 2, 0.9117, 0.012, 2, 0.16, 0.0, 0, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n return instance.get_keyword_names()\n except AttributeError:\n return instance.getKeywordNames()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:Return_L304_C12", "label": "return", "type": "return", "loc": [304, 304], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:Try_L303_C8", "vector": [13, 3, 0.9102, 0.003, 3, 0.56, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return instance.get_keyword_names()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:Return_L306_C12", "label": "return", "type": "return", "loc": [306, 306], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:Try_L303_C8", "vector": [13, 3, 0.9162, 0.003, 3, 0.56, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return instance.getKeywordNames()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:ClassDef_L309_C0", "label": "_DynamicLibrary", "type": "class", "loc": [309, 334], "level": 0, "parent": null, "vector": [3, 0, 0.9626, 0.0778, 0, 0.66, 1.0, 937, 0, 4, 0, 0, 63, 0, 8], "semantic": {"name": "_DynamicLibrary", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class _DynamicLibrary(_BaseTestLibrary):\n _log_failure = LOGGER.warn\n\n def __init__(self, libcode, source, name, args, variables=None):\n _BaseTestLibrary.__init__(self, libcode, source, name, args, variables)\n self._get_kw_doc = \\\n _DynamicMethod(libcode, 'get_keyword_documentation', default='')\n self._get_kw_args = \\"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:Assign_L310_C4", "label": "_log_failure =", "type": "assigned_variable", "loc": [310, 310], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:ClassDef_L309_C0", "vector": [14, 1, 0.9281, 0.003, 1, 0.78, 0.0, 344, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "_log_failure", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " _log_failure = LOGGER.warn"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L312_C4", "label": "__init__", "type": "function", "loc": [312, 317], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:ClassDef_L309_C0", "vector": [2, 1, 0.9416, 0.018, 1, 0.78, 0.25, 555, 0, 6, 0, 0, 0, 0, 3], "semantic": {"name": "__init__", "arg_names": ["self", "libcode", "source", "name", "args", "variables"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, libcode, source, name, args, variables=None):\n _BaseTestLibrary.__init__(self, libcode, source, name, args, variables)\n self._get_kw_doc = \\\n _DynamicMethod(libcode, 'get_keyword_documentation', default='')\n self._get_kw_args = \\\n _DynamicMethod(libcode, 'get_keyword_arguments', default=None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:Expr_L313_C8", "label": "__init__()", "type": "expression", "loc": [313, 313], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L312_C4", "vector": [8, 2, 0.9371, 0.003, 2, 0.45, 0.0, 555, 3, 6, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " _BaseTestLibrary.__init__(self, libcode, source, name, args, variables)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:Assign_L314_C8", "label": "self._get_kw_doc = _DynamicMethod()", "type": "assigned_variable", "loc": [314, 315], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L312_C4", "vector": [14, 2, 0.9416, 0.006, 2, 0.45, 0.5, 381, 3, 3, 0, 0, 812, 10, 1], "semantic": {"name": "self._get_kw_doc", "arg_names": [], "import_names": [], "rhs_call_name": "_DynamicMethod", "annotation": ""}, "snippet": " self._get_kw_doc = \\\n _DynamicMethod(libcode, 'get_keyword_documentation', default='')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:Assign_L316_C8", "label": "self._get_kw_args = _DynamicMethod()", "type": "assigned_variable", "loc": [316, 317], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L312_C4", "vector": [14, 2, 0.9476, 0.006, 2, 0.45, 1.0, 27, 3, 3, 0, 0, 812, 10, 1], "semantic": {"name": "self._get_kw_args", "arg_names": [], "import_names": [], "rhs_call_name": "_DynamicMethod", "annotation": ""}, "snippet": " self._get_kw_args = \\\n _DynamicMethod(libcode, 'get_keyword_arguments', default=None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L319_C4", "label": "_get_handler_names", "type": "function", "loc": [319, 323], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:ClassDef_L309_C0", "vector": [2, 1, 0.9611, 0.015, 1, 0.78, 0.5, 305, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "_get_handler_names", "arg_names": ["self", "instance"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _get_handler_names(self, instance):\n try:\n return instance.get_keyword_names()\n except AttributeError:\n return instance.getKeywordNames()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:Try_L320_C8", "label": "try", "type": "try", "loc": [320, 323], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L319_C4", "vector": [7, 2, 0.9626, 0.012, 2, 0.89, 0.0, 0, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n return instance.get_keyword_names()\n except AttributeError:\n return instance.getKeywordNames()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:Return_L321_C12", "label": "return", "type": "return", "loc": [321, 321], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:Try_L320_C8", "vector": [13, 3, 0.9611, 0.003, 3, 0.29, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return instance.get_keyword_names()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:Return_L323_C12", "label": "return", "type": "return", "loc": [323, 323], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:Try_L320_C8", "vector": [13, 3, 0.9671, 0.003, 3, 0.29, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return instance.getKeywordNames()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L325_C4", "label": "_get_handler_method", "type": "function", "loc": [325, 329], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:ClassDef_L309_C0", "vector": [2, 1, 0.979, 0.015, 1, 0.78, 0.75, 558, 0, 3, 1, 0, 0, 0, 0], "semantic": {"name": "_get_handler_method", "arg_names": ["self", "instance", "name_is_ignored"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _get_handler_method(self, instance, name_is_ignored):\n try:\n return instance.run_keyword\n except AttributeError:\n return instance.runKeyword"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:Try_L326_C8", "label": "try", "type": "try", "loc": [326, 329], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L325_C4", "vector": [7, 2, 0.9805, 0.012, 2, 0.63, 0.0, 0, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n return instance.run_keyword\n except AttributeError:\n return instance.runKeyword"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:Return_L327_C12", "label": "return", "type": "return", "loc": [327, 327], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:Try_L326_C8", "vector": [13, 3, 0.979, 0.003, 3, 0.27, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return instance.run_keyword"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:Return_L329_C12", "label": "return", "type": "return", "loc": [329, 329], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:Try_L326_C8", "vector": [13, 3, 0.985, 0.003, 3, 0.27, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return instance.runKeyword"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L331_C4", "label": "_create_handler", "type": "function", "loc": [331, 334], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:ClassDef_L309_C0", "vector": [2, 1, 0.9955, 0.012, 1, 0.78, 1.0, 80, 0, 3, 1, 0, 0, 0, 3], "semantic": {"name": "_create_handler", "arg_names": ["self", "handler_name", "handler_method"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _create_handler(self, handler_name, handler_method):\n doc = self._get_kw_doc(self._libinst, handler_name)\n argspec = self._get_kw_args(self._libinst, handler_name)\n return DynamicHandler(self, handler_name, handler_method, doc, argspec)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:Assign_L332_C8", "label": "doc = _get_kw_doc()", "type": "assigned_variable", "loc": [332, 332], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L331_C4", "vector": [14, 2, 0.994, 0.003, 2, 0.71, 0.0, 555, 3, 2, 0, 0, 688, 10, 1], "semantic": {"name": "doc", "arg_names": [], "import_names": [], "rhs_call_name": "_get_kw_doc", "annotation": ""}, "snippet": " doc = self._get_kw_doc(self._libinst, handler_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:Assign_L333_C8", "label": "argspec = _get_kw_args()", "type": "assigned_variable", "loc": [333, 333], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L331_C4", "vector": [14, 2, 0.997, 0.003, 2, 0.71, 0.5, 404, 3, 2, 0, 0, 158, 10, 1], "semantic": {"name": "argspec", "arg_names": [], "import_names": [], "rhs_call_name": "_get_kw_args", "annotation": ""}, "snippet": " argspec = self._get_kw_args(self._libinst, handler_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99824:Return_L334_C8", "label": "return", "type": "return", "loc": [334, 334], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L331_C4", "vector": [13, 2, 1.0, 0.003, 2, 0.71, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return DynamicHandler(self, handler_name, handler_method, doc, argspec)"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99824:If_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:ImportFrom_L26_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:If_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:ImportFrom_L27_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:If_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:Assign_L29_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L32_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:Assign_L33_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L32_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:Assign_L34_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L32_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:Assign_L35_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L32_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:If_L36_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:If_L36_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:Expr_L37_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L32_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:Return_L38_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L41_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:If_L42_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:If_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:Return_L43_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L41_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:If_L44_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:If_L44_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:If_L45_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:If_L45_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:Return_L46_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:If_L45_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:Return_L48_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L41_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:Return_L49_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:ClassDef_L52_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L54_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:Assign_L55_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:Assign_L56_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:ClassDef_L52_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L58_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L58_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:If_L59_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:If_L59_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:Return_L60_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L58_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:Try_L61_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:Try_L61_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:Return_L62_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:ClassDef_L52_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L67_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L67_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:Return_L68_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:ClassDef_L52_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L70_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L70_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:For_L71_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:For_L71_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:Assign_L72_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:For_L71_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:If_L73_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:If_L73_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:Return_L74_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L70_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:Return_L75_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:ClassDef_L52_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L77_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L77_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:Assign_L78_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L77_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:Return_L79_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:ClassDef_L82_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:Assign_L83_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:ClassDef_L82_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:Assign_L84_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:ClassDef_L82_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:Assign_L85_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:ClassDef_L82_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:Assign_L86_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:ClassDef_L82_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L88_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L88_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:If_L89_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:If_L89_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:Assign_L90_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L88_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:Assign_L91_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L88_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:Assign_L92_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L88_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:Assign_L93_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L88_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:Assign_L94_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L88_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:Assign_L95_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L88_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:Assign_L96_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L88_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:Assign_L97_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L88_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:Assign_L98_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L88_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:If_L99_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:If_L99_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:Assign_L100_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:If_L99_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:Assign_L101_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:If_L99_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:Assign_L102_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:If_L99_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:Assign_L103_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:If_L99_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:Assign_L104_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:ClassDef_L82_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L106_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L106_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:If_L107_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:If_L107_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:Assign_L108_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:If_L107_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:Assign_L109_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:If_L107_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:Expr_L110_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:ClassDef_L82_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L112_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:ClassDef_L82_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L115_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:ClassDef_L82_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L118_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:ClassDef_L82_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L121_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:ClassDef_L82_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L124_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L124_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:Try_L125_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:Try_L125_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:Return_L126_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:Try_L125_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:Try_L128_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:Try_L128_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:Return_L129_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:Try_L128_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:Return_L131_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:ClassDef_L82_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L133_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L133_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:Assign_L134_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L133_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:If_L135_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:If_L135_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:Assign_L136_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L133_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:Return_L137_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:ClassDef_L82_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L139_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L139_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:If_L140_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:If_L140_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:Return_L141_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L139_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:If_L142_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:If_L142_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:Return_L143_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L139_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:Return_L144_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:ClassDef_L82_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L146_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L146_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:If_L147_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:If_L147_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:Return_L148_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L146_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:Assign_L149_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L146_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:Assign_L150_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L146_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:Assign_L151_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L146_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:If_L152_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:If_L152_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:Assign_L153_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:If_L152_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:Assign_L154_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:ClassDef_L82_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L156_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L156_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:Expr_L157_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L156_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:Assign_L158_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:ClassDef_L82_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L160_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L160_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:Assign_L161_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:ClassDef_L82_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L163_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L163_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:Try_L164_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:Try_L164_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:Assign_L165_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:Try_L164_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:Assign_L166_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:Try_L164_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:Assign_L168_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L163_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:Return_L169_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:ClassDef_L82_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L171_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L171_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:If_L172_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:If_L172_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:Assign_L173_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L171_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:Return_L174_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:ClassDef_L82_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L176_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L176_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:Try_L177_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:Try_L177_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:Return_L178_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:Try_L177_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:Expr_L180_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:ClassDef_L82_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L182_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L182_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:Assign_L183_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L182_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:For_L184_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:For_L184_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:Assign_L185_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:For_L184_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:If_L186_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:If_L186_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:Assign_L187_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:If_L186_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:If_L188_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:If_L188_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:Assign_L189_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:If_L188_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:Expr_L190_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L182_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:Return_L191_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:ClassDef_L82_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L193_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L193_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:Return_L194_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:ClassDef_L82_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L197_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L197_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:Try_L198_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:Try_L198_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:Return_L199_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:Try_L198_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:Expr_L201_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:ClassDef_L82_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L203_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L203_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:Assign_L204_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L203_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:Expr_L205_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L203_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:If_L207_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:If_L207_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:Expr_L208_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:ClassDef_L82_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L210_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L210_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:Assign_L211_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L210_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:If_L212_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L210_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:Return_L214_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:ClassDef_L82_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L216_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L216_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:Try_L217_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:Try_L217_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:Return_L218_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:Try_L217_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:Expr_L220_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:ClassDef_L82_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L222_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L222_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:Return_L223_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:ClassDef_L82_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L225_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L225_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:Assign_L226_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L225_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:If_L227_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:If_L227_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:Assign_L228_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:If_L227_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:Assign_L231_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:ClassDef_L236_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:Assign_L237_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:ClassDef_L236_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L239_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L239_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:For_L242_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:For_L242_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:If_L243_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:For_L242_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:If_L245_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:For_L242_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:Expr_L247_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:For_L242_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:Return_L248_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:ClassDef_L236_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L251_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L251_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:If_L252_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L251_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:If_L254_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:ClassDef_L236_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L257_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L257_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:Return_L260_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:ClassDef_L236_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L262_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L262_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:Return_L263_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:ClassDef_L236_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L265_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L265_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:If_L266_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:If_L266_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:Return_L267_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L265_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:For_L268_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:For_L268_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:Assign_L269_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:For_L268_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:If_L270_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:If_L270_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:Return_L271_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L265_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:Return_L272_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:ClassDef_L236_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L274_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L274_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:Assign_L275_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L274_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:Return_L276_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:ClassDef_L279_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:Assign_L280_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:ClassDef_L279_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L282_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L282_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:Return_L283_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:ClassDef_L279_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L285_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L285_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:Assign_L286_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L285_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:If_L287_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L285_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:Return_L289_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:ClassDef_L279_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L291_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L291_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:Expr_L292_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L291_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:Return_L293_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:ClassDef_L279_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L295_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L295_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:Return_L296_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:ClassDef_L299_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:Assign_L300_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:ClassDef_L299_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L302_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L302_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:Try_L303_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:Try_L303_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:Return_L304_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:Try_L303_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:Return_L306_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:ClassDef_L309_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:Assign_L310_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:ClassDef_L309_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L312_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L312_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:Expr_L313_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L312_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:Assign_L314_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L312_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:Assign_L316_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:ClassDef_L309_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L319_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L319_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:Try_L320_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:Try_L320_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:Return_L321_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:Try_L320_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:Return_L323_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:ClassDef_L309_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L325_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L325_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:Try_L326_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:Try_L326_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:Return_L327_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:Try_L326_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:Return_L329_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:ClassDef_L309_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L331_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L331_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:Assign_L332_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L331_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:Assign_L333_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99824:FunctionDef_L331_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99824:Return_L334_C8"}] |
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
class VariableSplitter:
def __init__(self, string, identifiers):
self.identifier = None
self.base = None
self.index = None
self.start = -1
self.end = -1
self._identifiers = identifiers
self._may_have_internal_variables = False
try:
self._split(string)
except ValueError:
pass
else:
self._finalize()
def get_replaced_base(self, variables):
if self._may_have_internal_variables:
return variables.replace_string(self.base)
return self.base
def _finalize(self):
self.identifier = self._variable_chars[0]
self.base = ''.join(self._variable_chars[2:-1])
self.end = self.start + len(self._variable_chars)
if self._has_list_variable_index():
self.index = ''.join(self._list_variable_index_chars[1:-1])
self.end += len(self._list_variable_index_chars)
def _has_list_variable_index(self):
return self._list_variable_index_chars \
and self._list_variable_index_chars[-1] == ']'
def _split(self, string):
start_index, max_index = self._find_variable(string)
self.start = start_index
self._open_curly = 1
self._state = self._variable_state
self._variable_chars = [string[start_index], '{']
self._list_variable_index_chars = []
self._string = string
start_index += 2
for index, char in enumerate(string[start_index:]):
index += start_index # Giving start to enumerate only in Py 2.6+
try:
self._state(char, index)
except StopIteration:
return
if index == max_index and not self._scanning_list_variable_index():
return
def _scanning_list_variable_index(self):
return self._state in [self._waiting_list_variable_index_state,
self._list_variable_index_state]
def _find_variable(self, string):
max_end_index = string.rfind('}')
if max_end_index == -1:
return ValueError('No variable end found')
if self._is_escaped(string, max_end_index):
return self._find_variable(string[:max_end_index])
start_index = self._find_start_index(string, 1, max_end_index)
if start_index == -1:
return ValueError('No variable start found')
return start_index, max_end_index
def _find_start_index(self, string, start, end):
index = string.find('{', start, end) - 1
if index < 0:
return -1
if self._start_index_is_ok(string, index):
return index
return self._find_start_index(string, index+2, end)
def _start_index_is_ok(self, string, index):
return string[index] in self._identifiers \
and not self._is_escaped(string, index)
def _is_escaped(self, string, index):
escaped = False
while index > 0 and string[index-1] == '\\':
index -= 1
escaped = not escaped
return escaped
def _variable_state(self, char, index):
self._variable_chars.append(char)
if char == '}' and not self._is_escaped(self._string, index):
self._open_curly -= 1
if self._open_curly == 0:
if not self._is_list_variable():
raise StopIteration
self._state = self._waiting_list_variable_index_state
elif char in self._identifiers:
self._state = self._internal_variable_start_state
def _is_list_variable(self):
return self._variable_chars[0] == '@'
def _internal_variable_start_state(self, char, index):
self._state = self._variable_state
if char == '{':
self._variable_chars.append(char)
self._open_curly += 1
self._may_have_internal_variables = True
else:
self._variable_state(char, index)
def _waiting_list_variable_index_state(self, char, index):
if char != '[':
raise StopIteration
self._list_variable_index_chars.append(char)
self._state = self._list_variable_index_state
def _list_variable_index_state(self, char, index):
self._list_variable_index_chars.append(char)
if char == ']':
raise StopIteration
| ajibawa-2023/Python-Code-Large/train/row_99827 | 87 | 134 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99827:ClassDef_L16_C0", "label": "VariableSplitter", "type": "class", "loc": [16, 134], "level": 0, "parent": null, "vector": [3, 0, 0.5597, 0.8881, 0, 0.66, 0.0, 73, 0, 15, 0, 0, 0, 0, 29], "semantic": {"name": "VariableSplitter", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class VariableSplitter:\n\n def __init__(self, string, identifiers):\n self.identifier = None\n self.base = None\n self.index = None\n self.start = -1\n self.end = -1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99827:FunctionDef_L18_C4", "label": "__init__", "type": "function", "loc": [18, 31], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99827:ClassDef_L16_C0", "vector": [2, 1, 0.1828, 0.1045, 1, 0.37, 0.0, 555, 0, 3, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": ["self", "string", "identifiers"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, string, identifiers):\n self.identifier = None\n self.base = None\n self.index = None\n self.start = -1\n self.end = -1\n self._identifiers = identifiers\n self._may_have_internal_variables = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99827:Assign_L19_C8", "label": "self.identifier =", "type": "assigned_variable", "loc": [19, 19], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99827:FunctionDef_L18_C4", "vector": [14, 2, 0.1418, 0.0075, 2, 0.47, 0.0, 826, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.identifier", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.identifier = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99827:Assign_L20_C8", "label": "self.base =", "type": "assigned_variable", "loc": [20, 20], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99827:FunctionDef_L18_C4", "vector": [14, 2, 0.1493, 0.0075, 2, 0.47, 0.1429, 196, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.base", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.base = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99827:Assign_L21_C8", "label": "self.index =", "type": "assigned_variable", "loc": [21, 21], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99827:FunctionDef_L18_C4", "vector": [14, 2, 0.1567, 0.0075, 2, 0.47, 0.2857, 777, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.index", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.index = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99827:Assign_L22_C8", "label": "self.start =", "type": "assigned_variable", "loc": [22, 22], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99827:FunctionDef_L18_C4", "vector": [14, 2, 0.1642, 0.0075, 2, 0.47, 0.4286, 45, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.start", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.start = -1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99827:Assign_L23_C8", "label": "self.end =", "type": "assigned_variable", "loc": [23, 23], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99827:FunctionDef_L18_C4", "vector": [14, 2, 0.1716, 0.0075, 2, 0.47, 0.5714, 266, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.end", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.end = -1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99827:Assign_L24_C8", "label": "self._identifiers =", "type": "assigned_variable", "loc": [24, 24], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99827:FunctionDef_L18_C4", "vector": [14, 2, 0.1791, 0.0075, 2, 0.47, 0.7143, 28, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._identifiers", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._identifiers = identifiers"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99827:Assign_L25_C8", "label": "self._may_have_internal_variables =", "type": "assigned_variable", "loc": [25, 25], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99827:FunctionDef_L18_C4", "vector": [14, 2, 0.1866, 0.0075, 2, 0.47, 0.8571, 854, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self._may_have_internal_variables", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._may_have_internal_variables = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99827:Try_L26_C8", "label": "try", "type": "try", "loc": [26, 31], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99827:FunctionDef_L18_C4", "vector": [7, 2, 0.2127, 0.0448, 2, 0.47, 1.0, 0, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n self._split(string)\n except ValueError:\n pass\n else:\n self._finalize()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99827:Expr_L27_C12", "label": "_split()", "type": "expression", "loc": [27, 27], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99827:Try_L26_C8", "vector": [8, 3, 0.2015, 0.0075, 3, 0.8, 0.0, 717, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_split", "arg_names": [], "import_names": [], "rhs_call_name": "_split", "annotation": ""}, "snippet": " self._split(string)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99827:Expr_L31_C12", "label": "_finalize()", "type": "expression", "loc": [31, 31], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99827:Try_L26_C8", "vector": [8, 3, 0.2313, 0.0075, 3, 0.8, 1.0, 225, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_finalize", "arg_names": [], "import_names": [], "rhs_call_name": "_finalize", "annotation": ""}, "snippet": " self._finalize()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99827:FunctionDef_L33_C4", "label": "get_replaced_base", "type": "function", "loc": [33, 36], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99827:ClassDef_L16_C0", "vector": [2, 1, 0.2575, 0.0299, 1, 0.37, 0.0714, 7, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "get_replaced_base", "arg_names": ["self", "variables"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_replaced_base(self, variables):\n if self._may_have_internal_variables:\n return variables.replace_string(self.base)\n return self.base"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99827:If_L34_C8", "label": "if", "type": "if", "loc": [34, 35], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99827:FunctionDef_L33_C4", "vector": [4, 2, 0.2575, 0.0149, 2, 0.71, 0.0, 0, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self._may_have_internal_variables:\n return variables.replace_string(self.base)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99827:Return_L35_C12", "label": "return", "type": "return", "loc": [35, 35], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99827:If_L34_C8", "vector": [13, 3, 0.2612, 0.0075, 3, 0.83, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return variables.replace_string(self.base)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99827:Return_L36_C8", "label": "return", "type": "return", "loc": [36, 36], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99827:FunctionDef_L33_C4", "vector": [13, 2, 0.2687, 0.0075, 2, 0.71, 1.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.base"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99827:FunctionDef_L38_C4", "label": "_finalize", "type": "function", "loc": [38, 44], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99827:ClassDef_L16_C0", "vector": [2, 1, 0.306, 0.0522, 1, 0.37, 0.1429, 225, 0, 1, 0, 0, 0, 0, 5], "semantic": {"name": "_finalize", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _finalize(self):\n self.identifier = self._variable_chars[0]\n self.base = ''.join(self._variable_chars[2:-1])\n self.end = self.start + len(self._variable_chars)\n if self._has_list_variable_index():\n self.index = ''.join(self._list_variable_index_chars[1:-1])\n self.end += len(self._list_variable_index_chars)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99827:Assign_L39_C8", "label": "self.identifier =", "type": "assigned_variable", "loc": [39, 39], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99827:FunctionDef_L38_C4", "vector": [14, 2, 0.291, 0.0075, 2, 0.75, 0.0, 826, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.identifier", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.identifier = self._variable_chars[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99827:Assign_L40_C8", "label": "self.base = join()", "type": "assigned_variable", "loc": [40, 40], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99827:FunctionDef_L38_C4", "vector": [14, 2, 0.2985, 0.0075, 2, 0.75, 0.3333, 196, 3, 1, 0, 0, 933, 10, 1], "semantic": {"name": "self.base", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": " self.base = ''.join(self._variable_chars[2:-1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99827:Assign_L41_C8", "label": "self.end =", "type": "assigned_variable", "loc": [41, 41], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99827:FunctionDef_L38_C4", "vector": [14, 2, 0.306, 0.0075, 2, 0.75, 0.6667, 266, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self.end", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.end = self.start + len(self._variable_chars)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99827:If_L42_C8", "label": "if", "type": "if", "loc": [42, 44], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99827:FunctionDef_L38_C4", "vector": [4, 2, 0.3209, 0.0224, 2, 0.75, 1.0, 0, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self._has_list_variable_index():\n self.index = ''.join(self._list_variable_index_chars[1:-1])\n self.end += len(self._list_variable_index_chars)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99827:Assign_L43_C12", "label": "self.index = join()", "type": "assigned_variable", "loc": [43, 43], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99827:If_L42_C8", "vector": [14, 3, 0.3209, 0.0075, 3, 0.27, 0.0, 777, 3, 1, 0, 0, 933, 10, 1], "semantic": {"name": "self.index", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": " self.index = ''.join(self._list_variable_index_chars[1:-1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99827:FunctionDef_L46_C4", "label": "_has_list_variable_index", "type": "function", "loc": [46, 48], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99827:ClassDef_L16_C0", "vector": [2, 1, 0.3507, 0.0224, 1, 0.37, 0.2143, 759, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "_has_list_variable_index", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _has_list_variable_index(self):\n return self._list_variable_index_chars \\\n and self._list_variable_index_chars[-1] == ']'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99827:Return_L47_C8", "label": "return", "type": "return", "loc": [47, 48], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99827:FunctionDef_L46_C4", "vector": [13, 2, 0.3545, 0.0149, 2, 0.81, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._list_variable_index_chars \\\n and self._list_variable_index_chars[-1] == ']'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99827:FunctionDef_L50_C4", "label": "_split", "type": "function", "loc": [50, 66], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99827:ClassDef_L16_C0", "vector": [2, 1, 0.4328, 0.1269, 1, 0.37, 0.2857, 717, 0, 2, 0, 0, 0, 0, 4], "semantic": {"name": "_split", "arg_names": ["self", "string"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _split(self, string):\n start_index, max_index = self._find_variable(string)\n self.start = start_index\n self._open_curly = 1\n self._state = self._variable_state\n self._variable_chars = [string[start_index], '{']\n self._list_variable_index_chars = []\n self._string = string"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99827:Assign_L51_C8", "label": "start_index, max_index = _find_variable()", "type": "assigned_variable", "loc": [51, 51], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99827:FunctionDef_L50_C4", "vector": [14, 2, 0.3806, 0.0075, 2, 0.33, 0.0, 164, 3, 1, 0, 0, 72, 10, 1], "semantic": {"name": "start_index, max_index", "arg_names": [], "import_names": [], "rhs_call_name": "_find_variable", "annotation": ""}, "snippet": " start_index, max_index = self._find_variable(string)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99827:Assign_L52_C8", "label": "self.start =", "type": "assigned_variable", "loc": [52, 52], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99827:FunctionDef_L50_C4", "vector": [14, 2, 0.3881, 0.0075, 2, 0.33, 0.1429, 45, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.start", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.start = start_index"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99827:Assign_L53_C8", "label": "self._open_curly =", "type": "assigned_variable", "loc": [53, 53], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99827:FunctionDef_L50_C4", "vector": [14, 2, 0.3955, 0.0075, 2, 0.33, 0.2857, 179, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self._open_curly", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._open_curly = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99827:Assign_L54_C8", "label": "self._state =", "type": "assigned_variable", "loc": [54, 54], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99827:FunctionDef_L50_C4", "vector": [14, 2, 0.403, 0.0075, 2, 0.33, 0.4286, 243, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._state", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._state = self._variable_state"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99827:Assign_L55_C8", "label": "self._variable_chars =", "type": "assigned_variable", "loc": [55, 55], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99827:FunctionDef_L50_C4", "vector": [14, 2, 0.4104, 0.0075, 2, 0.33, 0.5714, 895, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self._variable_chars", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._variable_chars = [string[start_index], '{']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99827:Assign_L56_C8", "label": "self._list_variable_index_chars =", "type": "assigned_variable", "loc": [56, 56], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99827:FunctionDef_L50_C4", "vector": [14, 2, 0.4179, 0.0075, 2, 0.33, 0.7143, 275, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self._list_variable_index_chars", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._list_variable_index_chars = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99827:Assign_L57_C8", "label": "self._string =", "type": "assigned_variable", "loc": [57, 57], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99827:FunctionDef_L50_C4", "vector": [14, 2, 0.4254, 0.0075, 2, 0.33, 0.8571, 541, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._string", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._string = string"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99827:For_L59_C8", "label": "for index, char", "type": "for", "loc": [59, 66], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99827:FunctionDef_L50_C4", "vector": [6, 2, 0.4664, 0.0597, 2, 0.33, 1.0, 315, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "index, char", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for index, char in enumerate(string[start_index:]):\n index += start_index # Giving start to enumerate only in Py 2.6+\n try:\n self._state(char, index)\n except StopIteration:\n return\n if index == max_index and not self._scanning_list_variable_index():\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99827:Try_L61_C12", "label": "try", "type": "try", "loc": [61, 64], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99827:For_L59_C8", "vector": [7, 3, 0.4664, 0.0299, 3, 0.68, 0.0, 0, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n self._state(char, index)\n except StopIteration:\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99827:Expr_L62_C16", "label": "_state()", "type": "expression", "loc": [62, 62], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99827:Try_L61_C12", "vector": [8, 4, 0.4627, 0.0075, 4, 0.79, 0.0, 214, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "_state", "arg_names": [], "import_names": [], "rhs_call_name": "_state", "annotation": ""}, "snippet": " self._state(char, index)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99827:Return_L64_C16", "label": "return", "type": "return", "loc": [64, 64], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99827:Try_L61_C12", "vector": [13, 4, 0.4776, 0.0075, 4, 0.79, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99827:If_L65_C12", "label": "if", "type": "if", "loc": [65, 66], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99827:For_L59_C8", "vector": [4, 3, 0.4888, 0.0149, 3, 0.68, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if index == max_index and not self._scanning_list_variable_index():\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99827:Return_L66_C16", "label": "return", "type": "return", "loc": [66, 66], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99827:If_L65_C12", "vector": [13, 4, 0.4925, 0.0075, 4, 0.3, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99827:FunctionDef_L68_C4", "label": "_scanning_list_variable_index", "type": "function", "loc": [68, 70], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99827:ClassDef_L16_C0", "vector": [2, 1, 0.5149, 0.0224, 1, 0.37, 0.3571, 749, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "_scanning_list_variable_index", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _scanning_list_variable_index(self):\n return self._state in [self._waiting_list_variable_index_state,\n self._list_variable_index_state]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99827:Return_L69_C8", "label": "return", "type": "return", "loc": [69, 70], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99827:FunctionDef_L68_C4", "vector": [13, 2, 0.5187, 0.0149, 2, 0.58, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._state in [self._waiting_list_variable_index_state,\n self._list_variable_index_state]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99827:FunctionDef_L72_C4", "label": "_find_variable", "type": "function", "loc": [72, 81], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99827:ClassDef_L16_C0", "vector": [2, 1, 0.5709, 0.0746, 1, 0.37, 0.4286, 72, 0, 2, 1, 0, 0, 0, 6], "semantic": {"name": "_find_variable", "arg_names": ["self", "string"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _find_variable(self, string):\n max_end_index = string.rfind('}')\n if max_end_index == -1:\n return ValueError('No variable end found')\n if self._is_escaped(string, max_end_index):\n return self._find_variable(string[:max_end_index])\n start_index = self._find_start_index(string, 1, max_end_index)\n if start_index == -1:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99827:Assign_L73_C8", "label": "max_end_index = rfind()", "type": "assigned_variable", "loc": [73, 73], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99827:FunctionDef_L72_C4", "vector": [14, 2, 0.5448, 0.0075, 2, 0.67, 0.0, 818, 3, 1, 0, 0, 634, 10, 1], "semantic": {"name": "max_end_index", "arg_names": [], "import_names": [], "rhs_call_name": "rfind", "annotation": ""}, "snippet": " max_end_index = string.rfind('}')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99827:If_L74_C8", "label": "if", "type": "if", "loc": [74, 75], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99827:FunctionDef_L72_C4", "vector": [4, 2, 0.556, 0.0149, 2, 0.67, 0.2, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if max_end_index == -1:\n return ValueError('No variable end found')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99827:Return_L75_C12", "label": "return", "type": "return", "loc": [75, 75], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99827:If_L74_C8", "vector": [13, 3, 0.5597, 0.0075, 3, 0.89, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ValueError('No variable end found')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99827:If_L76_C8", "label": "if", "type": "if", "loc": [76, 77], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99827:FunctionDef_L72_C4", "vector": [4, 2, 0.5709, 0.0149, 2, 0.67, 0.4, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self._is_escaped(string, max_end_index):\n return self._find_variable(string[:max_end_index])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99827:Return_L77_C12", "label": "return", "type": "return", "loc": [77, 77], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99827:If_L76_C8", "vector": [13, 3, 0.5746, 0.0075, 3, 0.06, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._find_variable(string[:max_end_index])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99827:Assign_L78_C8", "label": "start_index = _find_start_index()", "type": "assigned_variable", "loc": [78, 78], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99827:FunctionDef_L72_C4", "vector": [14, 2, 0.5821, 0.0075, 2, 0.67, 0.6, 553, 3, 3, 0, 0, 362, 10, 1], "semantic": {"name": "start_index", "arg_names": [], "import_names": [], "rhs_call_name": "_find_start_index", "annotation": ""}, "snippet": " start_index = self._find_start_index(string, 1, max_end_index)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99827:If_L79_C8", "label": "if", "type": "if", "loc": [79, 80], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99827:FunctionDef_L72_C4", "vector": [4, 2, 0.5933, 0.0149, 2, 0.67, 0.8, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if start_index == -1:\n return ValueError('No variable start found')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99827:Return_L80_C12", "label": "return", "type": "return", "loc": [80, 80], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99827:If_L79_C8", "vector": [13, 3, 0.597, 0.0075, 3, 0.59, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ValueError('No variable start found')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99827:Return_L81_C8", "label": "return", "type": "return", "loc": [81, 81], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99827:FunctionDef_L72_C4", "vector": [13, 2, 0.6045, 0.0075, 2, 0.67, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return start_index, max_end_index"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99827:FunctionDef_L83_C4", "label": "_find_start_index", "type": "function", "loc": [83, 89], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99827:ClassDef_L16_C0", "vector": [2, 1, 0.6418, 0.0522, 1, 0.37, 0.5, 362, 0, 4, 1, 0, 0, 0, 3], "semantic": {"name": "_find_start_index", "arg_names": ["self", "string", "start", "end"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _find_start_index(self, string, start, end):\n index = string.find('{', start, end) - 1\n if index < 0:\n return -1\n if self._start_index_is_ok(string, index):\n return index\n return self._find_start_index(string, index+2, end)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99827:Assign_L84_C8", "label": "index =", "type": "assigned_variable", "loc": [84, 84], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99827:FunctionDef_L83_C4", "vector": [14, 2, 0.6269, 0.0075, 2, 0.11, 0.0, 780, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "index", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " index = string.find('{', start, end) - 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99827:If_L85_C8", "label": "if", "type": "if", "loc": [85, 86], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99827:FunctionDef_L83_C4", "vector": [4, 2, 0.6381, 0.0149, 2, 0.11, 0.3333, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if index < 0:\n return -1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99827:Return_L86_C12", "label": "return", "type": "return", "loc": [86, 86], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99827:If_L85_C8", "vector": [13, 3, 0.6418, 0.0075, 3, 0.56, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return -1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99827:If_L87_C8", "label": "if", "type": "if", "loc": [87, 88], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99827:FunctionDef_L83_C4", "vector": [4, 2, 0.653, 0.0149, 2, 0.11, 0.6667, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self._start_index_is_ok(string, index):\n return index"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99827:Return_L88_C12", "label": "return", "type": "return", "loc": [88, 88], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99827:If_L87_C8", "vector": [13, 3, 0.6567, 0.0075, 3, 0.75, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return index"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99827:Return_L89_C8", "label": "return", "type": "return", "loc": [89, 89], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99827:FunctionDef_L83_C4", "vector": [13, 2, 0.6642, 0.0075, 2, 0.11, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._find_start_index(string, index+2, end)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99827:FunctionDef_L91_C4", "label": "_start_index_is_ok", "type": "function", "loc": [91, 93], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99827:ClassDef_L16_C0", "vector": [2, 1, 0.6866, 0.0224, 1, 0.37, 0.5714, 527, 0, 3, 1, 0, 0, 0, 1], "semantic": {"name": "_start_index_is_ok", "arg_names": ["self", "string", "index"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _start_index_is_ok(self, string, index):\n return string[index] in self._identifiers \\\n and not self._is_escaped(string, index)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99827:Return_L92_C8", "label": "return", "type": "return", "loc": [92, 93], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99827:FunctionDef_L91_C4", "vector": [13, 2, 0.6903, 0.0149, 2, 0.99, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return string[index] in self._identifiers \\\n and not self._is_escaped(string, index)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99827:FunctionDef_L95_C4", "label": "_is_escaped", "type": "function", "loc": [95, 100], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99827:ClassDef_L16_C0", "vector": [2, 1, 0.7276, 0.0448, 1, 0.37, 0.6429, 296, 0, 3, 1, 0, 0, 0, 0], "semantic": {"name": "_is_escaped", "arg_names": ["self", "string", "index"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _is_escaped(self, string, index):\n escaped = False\n while index > 0 and string[index-1] == '\\\\':\n index -= 1\n escaped = not escaped\n return escaped"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99827:Assign_L96_C8", "label": "escaped =", "type": "assigned_variable", "loc": [96, 96], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99827:FunctionDef_L95_C4", "vector": [14, 2, 0.7164, 0.0075, 2, 0.23, 0.0, 658, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "escaped", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " escaped = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99827:While_L97_C8", "label": "while", "type": "while", "loc": [97, 99], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99827:FunctionDef_L95_C4", "vector": [5, 2, 0.7313, 0.0224, 2, 0.23, 0.5, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while index > 0 and string[index-1] == '\\\\':\n index -= 1\n escaped = not escaped"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99827:Assign_L99_C12", "label": "escaped =", "type": "assigned_variable", "loc": [99, 99], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99827:While_L97_C8", "vector": [14, 3, 0.7388, 0.0075, 3, 0.5, 0.0, 658, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "escaped", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " escaped = not escaped"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99827:Return_L100_C8", "label": "return", "type": "return", "loc": [100, 100], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99827:FunctionDef_L95_C4", "vector": [13, 2, 0.7463, 0.0075, 2, 0.23, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return escaped"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99827:FunctionDef_L102_C4", "label": "_variable_state", "type": "function", "loc": [102, 111], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99827:ClassDef_L16_C0", "vector": [2, 1, 0.7948, 0.0746, 1, 0.37, 0.7143, 266, 0, 3, 0, 0, 0, 0, 3], "semantic": {"name": "_variable_state", "arg_names": ["self", "char", "index"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _variable_state(self, char, index):\n self._variable_chars.append(char)\n if char == '}' and not self._is_escaped(self._string, index):\n self._open_curly -= 1\n if self._open_curly == 0:\n if not self._is_list_variable():\n raise StopIteration\n self._state = self._waiting_list_variable_index_state"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99827:Expr_L103_C8", "label": "append()", "type": "expression", "loc": [103, 103], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99827:FunctionDef_L102_C4", "vector": [8, 2, 0.7687, 0.0075, 2, 0.75, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self._variable_chars.append(char)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99827:If_L104_C8", "label": "if", "type": "if", "loc": [104, 111], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99827:FunctionDef_L102_C4", "vector": [4, 2, 0.8022, 0.0597, 2, 0.75, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if char == '}' and not self._is_escaped(self._string, index):\n self._open_curly -= 1\n if self._open_curly == 0:\n if not self._is_list_variable():\n raise StopIteration\n self._state = self._waiting_list_variable_index_state\n elif char in self._identifiers:\n self._state = self._internal_variable_start_state"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99827:If_L106_C12", "label": "if", "type": "if", "loc": [106, 109], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99827:If_L104_C8", "vector": [4, 3, 0.8022, 0.0299, 3, 0.37, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self._open_curly == 0:\n if not self._is_list_variable():\n raise StopIteration\n self._state = self._waiting_list_variable_index_state"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99827:If_L107_C16", "label": "if", "type": "if", "loc": [107, 108], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99827:If_L106_C12", "vector": [4, 4, 0.8022, 0.0149, 4, 0.92, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not self._is_list_variable():\n raise StopIteration"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99827:Assign_L109_C16", "label": "self._state =", "type": "assigned_variable", "loc": [109, 109], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99827:If_L106_C12", "vector": [14, 4, 0.8134, 0.0075, 4, 0.92, 1.0, 243, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._state", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._state = self._waiting_list_variable_index_state"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99827:If_L110_C8", "label": "if", "type": "if", "loc": [110, 111], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99827:If_L104_C8", "vector": [4, 3, 0.8246, 0.0149, 3, 0.37, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif char in self._identifiers:\n self._state = self._internal_variable_start_state"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99827:Assign_L111_C12", "label": "self._state =", "type": "assigned_variable", "loc": [111, 111], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99827:If_L110_C8", "vector": [14, 4, 0.8284, 0.0075, 4, 0.45, 0.0, 243, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._state", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._state = self._internal_variable_start_state"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99827:FunctionDef_L113_C4", "label": "_is_list_variable", "type": "function", "loc": [113, 114], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99827:ClassDef_L16_C0", "vector": [2, 1, 0.847, 0.0149, 1, 0.37, 0.7857, 288, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "_is_list_variable", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _is_list_variable(self):\n return self._variable_chars[0] == '@'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99827:Return_L114_C8", "label": "return", "type": "return", "loc": [114, 114], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99827:FunctionDef_L113_C4", "vector": [13, 2, 0.8507, 0.0075, 2, 0.08, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._variable_chars[0] == '@'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99827:FunctionDef_L116_C4", "label": "_internal_variable_start_state", "type": "function", "loc": [116, 123], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99827:ClassDef_L16_C0", "vector": [2, 1, 0.8918, 0.0597, 1, 0.37, 0.8571, 45, 0, 3, 0, 0, 0, 0, 2], "semantic": {"name": "_internal_variable_start_state", "arg_names": ["self", "char", "index"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _internal_variable_start_state(self, char, index):\n self._state = self._variable_state\n if char == '{':\n self._variable_chars.append(char)\n self._open_curly += 1\n self._may_have_internal_variables = True\n else:\n self._variable_state(char, index)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99827:Assign_L117_C8", "label": "self._state =", "type": "assigned_variable", "loc": [117, 117], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99827:FunctionDef_L116_C4", "vector": [14, 2, 0.8731, 0.0075, 2, 0.8, 0.0, 243, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._state", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._state = self._variable_state"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99827:If_L118_C8", "label": "if", "type": "if", "loc": [118, 123], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99827:FunctionDef_L116_C4", "vector": [4, 2, 0.8993, 0.0448, 2, 0.8, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if char == '{':\n self._variable_chars.append(char)\n self._open_curly += 1\n self._may_have_internal_variables = True\n else:\n self._variable_state(char, index)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99827:Expr_L119_C12", "label": "append()", "type": "expression", "loc": [119, 119], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99827:If_L118_C8", "vector": [8, 3, 0.8881, 0.0075, 3, 0.77, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self._variable_chars.append(char)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99827:Assign_L121_C12", "label": "self._may_have_internal_variables =", "type": "assigned_variable", "loc": [121, 121], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99827:If_L118_C8", "vector": [14, 3, 0.903, 0.0075, 3, 0.77, 0.5, 854, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self._may_have_internal_variables", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._may_have_internal_variables = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99827:Expr_L123_C12", "label": "_variable_state()", "type": "expression", "loc": [123, 123], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99827:If_L118_C8", "vector": [8, 3, 0.9179, 0.0075, 3, 0.77, 1.0, 266, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "_variable_state", "arg_names": [], "import_names": [], "rhs_call_name": "_variable_state", "annotation": ""}, "snippet": " self._variable_state(char, index)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99827:FunctionDef_L125_C4", "label": "_waiting_list_variable_index_state", "type": "function", "loc": [125, 129], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99827:ClassDef_L16_C0", "vector": [2, 1, 0.9478, 0.0373, 1, 0.37, 0.9286, 611, 0, 3, 0, 0, 0, 0, 1], "semantic": {"name": "_waiting_list_variable_index_state", "arg_names": ["self", "char", "index"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _waiting_list_variable_index_state(self, char, index):\n if char != '[':\n raise StopIteration\n self._list_variable_index_chars.append(char)\n self._state = self._list_variable_index_state"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99827:If_L126_C8", "label": "if", "type": "if", "loc": [126, 127], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99827:FunctionDef_L125_C4", "vector": [4, 2, 0.944, 0.0149, 2, 0.59, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if char != '[':\n raise StopIteration"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99827:Expr_L128_C8", "label": "append()", "type": "expression", "loc": [128, 128], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99827:FunctionDef_L125_C4", "vector": [8, 2, 0.9552, 0.0075, 2, 0.59, 0.5, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self._list_variable_index_chars.append(char)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99827:Assign_L129_C8", "label": "self._state =", "type": "assigned_variable", "loc": [129, 129], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99827:FunctionDef_L125_C4", "vector": [14, 2, 0.9627, 0.0075, 2, 0.59, 1.0, 243, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._state", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._state = self._list_variable_index_state"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99827:FunctionDef_L131_C4", "label": "_list_variable_index_state", "type": "function", "loc": [131, 134], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99827:ClassDef_L16_C0", "vector": [2, 1, 0.9888, 0.0299, 1, 0.37, 1.0, 865, 0, 3, 0, 0, 0, 0, 1], "semantic": {"name": "_list_variable_index_state", "arg_names": ["self", "char", "index"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _list_variable_index_state(self, char, index):\n self._list_variable_index_chars.append(char)\n if char == ']':\n raise StopIteration"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99827:Expr_L132_C8", "label": "append()", "type": "expression", "loc": [132, 132], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99827:FunctionDef_L131_C4", "vector": [8, 2, 0.9851, 0.0075, 2, 0.6, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self._list_variable_index_chars.append(char)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99827:If_L133_C8", "label": "if", "type": "if", "loc": [133, 134], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99827:FunctionDef_L131_C4", "vector": [4, 2, 0.9963, 0.0149, 2, 0.6, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if char == ']':\n raise StopIteration"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99827:ClassDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99827:FunctionDef_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99827:FunctionDef_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99827:Assign_L19_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99827:FunctionDef_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99827:Assign_L20_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99827:FunctionDef_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99827:Assign_L21_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99827:FunctionDef_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99827:Assign_L22_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99827:FunctionDef_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99827:Assign_L23_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99827:FunctionDef_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99827:Assign_L24_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99827:FunctionDef_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99827:Assign_L25_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99827:FunctionDef_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99827:Try_L26_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99827:Try_L26_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99827:Expr_L27_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99827:Try_L26_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99827:Expr_L31_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99827:ClassDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99827:FunctionDef_L33_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99827:FunctionDef_L33_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99827:If_L34_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99827:If_L34_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99827:Return_L35_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99827:FunctionDef_L33_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99827:Return_L36_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99827:ClassDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99827:FunctionDef_L38_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99827:FunctionDef_L38_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99827:Assign_L39_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99827:FunctionDef_L38_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99827:Assign_L40_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99827:FunctionDef_L38_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99827:Assign_L41_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99827:FunctionDef_L38_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99827:If_L42_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99827:If_L42_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99827:Assign_L43_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99827:ClassDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99827:FunctionDef_L46_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99827:FunctionDef_L46_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99827:Return_L47_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99827:ClassDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99827:FunctionDef_L50_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99827:FunctionDef_L50_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99827:Assign_L51_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99827:FunctionDef_L50_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99827:Assign_L52_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99827:FunctionDef_L50_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99827:Assign_L53_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99827:FunctionDef_L50_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99827:Assign_L54_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99827:FunctionDef_L50_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99827:Assign_L55_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99827:FunctionDef_L50_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99827:Assign_L56_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99827:FunctionDef_L50_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99827:Assign_L57_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99827:FunctionDef_L50_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99827:For_L59_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99827:For_L59_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99827:Try_L61_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99827:Try_L61_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99827:Expr_L62_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99827:Try_L61_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99827:Return_L64_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99827:For_L59_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99827:If_L65_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99827:If_L65_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99827:Return_L66_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99827:ClassDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99827:FunctionDef_L68_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99827:FunctionDef_L68_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99827:Return_L69_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99827:ClassDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99827:FunctionDef_L72_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99827:FunctionDef_L72_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99827:Assign_L73_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99827:FunctionDef_L72_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99827:If_L74_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99827:If_L74_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99827:Return_L75_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99827:FunctionDef_L72_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99827:If_L76_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99827:If_L76_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99827:Return_L77_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99827:FunctionDef_L72_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99827:Assign_L78_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99827:FunctionDef_L72_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99827:If_L79_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99827:If_L79_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99827:Return_L80_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99827:FunctionDef_L72_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99827:Return_L81_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99827:ClassDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99827:FunctionDef_L83_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99827:FunctionDef_L83_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99827:Assign_L84_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99827:FunctionDef_L83_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99827:If_L85_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99827:If_L85_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99827:Return_L86_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99827:FunctionDef_L83_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99827:If_L87_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99827:If_L87_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99827:Return_L88_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99827:FunctionDef_L83_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99827:Return_L89_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99827:ClassDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99827:FunctionDef_L91_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99827:FunctionDef_L91_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99827:Return_L92_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99827:ClassDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99827:FunctionDef_L95_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99827:FunctionDef_L95_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99827:Assign_L96_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99827:FunctionDef_L95_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99827:While_L97_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99827:While_L97_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99827:Assign_L99_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99827:FunctionDef_L95_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99827:Return_L100_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99827:ClassDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99827:FunctionDef_L102_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99827:FunctionDef_L102_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99827:Expr_L103_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99827:FunctionDef_L102_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99827:If_L104_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99827:If_L104_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99827:If_L106_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99827:If_L106_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99827:If_L107_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99827:If_L106_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99827:Assign_L109_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99827:If_L104_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99827:If_L110_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99827:If_L110_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99827:Assign_L111_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99827:ClassDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99827:FunctionDef_L113_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99827:FunctionDef_L113_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99827:Return_L114_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99827:ClassDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99827:FunctionDef_L116_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99827:FunctionDef_L116_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99827:Assign_L117_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99827:FunctionDef_L116_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99827:If_L118_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99827:If_L118_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99827:Expr_L119_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99827:If_L118_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99827:Assign_L121_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99827:If_L118_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99827:Expr_L123_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99827:ClassDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99827:FunctionDef_L125_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99827:FunctionDef_L125_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99827:If_L126_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99827:FunctionDef_L125_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99827:Expr_L128_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99827:FunctionDef_L125_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99827:Assign_L129_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99827:ClassDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99827:FunctionDef_L131_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99827:FunctionDef_L131_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99827:Expr_L132_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99827:FunctionDef_L131_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99827:If_L133_C8"}] |
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
def is_var(string):
if not isinstance(string, basestring):
return False
length = len(string)
return length > 3 and string[0] in ['$','@'] and string.rfind('{') == 1 \
and string.find('}') == length - 1
def is_scalar_var(string):
return is_var(string) and string[0] == '$'
def is_list_var(string):
return is_var(string) and string[0] == '@'
| ajibawa-2023/Python-Code-Large/train/row_99829 | 9 | 29 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99829:FunctionDef_L16_C0", "label": "is_var", "type": "function", "loc": [16, 21], "level": 0, "parent": null, "vector": [2, 0, 0.6379, 0.2069, 0, 0.66, 0.0, 481, 0, 1, 1, 0, 0, 0, 4], "semantic": {"name": "is_var", "arg_names": ["string"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def is_var(string):\n if not isinstance(string, basestring):\n return False\n length = len(string)\n return length > 3 and string[0] in ['$','@'] and string.rfind('{') == 1 \\\n and string.find('}') == length - 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99829:If_L17_C4", "label": "if", "type": "if", "loc": [17, 18], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99829:FunctionDef_L16_C0", "vector": [4, 1, 0.6034, 0.069, 1, 0.84, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not isinstance(string, basestring):\n return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99829:Return_L18_C8", "label": "return", "type": "return", "loc": [18, 18], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99829:If_L17_C4", "vector": [13, 2, 0.6207, 0.0345, 2, 0.37, 0.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99829:Assign_L19_C4", "label": "length = len()", "type": "assigned_variable", "loc": [19, 19], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99829:FunctionDef_L16_C0", "vector": [14, 1, 0.6552, 0.0345, 1, 0.84, 0.5, 221, 3, 1, 0, 0, 890, 10, 1], "semantic": {"name": "length", "arg_names": [], "import_names": [], "rhs_call_name": "len", "annotation": ""}, "snippet": " length = len(string)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99829:Return_L20_C4", "label": "return", "type": "return", "loc": [20, 21], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99829:FunctionDef_L16_C0", "vector": [13, 1, 0.7069, 0.069, 1, 0.84, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return length > 3 and string[0] in ['$','@'] and string.rfind('{') == 1 \\\n and string.find('}') == length - 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99829:FunctionDef_L24_C0", "label": "is_scalar_var", "type": "function", "loc": [24, 25], "level": 0, "parent": null, "vector": [2, 0, 0.8448, 0.069, 0, 0.66, 0.5, 468, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "is_scalar_var", "arg_names": ["string"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def is_scalar_var(string):\n return is_var(string) and string[0] == '$'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99829:Return_L25_C4", "label": "return", "type": "return", "loc": [25, 25], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99829:FunctionDef_L24_C0", "vector": [13, 1, 0.8621, 0.0345, 1, 0.36, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return is_var(string) and string[0] == '$'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99829:FunctionDef_L28_C0", "label": "is_list_var", "type": "function", "loc": [28, 29], "level": 0, "parent": null, "vector": [2, 0, 0.9828, 0.069, 0, 0.66, 1.0, 387, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "is_list_var", "arg_names": ["string"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def is_list_var(string):\n return is_var(string) and string[0] == '@'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99829:Return_L29_C4", "label": "return", "type": "return", "loc": [29, 29], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99829:FunctionDef_L28_C0", "vector": [13, 1, 1.0, 0.0345, 1, 0.23, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return is_var(string) and string[0] == '@'"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99829:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99829:If_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99829:If_L17_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99829:Return_L18_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99829:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99829:Assign_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99829:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99829:Return_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99829:FunctionDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99829:Return_L25_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99829:FunctionDef_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99829:Return_L29_C4"}] |
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import os
import tempfile
from robot import utils
from robot.output import LOGGER
from variables import Variables
from variablesplitter import VariableSplitter
from isvar import is_var, is_scalar_var, is_list_var
GLOBAL_VARIABLES = Variables()
def init_global_variables(settings):
_set_cli_vars(settings)
for name, value in [ ('${TEMPDIR}', utils.abspath(tempfile.gettempdir())),
('${EXECDIR}', utils.abspath('.')),
('${/}', os.sep),
('${:}', os.pathsep),
('${SPACE}', ' '),
('${EMPTY}', ''),
('${True}', True),
('${False}', False),
('${None}', None),
('${null}', None),
('${OUTPUT_DIR}', settings['OutputDir']),
('${OUTPUT_FILE}', settings['Output']),
('${SUMMARY_FILE}', settings['Summary']),
('${REPORT_FILE}', settings['Report']),
('${LOG_FILE}', settings['Log']),
('${DEBUG_FILE}', settings['DebugFile']),
('${PREV_TEST_NAME}', ''),
('${PREV_TEST_STATUS}', ''),
('${PREV_TEST_MESSAGE}', '') ]:
GLOBAL_VARIABLES[name] = value
def _set_cli_vars(settings):
for path, args in settings['VariableFiles']:
try:
GLOBAL_VARIABLES.set_from_file(path, args)
except:
msg, details = utils.get_error_details()
LOGGER.error(msg)
LOGGER.info(details)
for varstr in settings['Variables']:
try:
name, value = varstr.split(':', 1)
except ValueError:
name, value = varstr, ''
GLOBAL_VARIABLES['${%s}' % name] = value
| ajibawa-2023/Python-Code-Large/train/row_99830 | 24 | 66 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99830:Import_L15_C0", "label": "os import os", "type": "import", "loc": [15, 15], "level": 0, "parent": null, "vector": [1, 0, 0.2273, 0.0152, 0, 0.66, 0.0, 688, 0, 1, 0, 0, 688, 0, 0], "semantic": {"name": "os", "arg_names": [], "import_names": ["os"], "rhs_call_name": "", "annotation": ""}, "snippet": "import os"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99830:Import_L16_C0", "label": "tempfile import tempfile", "type": "import", "loc": [16, 16], "level": 0, "parent": null, "vector": [1, 0, 0.2424, 0.0152, 0, 0.66, 0.1111, 516, 0, 1, 0, 0, 516, 0, 0], "semantic": {"name": "tempfile", "arg_names": [], "import_names": ["tempfile"], "rhs_call_name": "", "annotation": ""}, "snippet": "import tempfile"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99830:ImportFrom_L18_C0", "label": "from robot import utils", "type": "import", "loc": [18, 18], "level": 0, "parent": null, "vector": [1, 0, 0.2727, 0.0152, 0, 0.66, 0.2222, 735, 0, 1, 0, 0, 735, 0, 0], "semantic": {"name": "robot", "arg_names": [], "import_names": ["utils"], "rhs_call_name": "", "annotation": ""}, "snippet": "from robot import utils"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99830:ImportFrom_L19_C0", "label": "from robot.output import LOGGER", "type": "import", "loc": [19, 19], "level": 0, "parent": null, "vector": [1, 0, 0.2879, 0.0152, 0, 0.66, 0.3333, 596, 0, 1, 0, 0, 596, 0, 0], "semantic": {"name": "robot.output", "arg_names": [], "import_names": ["LOGGER"], "rhs_call_name": "", "annotation": ""}, "snippet": "from robot.output import LOGGER"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99830:ImportFrom_L21_C0", "label": "from variables import Variables", "type": "import", "loc": [21, 21], "level": 0, "parent": null, "vector": [1, 0, 0.3182, 0.0152, 0, 0.66, 0.4444, 530, 0, 1, 0, 0, 530, 0, 0], "semantic": {"name": "variables", "arg_names": [], "import_names": ["Variables"], "rhs_call_name": "", "annotation": ""}, "snippet": "from variables import Variables"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99830:ImportFrom_L22_C0", "label": "from variablesplitter import VariableSplitter", "type": "import", "loc": [22, 22], "level": 0, "parent": null, "vector": [1, 0, 0.3333, 0.0152, 0, 0.66, 0.5556, 763, 0, 1, 0, 0, 763, 0, 0], "semantic": {"name": "variablesplitter", "arg_names": [], "import_names": ["VariableSplitter"], "rhs_call_name": "", "annotation": ""}, "snippet": "from variablesplitter import VariableSplitter"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99830:ImportFrom_L23_C0", "label": "from isvar import is_var, is_scalar_var, is_list_var", "type": "import", "loc": [23, 23], "level": 0, "parent": null, "vector": [1, 0, 0.3485, 0.0152, 0, 0.66, 0.6667, 873, 0, 3, 0, 0, 873, 0, 0], "semantic": {"name": "isvar", "arg_names": [], "import_names": ["is_var", "is_scalar_var", "is_list_var"], "rhs_call_name": "", "annotation": ""}, "snippet": "from isvar import is_var, is_scalar_var, is_list_var"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99830:Assign_L26_C0", "label": "GLOBAL_VARIABLES = Variables()", "type": "assigned_variable", "loc": [26, 26], "level": 0, "parent": null, "vector": [14, 0, 0.3939, 0.0152, 0, 0.66, 0.7778, 470, 3, 0, 0, 0, 821, 10, 1], "semantic": {"name": "GLOBAL_VARIABLES", "arg_names": [], "import_names": [], "rhs_call_name": "Variables", "annotation": ""}, "snippet": "GLOBAL_VARIABLES = Variables()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99830:FunctionDef_L29_C0", "label": "init_global_variables", "type": "function", "loc": [29, 50], "level": 0, "parent": null, "vector": [2, 0, 0.5985, 0.3333, 0, 0.66, 0.8889, 91, 0, 1, 0, 0, 0, 0, 4], "semantic": {"name": "init_global_variables", "arg_names": ["settings"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def init_global_variables(settings):\n _set_cli_vars(settings)\n for name, value in [ ('${TEMPDIR}', utils.abspath(tempfile.gettempdir())),\n ('${EXECDIR}', utils.abspath('.')),\n ('${/}', os.sep),\n ('${:}', os.pathsep),\n ('${SPACE}', ' '),\n ('${EMPTY}', ''),"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99830:Expr_L30_C4", "label": "_set_cli_vars()", "type": "expression", "loc": [30, 30], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99830:FunctionDef_L29_C0", "vector": [8, 1, 0.4545, 0.0152, 1, 0.42, 0.0, 954, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_set_cli_vars", "arg_names": [], "import_names": [], "rhs_call_name": "_set_cli_vars", "annotation": ""}, "snippet": " _set_cli_vars(settings)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99830:For_L31_C4", "label": "for name, value", "type": "for", "loc": [31, 50], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99830:FunctionDef_L29_C0", "vector": [6, 1, 0.6136, 0.303, 1, 0.42, 1.0, 509, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "name, value", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for name, value in [ ('${TEMPDIR}', utils.abspath(tempfile.gettempdir())),\n ('${EXECDIR}', utils.abspath('.')),\n ('${/}', os.sep),\n ('${:}', os.pathsep),\n ('${SPACE}', ' '),\n ('${EMPTY}', ''),\n ('${True}', True),\n ('${False}', False),"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99830:Assign_L50_C8", "label": "assign", "type": "assigned_variable", "loc": [50, 50], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99830:For_L31_C4", "vector": [14, 2, 0.7576, 0.0152, 2, 0.95, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " GLOBAL_VARIABLES[name] = value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99830:FunctionDef_L53_C0", "label": "_set_cli_vars", "type": "function", "loc": [53, 66], "level": 0, "parent": null, "vector": [2, 0, 0.9015, 0.2121, 0, 0.66, 1.0, 954, 0, 1, 0, 0, 0, 0, 5], "semantic": {"name": "_set_cli_vars", "arg_names": ["settings"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def _set_cli_vars(settings):\n for path, args in settings['VariableFiles']:\n try:\n GLOBAL_VARIABLES.set_from_file(path, args)\n except:\n msg, details = utils.get_error_details()\n LOGGER.error(msg)\n LOGGER.info(details)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99830:For_L54_C4", "label": "for path, args", "type": "for", "loc": [54, 60], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99830:FunctionDef_L53_C0", "vector": [6, 1, 0.8636, 0.1061, 1, 0.08, 0.0, 16, 6, 0, 0, 0, 0, 0, 4], "semantic": {"name": "path, args", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for path, args in settings['VariableFiles']:\n try:\n GLOBAL_VARIABLES.set_from_file(path, args)\n except:\n msg, details = utils.get_error_details()\n LOGGER.error(msg)\n LOGGER.info(details)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99830:Try_L55_C8", "label": "try", "type": "try", "loc": [55, 60], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99830:For_L54_C4", "vector": [7, 2, 0.8712, 0.0909, 2, 0.28, 0.0, 0, 0, 1, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n GLOBAL_VARIABLES.set_from_file(path, args)\n except:\n msg, details = utils.get_error_details()\n LOGGER.error(msg)\n LOGGER.info(details)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99830:Expr_L56_C12", "label": "set_from_file()", "type": "expression", "loc": [56, 56], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99830:Try_L55_C8", "vector": [8, 3, 0.8485, 0.0152, 3, 0.84, 0.0, 904, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "set_from_file", "arg_names": [], "import_names": [], "rhs_call_name": "set_from_file", "annotation": ""}, "snippet": " GLOBAL_VARIABLES.set_from_file(path, args)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99830:Assign_L58_C12", "label": "msg, details = get_error_details()", "type": "assigned_variable", "loc": [58, 58], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99830:Try_L55_C8", "vector": [14, 3, 0.8788, 0.0152, 3, 0.84, 0.0, 814, 3, 0, 0, 0, 692, 10, 1], "semantic": {"name": "msg, details", "arg_names": [], "import_names": [], "rhs_call_name": "get_error_details", "annotation": ""}, "snippet": " msg, details = utils.get_error_details()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99830:Expr_L59_C12", "label": "error()", "type": "expression", "loc": [59, 59], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99830:Try_L55_C8", "vector": [8, 3, 0.8939, 0.0152, 3, 0.84, 0.5, 771, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "error", "arg_names": [], "import_names": [], "rhs_call_name": "error", "annotation": ""}, "snippet": " LOGGER.error(msg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99830:Expr_L60_C12", "label": "info()", "type": "expression", "loc": [60, 60], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99830:Try_L55_C8", "vector": [8, 3, 0.9091, 0.0152, 3, 0.84, 1.0, 730, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "info", "arg_names": [], "import_names": [], "rhs_call_name": "info", "annotation": ""}, "snippet": " LOGGER.info(details)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99830:For_L61_C4", "label": "for varstr", "type": "for", "loc": [61, 66], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99830:FunctionDef_L53_C0", "vector": [6, 1, 0.9621, 0.0909, 1, 0.08, 1.0, 874, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "varstr", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for varstr in settings['Variables']:\n try:\n name, value = varstr.split(':', 1)\n except ValueError:\n name, value = varstr, ''\n GLOBAL_VARIABLES['${%s}' % name] = value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99830:Try_L62_C8", "label": "try", "type": "try", "loc": [62, 65], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99830:For_L61_C4", "vector": [7, 2, 0.9621, 0.0606, 2, 0.06, 0.0, 0, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n name, value = varstr.split(':', 1)\n except ValueError:\n name, value = varstr, ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99830:Assign_L63_C12", "label": "name, value = split()", "type": "assigned_variable", "loc": [63, 63], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99830:Try_L62_C8", "vector": [14, 3, 0.9545, 0.0152, 3, 0.99, 0.0, 509, 3, 2, 0, 0, 908, 10, 1], "semantic": {"name": "name, value", "arg_names": [], "import_names": [], "rhs_call_name": "split", "annotation": ""}, "snippet": " name, value = varstr.split(':', 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99830:Assign_L65_C12", "label": "name, value =", "type": "assigned_variable", "loc": [65, 65], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99830:Try_L62_C8", "vector": [14, 3, 0.9848, 0.0152, 3, 0.99, 0.0, 509, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "name, value", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " name, value = varstr, ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99830:Assign_L66_C8", "label": "assign", "type": "assigned_variable", "loc": [66, 66], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99830:For_L61_C4", "vector": [14, 2, 1.0, 0.0152, 2, 0.06, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " GLOBAL_VARIABLES['${%s}' % name] = value"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99830:FunctionDef_L29_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99830:Expr_L30_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99830:FunctionDef_L29_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99830:For_L31_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99830:For_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99830:Assign_L50_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99830:FunctionDef_L53_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99830:For_L54_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99830:For_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99830:Try_L55_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99830:Try_L55_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99830:Expr_L56_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99830:Try_L55_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99830:Assign_L58_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99830:Try_L55_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99830:Expr_L59_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99830:Try_L55_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99830:Expr_L60_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99830:FunctionDef_L53_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99830:For_L61_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99830:For_L61_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99830:Try_L62_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99830:Try_L62_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99830:Assign_L63_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99830:Try_L62_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99830:Assign_L65_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99830:For_L61_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99830:Assign_L66_C8"}] |
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Module that adds directories needed by Robot to sys.path when imported."""
import sys
import os
import fnmatch
def add_path(path, to_beginning=False, force=False):
if _should_be_added(path, force):
if to_beginning:
sys.path.insert(0, path)
else:
sys.path.append(path)
def remove_path(path):
path = _normpath(path)
sys.path = [p for p in sys.path if _normpath(p) != path]
def _should_be_added(path, force):
if (not path) or _find_in_syspath_normalized(path):
return False
return force or os.path.exists(path)
def _find_in_syspath_normalized(path):
path = _normpath(path)
for element in sys.path:
if _normpath(element) == path:
return element
return None
def _normpath(path):
return os.path.normcase(os.path.normpath(path))
ROBOTDIR = os.path.dirname(os.path.abspath(__file__))
PARENTDIR = os.path.dirname(ROBOTDIR)
add_path(os.path.join(ROBOTDIR, 'libraries'), to_beginning=True,
force=True)
add_path(PARENTDIR, to_beginning=True)
# Handles egg installations
if fnmatch.fnmatchcase(os.path.basename(PARENTDIR), 'robotframework-*.egg'):
add_path(os.path.dirname(PARENTDIR), to_beginning=True)
# Remove ROBOTDIR dir to disallow importing robot internal modules directly
remove_path(ROBOTDIR)
# Elements from PYTHONPATH. By default it is not processed in Jython and in
# Python valid non-absolute paths may be ignored.
PYPATH = os.environ.get('PYTHONPATH')
if PYPATH:
for path in PYPATH.split(os.pathsep):
add_path(path)
del path
# Current dir (it seems to be in Jython by default so let's be consistent)
add_path('.')
del _find_in_syspath_normalized, _normpath, add_path, remove_path, ROBOTDIR, PARENTDIR, PYPATH
| ajibawa-2023/Python-Code-Large/train/row_99831 | 36 | 74 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99831:Expr_L16_C0", "label": "expression", "type": "expression", "loc": [16, 16], "level": 0, "parent": null, "vector": [8, 0, 0.2162, 0.0135, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\"\"\"Module that adds directories needed by Robot to sys.path when imported.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99831:Import_L18_C0", "label": "sys import sys", "type": "import", "loc": [18, 18], "level": 0, "parent": null, "vector": [1, 0, 0.2432, 0.0135, 0, 0.66, 0.0588, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sys"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99831:Import_L19_C0", "label": "os import os", "type": "import", "loc": [19, 19], "level": 0, "parent": null, "vector": [1, 0, 0.2568, 0.0135, 0, 0.66, 0.1176, 688, 0, 1, 0, 0, 688, 0, 0], "semantic": {"name": "os", "arg_names": [], "import_names": ["os"], "rhs_call_name": "", "annotation": ""}, "snippet": "import os"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99831:Import_L20_C0", "label": "fnmatch import fnmatch", "type": "import", "loc": [20, 20], "level": 0, "parent": null, "vector": [1, 0, 0.2703, 0.0135, 0, 0.66, 0.1765, 626, 0, 1, 0, 0, 626, 0, 0], "semantic": {"name": "fnmatch", "arg_names": [], "import_names": ["fnmatch"], "rhs_call_name": "", "annotation": ""}, "snippet": "import fnmatch"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99831:FunctionDef_L23_C0", "label": "add_path", "type": "function", "loc": [23, 28], "level": 0, "parent": null, "vector": [2, 0, 0.3446, 0.0811, 0, 0.66, 0.2353, 885, 0, 3, 0, 0, 0, 0, 3], "semantic": {"name": "add_path", "arg_names": ["path", "to_beginning", "force"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def add_path(path, to_beginning=False, force=False):\n if _should_be_added(path, force):\n if to_beginning:\n sys.path.insert(0, path)\n else:\n sys.path.append(path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99831:If_L24_C4", "label": "if", "type": "if", "loc": [24, 28], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99831:FunctionDef_L23_C0", "vector": [4, 1, 0.3514, 0.0676, 1, 0.34, 0.0, 0, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if _should_be_added(path, force):\n if to_beginning:\n sys.path.insert(0, path)\n else:\n sys.path.append(path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99831:If_L25_C8", "label": "if", "type": "if", "loc": [25, 28], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99831:If_L24_C4", "vector": [4, 2, 0.3581, 0.0541, 2, 0.18, 0.0, 0, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if to_beginning:\n sys.path.insert(0, path)\n else:\n sys.path.append(path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99831:Expr_L26_C12", "label": "insert()", "type": "expression", "loc": [26, 26], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99831:If_L25_C8", "vector": [8, 3, 0.3514, 0.0135, 3, 0.98, 0.0, 368, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "insert", "arg_names": [], "import_names": [], "rhs_call_name": "insert", "annotation": ""}, "snippet": " sys.path.insert(0, path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99831:Expr_L28_C12", "label": "append()", "type": "expression", "loc": [28, 28], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99831:If_L25_C8", "vector": [8, 3, 0.3784, 0.0135, 3, 0.98, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " sys.path.append(path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99831:FunctionDef_L30_C0", "label": "remove_path", "type": "function", "loc": [30, 32], "level": 0, "parent": null, "vector": [2, 0, 0.4189, 0.0405, 0, 0.66, 0.2941, 722, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "remove_path", "arg_names": ["path"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def remove_path(path):\n path = _normpath(path)\n sys.path = [p for p in sys.path if _normpath(p) != path]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99831:Assign_L31_C4", "label": "path = _normpath()", "type": "assigned_variable", "loc": [31, 31], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99831:FunctionDef_L30_C0", "vector": [14, 1, 0.4189, 0.0135, 1, 0.56, 0.0, 358, 3, 1, 0, 0, 368, 10, 1], "semantic": {"name": "path", "arg_names": [], "import_names": [], "rhs_call_name": "_normpath", "annotation": ""}, "snippet": " path = _normpath(path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99831:Assign_L32_C4", "label": "sys.path =", "type": "assigned_variable", "loc": [32, 32], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99831:FunctionDef_L30_C0", "vector": [14, 1, 0.4324, 0.0135, 1, 0.56, 1.0, 909, 5, 0, 0, 0, 0, 0, 1], "semantic": {"name": "sys.path", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " sys.path = [p for p in sys.path if _normpath(p) != path]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99831:FunctionDef_L34_C0", "label": "_should_be_added", "type": "function", "loc": [34, 37], "level": 0, "parent": null, "vector": [2, 0, 0.4797, 0.0541, 0, 0.66, 0.3529, 593, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "_should_be_added", "arg_names": ["path", "force"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def _should_be_added(path, force):\n if (not path) or _find_in_syspath_normalized(path):\n return False\n return force or os.path.exists(path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99831:If_L35_C4", "label": "if", "type": "if", "loc": [35, 36], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99831:FunctionDef_L34_C0", "vector": [4, 1, 0.4797, 0.027, 1, 0.16, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if (not path) or _find_in_syspath_normalized(path):\n return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99831:Return_L36_C8", "label": "return", "type": "return", "loc": [36, 36], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99831:If_L35_C4", "vector": [13, 2, 0.4865, 0.0135, 2, 0.19, 0.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99831:Return_L37_C4", "label": "return", "type": "return", "loc": [37, 37], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99831:FunctionDef_L34_C0", "vector": [13, 1, 0.5, 0.0135, 1, 0.16, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return force or os.path.exists(path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99831:FunctionDef_L39_C0", "label": "_find_in_syspath_normalized", "type": "function", "loc": [39, 44], "level": 0, "parent": null, "vector": [2, 0, 0.5608, 0.0811, 0, 0.66, 0.4118, 671, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "_find_in_syspath_normalized", "arg_names": ["path"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def _find_in_syspath_normalized(path):\n path = _normpath(path)\n for element in sys.path:\n if _normpath(element) == path:\n return element\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99831:Assign_L40_C4", "label": "path = _normpath()", "type": "assigned_variable", "loc": [40, 40], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99831:FunctionDef_L39_C0", "vector": [14, 1, 0.5405, 0.0135, 1, 0.36, 0.0, 358, 3, 1, 0, 0, 368, 10, 1], "semantic": {"name": "path", "arg_names": [], "import_names": [], "rhs_call_name": "_normpath", "annotation": ""}, "snippet": " path = _normpath(path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99831:For_L41_C4", "label": "for element", "type": "for", "loc": [41, 43], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99831:FunctionDef_L39_C0", "vector": [6, 1, 0.5676, 0.0405, 1, 0.36, 0.5, 736, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "element", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for element in sys.path:\n if _normpath(element) == path:\n return element"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99831:If_L42_C8", "label": "if", "type": "if", "loc": [42, 43], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99831:For_L41_C4", "vector": [4, 2, 0.5743, 0.027, 2, 0.7, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if _normpath(element) == path:\n return element"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99831:Return_L43_C12", "label": "return", "type": "return", "loc": [43, 43], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99831:If_L42_C8", "vector": [13, 3, 0.5811, 0.0135, 3, 0.74, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return element"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99831:Return_L44_C4", "label": "return", "type": "return", "loc": [44, 44], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99831:FunctionDef_L39_C0", "vector": [13, 1, 0.5946, 0.0135, 1, 0.36, 1.0, 0, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99831:FunctionDef_L46_C0", "label": "_normpath", "type": "function", "loc": [46, 47], "level": 0, "parent": null, "vector": [2, 0, 0.6284, 0.027, 0, 0.66, 0.4706, 368, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "_normpath", "arg_names": ["path"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def _normpath(path):\n return os.path.normcase(os.path.normpath(path))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99831:Return_L47_C4", "label": "return", "type": "return", "loc": [47, 47], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99831:FunctionDef_L46_C0", "vector": [13, 1, 0.6351, 0.0135, 1, 0.79, 0.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return os.path.normcase(os.path.normpath(path))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99831:Assign_L50_C0", "label": "ROBOTDIR = dirname()", "type": "assigned_variable", "loc": [50, 50], "level": 0, "parent": null, "vector": [14, 0, 0.6757, 0.0135, 0, 0.66, 0.5294, 474, 3, 1, 0, 0, 959, 10, 2], "semantic": {"name": "ROBOTDIR", "arg_names": [], "import_names": [], "rhs_call_name": "dirname", "annotation": ""}, "snippet": "ROBOTDIR = os.path.dirname(os.path.abspath(__file__))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99831:Assign_L51_C0", "label": "PARENTDIR = dirname()", "type": "assigned_variable", "loc": [51, 51], "level": 0, "parent": null, "vector": [14, 0, 0.6892, 0.0135, 0, 0.66, 0.5882, 363, 3, 1, 0, 0, 959, 10, 1], "semantic": {"name": "PARENTDIR", "arg_names": [], "import_names": [], "rhs_call_name": "dirname", "annotation": ""}, "snippet": "PARENTDIR = os.path.dirname(ROBOTDIR)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99831:Expr_L53_C0", "label": "add_path()", "type": "expression", "loc": [53, 54], "level": 0, "parent": null, "vector": [8, 0, 0.723, 0.027, 0, 0.66, 0.6471, 885, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "add_path", "arg_names": [], "import_names": [], "rhs_call_name": "add_path", "annotation": ""}, "snippet": "add_path(os.path.join(ROBOTDIR, 'libraries'), to_beginning=True,\n force=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99831:Expr_L55_C0", "label": "add_path()", "type": "expression", "loc": [55, 55], "level": 0, "parent": null, "vector": [8, 0, 0.7432, 0.0135, 0, 0.66, 0.7059, 885, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "add_path", "arg_names": [], "import_names": [], "rhs_call_name": "add_path", "annotation": ""}, "snippet": "add_path(PARENTDIR, to_beginning=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99831:If_L57_C0", "label": "if", "type": "if", "loc": [57, 58], "level": 0, "parent": null, "vector": [4, 0, 0.777, 0.027, 0, 0.66, 0.7647, 0, 3, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if fnmatch.fnmatchcase(os.path.basename(PARENTDIR), 'robotframework-*.egg'):\n add_path(os.path.dirname(PARENTDIR), to_beginning=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99831:Expr_L58_C4", "label": "add_path()", "type": "expression", "loc": [58, 58], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99831:If_L57_C0", "vector": [8, 1, 0.7838, 0.0135, 1, 0.49, 0.0, 885, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "add_path", "arg_names": [], "import_names": [], "rhs_call_name": "add_path", "annotation": ""}, "snippet": " add_path(os.path.dirname(PARENTDIR), to_beginning=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99831:Expr_L61_C0", "label": "remove_path()", "type": "expression", "loc": [61, 61], "level": 0, "parent": null, "vector": [8, 0, 0.8243, 0.0135, 0, 0.66, 0.8235, 722, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "remove_path", "arg_names": [], "import_names": [], "rhs_call_name": "remove_path", "annotation": ""}, "snippet": "remove_path(ROBOTDIR)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99831:Assign_L65_C0", "label": "PYPATH = get()", "type": "assigned_variable", "loc": [65, 65], "level": 0, "parent": null, "vector": [14, 0, 0.8784, 0.0135, 0, 0.66, 0.8824, 462, 3, 1, 0, 0, 607, 10, 1], "semantic": {"name": "PYPATH", "arg_names": [], "import_names": [], "rhs_call_name": "get", "annotation": ""}, "snippet": "PYPATH = os.environ.get('PYTHONPATH')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99831:If_L66_C0", "label": "if", "type": "if", "loc": [66, 69], "level": 0, "parent": null, "vector": [4, 0, 0.9122, 0.0541, 0, 0.66, 0.9412, 0, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if PYPATH:\n for path in PYPATH.split(os.pathsep):\n add_path(path)\n del path"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99831:For_L67_C4", "label": "for path", "type": "for", "loc": [67, 68], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99831:If_L66_C0", "vector": [6, 1, 0.9122, 0.027, 1, 0.9, 0.0, 358, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "path", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for path in PYPATH.split(os.pathsep):\n add_path(path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99831:Expr_L68_C8", "label": "add_path()", "type": "expression", "loc": [68, 68], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99831:For_L67_C4", "vector": [8, 2, 0.9189, 0.0135, 2, 0.45, 0.0, 885, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "add_path", "arg_names": [], "import_names": [], "rhs_call_name": "add_path", "annotation": ""}, "snippet": " add_path(path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99831:Expr_L72_C0", "label": "add_path()", "type": "expression", "loc": [72, 72], "level": 0, "parent": null, "vector": [8, 0, 0.973, 0.0135, 0, 0.66, 1.0, 885, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "add_path", "arg_names": [], "import_names": [], "rhs_call_name": "add_path", "annotation": ""}, "snippet": "add_path('.')"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99831:FunctionDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99831:If_L24_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99831:If_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99831:If_L25_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99831:If_L25_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99831:Expr_L26_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99831:If_L25_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99831:Expr_L28_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99831:FunctionDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99831:Assign_L31_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99831:FunctionDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99831:Assign_L32_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99831:FunctionDef_L34_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99831:If_L35_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99831:If_L35_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99831:Return_L36_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99831:FunctionDef_L34_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99831:Return_L37_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99831:FunctionDef_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99831:Assign_L40_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99831:FunctionDef_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99831:For_L41_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99831:For_L41_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99831:If_L42_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99831:If_L42_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99831:Return_L43_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99831:FunctionDef_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99831:Return_L44_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99831:FunctionDef_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99831:Return_L47_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99831:If_L57_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99831:Expr_L58_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99831:If_L66_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99831:For_L67_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99831:For_L67_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99831:Expr_L68_C8"}] |
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import sys
import threading
class Thread(threading.Thread):
"""A subclass of threading.Thread, with a stop() method.
Original version posted by Connelly Barnes to python-list and available at
http://mail.python.org/pipermail/python-list/2004-May/219465.html
This version mainly has kill() changed to stop() to match java.lang.Thread.
This is a hack but seems to be the best way the get this done. Only used
in Python because in Jython we can use java.lang.Thread.
"""
def __init__(self, runner):
threading.Thread.__init__(self, target=runner)
self._stopped = False
def start(self):
self.__run_backup = self.run
self.run = self.__run
threading.Thread.start(self)
def stop(self):
self._stopped = True
def __run(self):
"""Hacked run function, which installs the trace."""
sys.settrace(self._globaltrace)
self.__run_backup()
self.run = self.__run_backup
def _globaltrace(self, frame, why, arg):
if why == 'call':
return self._localtrace
else:
return None
def _localtrace(self, frame, why, arg):
if self._stopped:
if why == 'line':
raise SystemExit()
return self._localtrace
| ajibawa-2023/Python-Code-Large/train/row_99832 | 26 | 59 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99832:Import_L15_C0", "label": "sys import sys", "type": "import", "loc": [15, 15], "level": 0, "parent": null, "vector": [1, 0, 0.2542, 0.0169, 0, 0.66, 0.0, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sys"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99832:Import_L16_C0", "label": "threading import threading", "type": "import", "loc": [16, 16], "level": 0, "parent": null, "vector": [1, 0, 0.2712, 0.0169, 0, 0.66, 0.5, 83, 0, 1, 0, 0, 83, 0, 0], "semantic": {"name": "threading", "arg_names": [], "import_names": ["threading"], "rhs_call_name": "", "annotation": ""}, "snippet": "import threading"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99832:ClassDef_L19_C0", "label": "Thread", "type": "class", "loc": [19, 59], "level": 0, "parent": null, "vector": [3, 0, 0.661, 0.6949, 0, 0.66, 1.0, 134, 0, 6, 0, 0, 634, 0, 5], "semantic": {"name": "Thread", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Thread(threading.Thread):\n \"\"\"A subclass of threading.Thread, with a stop() method.\n\n Original version posted by Connelly Barnes to python-list and available at\n http://mail.python.org/pipermail/python-list/2004-May/219465.html\n\n This version mainly has kill() changed to stop() to match java.lang.Thread.\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99832:Expr_L20_C4", "label": "expression", "type": "expression", "loc": [20, 29], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99832:ClassDef_L19_C0", "vector": [8, 1, 0.4153, 0.1695, 1, 0.49, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"A subclass of threading.Thread, with a stop() method.\n\n Original version posted by Connelly Barnes to python-list and available at\n http://mail.python.org/pipermail/python-list/2004-May/219465.html\n\n This version mainly has kill() changed to stop() to match java.lang.Thread.\n\n This is a hack but seems to be the best way the get this done. Only used"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99832:FunctionDef_L31_C4", "label": "__init__", "type": "function", "loc": [31, 33], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99832:ClassDef_L19_C0", "vector": [2, 1, 0.5424, 0.0508, 1, 0.49, 0.1667, 555, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": ["self", "runner"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, runner):\n threading.Thread.__init__(self, target=runner)\n self._stopped = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99832:Expr_L32_C8", "label": "__init__()", "type": "expression", "loc": [32, 32], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99832:FunctionDef_L31_C4", "vector": [8, 2, 0.5424, 0.0169, 2, 0.32, 0.0, 555, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " threading.Thread.__init__(self, target=runner)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99832:Assign_L33_C8", "label": "self._stopped =", "type": "assigned_variable", "loc": [33, 33], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99832:FunctionDef_L31_C4", "vector": [14, 2, 0.5593, 0.0169, 2, 0.32, 1.0, 792, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self._stopped", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._stopped = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99832:FunctionDef_L35_C4", "label": "start", "type": "function", "loc": [35, 38], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99832:ClassDef_L19_C0", "vector": [2, 1, 0.6186, 0.0678, 1, 0.49, 0.3333, 511, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "start", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def start(self):\n self.__run_backup = self.run\n self.run = self.__run\n threading.Thread.start(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99832:Assign_L36_C8", "label": "self.__run_backup =", "type": "assigned_variable", "loc": [36, 36], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99832:FunctionDef_L35_C4", "vector": [14, 2, 0.6102, 0.0169, 2, 0.36, 0.0, 591, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.__run_backup", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.__run_backup = self.run"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99832:Assign_L37_C8", "label": "self.run =", "type": "assigned_variable", "loc": [37, 37], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99832:FunctionDef_L35_C4", "vector": [14, 2, 0.6271, 0.0169, 2, 0.36, 0.5, 421, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.run", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.run = self.__run"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99832:Expr_L38_C8", "label": "start()", "type": "expression", "loc": [38, 38], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99832:FunctionDef_L35_C4", "vector": [8, 2, 0.6441, 0.0169, 2, 0.36, 1.0, 511, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "start", "arg_names": [], "import_names": [], "rhs_call_name": "start", "annotation": ""}, "snippet": " threading.Thread.start(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99832:FunctionDef_L40_C4", "label": "stop", "type": "function", "loc": [40, 41], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99832:ClassDef_L19_C0", "vector": [2, 1, 0.6864, 0.0339, 1, 0.49, 0.5, 343, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "stop", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def stop(self):\n self._stopped = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99832:Assign_L41_C8", "label": "self._stopped =", "type": "assigned_variable", "loc": [41, 41], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99832:FunctionDef_L40_C4", "vector": [14, 2, 0.6949, 0.0169, 2, 0.46, 0.0, 792, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self._stopped", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._stopped = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99832:FunctionDef_L43_C4", "label": "__run", "type": "function", "loc": [43, 47], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99832:ClassDef_L19_C0", "vector": [2, 1, 0.7627, 0.0847, 1, 0.49, 0.6667, 119, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "__run", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __run(self):\n \"\"\"Hacked run function, which installs the trace.\"\"\"\n sys.settrace(self._globaltrace)\n self.__run_backup()\n self.run = self.__run_backup"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99832:Expr_L44_C8", "label": "expression", "type": "expression", "loc": [44, 44], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99832:FunctionDef_L43_C4", "vector": [8, 2, 0.7458, 0.0169, 2, 0.42, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Hacked run function, which installs the trace.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99832:Expr_L45_C8", "label": "settrace()", "type": "expression", "loc": [45, 45], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99832:FunctionDef_L43_C4", "vector": [8, 2, 0.7627, 0.0169, 2, 0.42, 0.3333, 98, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "settrace", "arg_names": [], "import_names": [], "rhs_call_name": "settrace", "annotation": ""}, "snippet": " sys.settrace(self._globaltrace)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99832:Expr_L46_C8", "label": "__run_backup()", "type": "expression", "loc": [46, 46], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99832:FunctionDef_L43_C4", "vector": [8, 2, 0.7797, 0.0169, 2, 0.42, 0.6667, 456, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "__run_backup", "arg_names": [], "import_names": [], "rhs_call_name": "__run_backup", "annotation": ""}, "snippet": " self.__run_backup()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99832:Assign_L47_C8", "label": "self.run =", "type": "assigned_variable", "loc": [47, 47], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99832:FunctionDef_L43_C4", "vector": [14, 2, 0.7966, 0.0169, 2, 0.42, 1.0, 421, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.run", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.run = self.__run_backup"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99832:FunctionDef_L49_C4", "label": "_globaltrace", "type": "function", "loc": [49, 53], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99832:ClassDef_L19_C0", "vector": [2, 1, 0.8644, 0.0847, 1, 0.49, 0.8333, 975, 0, 4, 1, 0, 0, 0, 0], "semantic": {"name": "_globaltrace", "arg_names": ["self", "frame", "why", "arg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _globaltrace(self, frame, why, arg):\n if why == 'call':\n return self._localtrace\n else:\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99832:If_L50_C8", "label": "if", "type": "if", "loc": [50, 53], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99832:FunctionDef_L49_C4", "vector": [4, 2, 0.8729, 0.0678, 2, 0.88, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if why == 'call':\n return self._localtrace\n else:\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99832:Return_L51_C12", "label": "return", "type": "return", "loc": [51, 51], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99832:If_L50_C8", "vector": [13, 3, 0.8644, 0.0169, 3, 0.33, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._localtrace"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99832:Return_L53_C12", "label": "return", "type": "return", "loc": [53, 53], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99832:If_L50_C8", "vector": [13, 3, 0.8983, 0.0169, 3, 0.33, 1.0, 0, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99832:FunctionDef_L55_C4", "label": "_localtrace", "type": "function", "loc": [55, 59], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99832:ClassDef_L19_C0", "vector": [2, 1, 0.9661, 0.0847, 1, 0.49, 1.0, 657, 0, 4, 1, 0, 0, 0, 1], "semantic": {"name": "_localtrace", "arg_names": ["self", "frame", "why", "arg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _localtrace(self, frame, why, arg):\n if self._stopped:\n if why == 'line':\n raise SystemExit()\n return self._localtrace"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99832:If_L56_C8", "label": "if", "type": "if", "loc": [56, 58], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99832:FunctionDef_L55_C4", "vector": [4, 2, 0.9661, 0.0508, 2, 0.97, 0.0, 0, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self._stopped:\n if why == 'line':\n raise SystemExit()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99832:If_L57_C12", "label": "if", "type": "if", "loc": [57, 58], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99832:If_L56_C8", "vector": [4, 3, 0.9746, 0.0339, 3, 0.01, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if why == 'line':\n raise SystemExit()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99832:Return_L59_C8", "label": "return", "type": "return", "loc": [59, 59], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99832:FunctionDef_L55_C4", "vector": [13, 2, 1.0, 0.0169, 2, 0.97, 1.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._localtrace"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99832:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99832:Expr_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99832:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99832:FunctionDef_L31_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99832:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99832:Expr_L32_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99832:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99832:Assign_L33_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99832:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99832:FunctionDef_L35_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99832:FunctionDef_L35_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99832:Assign_L36_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99832:FunctionDef_L35_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99832:Assign_L37_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99832:FunctionDef_L35_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99832:Expr_L38_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99832:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99832:FunctionDef_L40_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99832:FunctionDef_L40_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99832:Assign_L41_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99832:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99832:FunctionDef_L43_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99832:FunctionDef_L43_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99832:Expr_L44_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99832:FunctionDef_L43_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99832:Expr_L45_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99832:FunctionDef_L43_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99832:Expr_L46_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99832:FunctionDef_L43_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99832:Assign_L47_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99832:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99832:FunctionDef_L49_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99832:FunctionDef_L49_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99832:If_L50_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99832:If_L50_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99832:Return_L51_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99832:If_L50_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99832:Return_L53_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99832:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99832:FunctionDef_L55_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99832:FunctionDef_L55_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99832:If_L56_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99832:If_L56_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99832:If_L57_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99832:FunctionDef_L55_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99832:Return_L59_C8"}] |
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import re
from unic import unic
def html_escape(text, formatting=False):
# TODO: Remove formatting attribute after RIDE does not use it anymore
if formatting:
return html_format(text)
return _HtmlEscaper().format(text)
def html_format(text):
return _HtmlFormatter().format(text)
def html_attr_escape(attr):
for name, value in [('&', '&'), ('"', '"'),
('<', '<'), ('>', '>')]:
attr = attr.replace(name, value)
for wspace in ['\n', '\r', '\t']:
attr = attr.replace(wspace, ' ')
return attr
class _Formatter(object):
def format(self, text):
text = self._html_escape(unic(text))
for line in text.splitlines():
self.add_line(line)
return self.get_result()
def _html_escape(self, text):
for name, value in [('&', '&'), ('<', '<'), ('>', '>')]:
text = text.replace(name, value)
return text
class _HtmlEscaper(_Formatter):
def __init__(self):
self._lines = []
self._line_formatter = _UrlFormatter()
def add_line(self, line):
self._lines.append(self._line_formatter.format(line))
def get_result(self):
return '\n'.join(self._lines)
class _HtmlFormatter(_Formatter):
_hr_re = re.compile('^-{3,} *$')
def __init__(self):
self._result = _Formatted()
self._table = _TableFormatter()
self._line_formatter = _LineFormatter()
def add_line(self, line):
if self._add_table_row(line):
return
if self._table.is_started():
self._result.add(self._table.end(), join_after=False)
if self._is_hr(line):
self._result.add('<hr />\n', join_after=False)
return
self._result.add(self._line_formatter.format(line))
def _add_table_row(self, row):
if self._table.is_table_row(row):
self._table.add_row(row)
return True
return False
def _is_hr(self, line):
return bool(self._hr_re.match(line))
def get_result(self):
if self._table.is_started():
self._result.add(self._table.end())
return self._result.get_result()
class _Formatted(object):
def __init__(self):
self._result = []
self._joiner = ''
def add(self, line, join_after=True):
self._result.extend([self._joiner, line])
self._joiner = '\n' if join_after else ''
def get_result(self):
return ''.join(self._result)
class _UrlFormatter(object):
_formatting = False
_image_exts = ('.jpg', '.jpeg', '.png', '.gif', '.bmp')
_url = re.compile('''
( (^|\ ) ["'([]* ) # begin of line or space and opt. any char "'([
(\w{3,9}://[\S]+?) # url (protocol is any alphanum 3-9 long string)
(?= [])"'.,!?:;]* ($|\ ) ) # opt. any char ])"'.,!?:; and end of line or space
''', re.VERBOSE)
def format(self, line):
return self._format_url(line)
def _format_url(self, line):
return self._url.sub(self._repl_url, line) if ':' in line else line
def _repl_url(self, match):
pre = match.group(1)
url = match.group(3).replace('"', '"')
if self._format_as_image(url):
tmpl = '<img src="%s" title="%s" style="border: 1px solid gray" />'
else:
tmpl = '<a href="%s">%s</a>'
return pre + tmpl % (url, url)
def _format_as_image(self, url):
return self._formatting and url.lower().endswith(self._image_exts)
class _LineFormatter(_UrlFormatter):
_formatting = True
_bold = re.compile('''
( # prefix (group 1)
(^|\ ) # begin of line or space
["'(]* _? # optionally any char "'( and optional begin of italic
) #
\* # start of bold
([^\ ].*?) # no space and then anything (group 3)
\* # end of bold
(?= # start of postfix (non-capturing group)
_? ["').,!?:;]* # optional end of italic and any char "').,!?:;
($|\ ) # end of line or space
)
''', re.VERBOSE)
_italic = re.compile('''
( (^|\ ) ["'(]* ) # begin of line or space and opt. any char "'(
_ # start of italic
([^\ _].*?) # no space or underline and then anything
_ # end of italic
(?= ["').,!?:;]* ($|\ ) ) # opt. any char "').,!?:; and end of line or space
''', re.VERBOSE)
def format(self, line):
return self._format_url(self._format_italic(self._format_bold(line)))
def _format_bold(self, line):
return self._bold.sub('\\1<b>\\3</b>', line) if '*' in line else line
def _format_italic(self, line):
return self._italic.sub('\\1<i>\\3</i>', line) if '_' in line else line
class _TableFormatter(object):
_is_table_line = re.compile('^\s*\| (.* |)\|\s*$')
_line_splitter = re.compile(' \|(?= )')
def __init__(self):
self._rows = []
self._line_formatter = _LineFormatter()
def is_table_row(self, row):
return bool(self._is_table_line.match(row))
def is_started(self):
return bool(self._rows)
def add_row(self, text):
text = text.strip()[1:-1] # remove outer whitespace and pipes
cells = [cell.strip() for cell in self._line_splitter.split(text)]
self._rows.append(cells)
def end(self):
ret = self._format_table(self._rows)
self._rows = []
return ret
def _format_table(self, rows):
maxlen = max(len(row) for row in rows)
table = ['<table border="1" class="doc">']
for row in rows:
row += [''] * (maxlen - len(row)) # fix ragged tables
table.append('<tr>')
table.extend(['<td>%s</td>' % self._line_formatter.format(cell)
for cell in row])
table.append('</tr>')
table.append('</table>\n')
return '\n'.join(table)
| ajibawa-2023/Python-Code-Large/train/row_99833 | 121 | 209 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99833:Import_L15_C0", "label": "re import re", "type": "import", "loc": [15, 15], "level": 0, "parent": null, "vector": [1, 0, 0.0718, 0.0048, 0, 0.66, 0.0, 540, 0, 1, 0, 0, 540, 0, 0], "semantic": {"name": "re", "arg_names": [], "import_names": ["re"], "rhs_call_name": "", "annotation": ""}, "snippet": "import re"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99833:ImportFrom_L17_C0", "label": "from unic import unic", "type": "import", "loc": [17, 17], "level": 0, "parent": null, "vector": [1, 0, 0.0813, 0.0048, 0, 0.66, 0.0909, 992, 0, 1, 0, 0, 992, 0, 0], "semantic": {"name": "unic", "arg_names": [], "import_names": ["unic"], "rhs_call_name": "", "annotation": ""}, "snippet": "from unic import unic"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L20_C0", "label": "html_escape", "type": "function", "loc": [20, 24], "level": 0, "parent": null, "vector": [2, 0, 0.1053, 0.0239, 0, 0.66, 0.1818, 435, 0, 2, 1, 0, 0, 0, 3], "semantic": {"name": "html_escape", "arg_names": ["text", "formatting"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def html_escape(text, formatting=False):\n # TODO: Remove formatting attribute after RIDE does not use it anymore\n if formatting:\n return html_format(text)\n return _HtmlEscaper().format(text)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99833:If_L22_C4", "label": "if", "type": "if", "loc": [22, 23], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L20_C0", "vector": [4, 1, 0.1077, 0.0096, 1, 0.86, 0.0, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if formatting:\n return html_format(text)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99833:Return_L23_C8", "label": "return", "type": "return", "loc": [23, 23], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99833:If_L22_C4", "vector": [13, 2, 0.11, 0.0048, 2, 0.44, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return html_format(text)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99833:Return_L24_C4", "label": "return", "type": "return", "loc": [24, 24], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L20_C0", "vector": [13, 1, 0.1148, 0.0048, 1, 0.86, 1.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return _HtmlEscaper().format(text)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L27_C0", "label": "html_format", "type": "function", "loc": [27, 28], "level": 0, "parent": null, "vector": [2, 0, 0.1316, 0.0096, 0, 0.66, 0.2727, 440, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "html_format", "arg_names": ["text"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def html_format(text):\n return _HtmlFormatter().format(text)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99833:Return_L28_C4", "label": "return", "type": "return", "loc": [28, 28], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L27_C0", "vector": [13, 1, 0.134, 0.0048, 1, 0.8, 0.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return _HtmlFormatter().format(text)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L31_C0", "label": "html_attr_escape", "type": "function", "loc": [31, 37], "level": 0, "parent": null, "vector": [2, 0, 0.1627, 0.0335, 0, 0.66, 0.3636, 474, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "html_attr_escape", "arg_names": ["attr"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def html_attr_escape(attr):\n for name, value in [('&', '&'), ('\"', '"'),\n ('<', '<'), ('>', '>')]:\n attr = attr.replace(name, value)\n for wspace in ['\\n', '\\r', '\\t']:\n attr = attr.replace(wspace, ' ')\n return attr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99833:For_L32_C4", "label": "for name, value", "type": "for", "loc": [32, 34], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L31_C0", "vector": [6, 1, 0.1579, 0.0144, 1, 0.06, 0.0, 509, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "name, value", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for name, value in [('&', '&'), ('\"', '"'),\n ('<', '<'), ('>', '>')]:\n attr = attr.replace(name, value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99833:Assign_L34_C8", "label": "attr = replace()", "type": "assigned_variable", "loc": [34, 34], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99833:For_L32_C4", "vector": [14, 2, 0.1627, 0.0048, 2, 0.44, 0.0, 400, 3, 2, 0, 0, 293, 10, 1], "semantic": {"name": "attr", "arg_names": [], "import_names": [], "rhs_call_name": "replace", "annotation": ""}, "snippet": " attr = attr.replace(name, value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99833:For_L35_C4", "label": "for wspace", "type": "for", "loc": [35, 36], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L31_C0", "vector": [6, 1, 0.1699, 0.0096, 1, 0.06, 0.5, 601, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "wspace", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for wspace in ['\\n', '\\r', '\\t']:\n attr = attr.replace(wspace, ' ')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99833:Assign_L36_C8", "label": "attr = replace()", "type": "assigned_variable", "loc": [36, 36], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99833:For_L35_C4", "vector": [14, 2, 0.1722, 0.0048, 2, 0.52, 0.0, 400, 3, 2, 0, 0, 293, 10, 1], "semantic": {"name": "attr", "arg_names": [], "import_names": [], "rhs_call_name": "replace", "annotation": ""}, "snippet": " attr = attr.replace(wspace, ' ')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99833:Return_L37_C4", "label": "return", "type": "return", "loc": [37, 37], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L31_C0", "vector": [13, 1, 0.177, 0.0048, 1, 0.06, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return attr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99833:ClassDef_L40_C0", "label": "_Formatter", "type": "class", "loc": [40, 51], "level": 0, "parent": null, "vector": [3, 0, 0.2177, 0.0574, 0, 0.66, 0.4545, 121, 0, 2, 0, 0, 186, 0, 6], "semantic": {"name": "_Formatter", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class _Formatter(object):\n\n def format(self, text):\n text = self._html_escape(unic(text))\n for line in text.splitlines():\n self.add_line(line)\n return self.get_result()\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L42_C4", "label": "format", "type": "function", "loc": [42, 46], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99833:ClassDef_L40_C0", "vector": [2, 1, 0.2105, 0.0239, 1, 0.51, 0.0, 293, 0, 2, 1, 0, 0, 0, 5], "semantic": {"name": "format", "arg_names": ["self", "text"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def format(self, text):\n text = self._html_escape(unic(text))\n for line in text.splitlines():\n self.add_line(line)\n return self.get_result()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99833:Assign_L43_C8", "label": "text = _html_escape()", "type": "assigned_variable", "loc": [43, 43], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L42_C4", "vector": [14, 2, 0.2057, 0.0048, 2, 0.45, 0.0, 439, 3, 1, 0, 0, 914, 10, 2], "semantic": {"name": "text", "arg_names": [], "import_names": [], "rhs_call_name": "_html_escape", "annotation": ""}, "snippet": " text = self._html_escape(unic(text))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99833:For_L44_C8", "label": "for line", "type": "for", "loc": [44, 45], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L42_C4", "vector": [6, 2, 0.2129, 0.0096, 2, 0.45, 0.5, 373, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "line", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for line in text.splitlines():\n self.add_line(line)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99833:Expr_L45_C12", "label": "add_line()", "type": "expression", "loc": [45, 45], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99833:For_L44_C8", "vector": [8, 3, 0.2153, 0.0048, 3, 0.5, 0.0, 474, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "add_line", "arg_names": [], "import_names": [], "rhs_call_name": "add_line", "annotation": ""}, "snippet": " self.add_line(line)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99833:Return_L46_C8", "label": "return", "type": "return", "loc": [46, 46], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L42_C4", "vector": [13, 2, 0.2201, 0.0048, 2, 0.45, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.get_result()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L48_C4", "label": "_html_escape", "type": "function", "loc": [48, 51], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99833:ClassDef_L40_C0", "vector": [2, 1, 0.2368, 0.0191, 1, 0.51, 1.0, 914, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "_html_escape", "arg_names": ["self", "text"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _html_escape(self, text):\n for name, value in [('&', '&'), ('<', '<'), ('>', '>')]:\n text = text.replace(name, value)\n return text"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99833:For_L49_C8", "label": "for name, value", "type": "for", "loc": [49, 50], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L48_C4", "vector": [6, 2, 0.2368, 0.0096, 2, 0.05, 0.0, 509, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "name, value", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for name, value in [('&', '&'), ('<', '<'), ('>', '>')]:\n text = text.replace(name, value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99833:Assign_L50_C12", "label": "text = replace()", "type": "assigned_variable", "loc": [50, 50], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99833:For_L49_C8", "vector": [14, 3, 0.2392, 0.0048, 3, 0.89, 0.0, 439, 3, 2, 0, 0, 293, 10, 1], "semantic": {"name": "text", "arg_names": [], "import_names": [], "rhs_call_name": "replace", "annotation": ""}, "snippet": " text = text.replace(name, value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99833:Return_L51_C8", "label": "return", "type": "return", "loc": [51, 51], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L48_C4", "vector": [13, 2, 0.244, 0.0048, 2, 0.05, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return text"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99833:ClassDef_L54_C0", "label": "_HtmlEscaper", "type": "class", "loc": [54, 64], "level": 0, "parent": null, "vector": [3, 0, 0.2823, 0.0526, 0, 0.66, 0.5455, 71, 0, 3, 0, 0, 121, 0, 4], "semantic": {"name": "_HtmlEscaper", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class _HtmlEscaper(_Formatter):\n\n def __init__(self):\n self._lines = []\n self._line_formatter = _UrlFormatter()\n\n def add_line(self, line):\n self._lines.append(self._line_formatter.format(line))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L56_C4", "label": "__init__", "type": "function", "loc": [56, 58], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99833:ClassDef_L54_C0", "vector": [2, 1, 0.2727, 0.0144, 1, 0.96, 0.0, 555, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self):\n self._lines = []\n self._line_formatter = _UrlFormatter()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99833:Assign_L57_C8", "label": "self._lines =", "type": "assigned_variable", "loc": [57, 57], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L56_C4", "vector": [14, 2, 0.2727, 0.0048, 2, 0.68, 0.0, 494, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self._lines", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._lines = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99833:Assign_L58_C8", "label": "self._line_formatter = _UrlFormatter()", "type": "assigned_variable", "loc": [58, 58], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L56_C4", "vector": [14, 2, 0.2775, 0.0048, 2, 0.68, 1.0, 810, 3, 0, 0, 0, 721, 10, 1], "semantic": {"name": "self._line_formatter", "arg_names": [], "import_names": [], "rhs_call_name": "_UrlFormatter", "annotation": ""}, "snippet": " self._line_formatter = _UrlFormatter()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L60_C4", "label": "add_line", "type": "function", "loc": [60, 61], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99833:ClassDef_L54_C0", "vector": [2, 1, 0.2895, 0.0096, 1, 0.96, 0.5, 474, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "add_line", "arg_names": ["self", "line"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def add_line(self, line):\n self._lines.append(self._line_formatter.format(line))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99833:Expr_L61_C8", "label": "append()", "type": "expression", "loc": [61, 61], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L60_C4", "vector": [8, 2, 0.2919, 0.0048, 2, 0.91, 0.0, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self._lines.append(self._line_formatter.format(line))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L63_C4", "label": "get_result", "type": "function", "loc": [63, 64], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99833:ClassDef_L54_C0", "vector": [2, 1, 0.3038, 0.0096, 1, 0.96, 1.0, 569, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "get_result", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_result(self):\n return '\\n'.join(self._lines)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99833:Return_L64_C8", "label": "return", "type": "return", "loc": [64, 64], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L63_C4", "vector": [13, 2, 0.3062, 0.0048, 2, 0.13, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return '\\n'.join(self._lines)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99833:ClassDef_L67_C0", "label": "_HtmlFormatter", "type": "class", "loc": [67, 97], "level": 0, "parent": null, "vector": [3, 0, 0.3923, 0.1483, 0, 0.66, 0.6364, 356, 0, 5, 0, 0, 121, 0, 20], "semantic": {"name": "_HtmlFormatter", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class _HtmlFormatter(_Formatter):\n _hr_re = re.compile('^-{3,} *$')\n\n def __init__(self):\n self._result = _Formatted()\n self._table = _TableFormatter()\n self._line_formatter = _LineFormatter()\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99833:Assign_L68_C4", "label": "_hr_re = compile()", "type": "assigned_variable", "loc": [68, 68], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99833:ClassDef_L67_C0", "vector": [14, 1, 0.3254, 0.0048, 1, 0.36, 0.0, 94, 3, 1, 0, 0, 821, 10, 1], "semantic": {"name": "_hr_re", "arg_names": [], "import_names": [], "rhs_call_name": "compile", "annotation": ""}, "snippet": " _hr_re = re.compile('^-{3,} *$')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L70_C4", "label": "__init__", "type": "function", "loc": [70, 73], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99833:ClassDef_L67_C0", "vector": [2, 1, 0.3421, 0.0191, 1, 0.36, 0.2, 555, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "__init__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self):\n self._result = _Formatted()\n self._table = _TableFormatter()\n self._line_formatter = _LineFormatter()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99833:Assign_L71_C8", "label": "self._result = _Formatted()", "type": "assigned_variable", "loc": [71, 71], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L70_C4", "vector": [14, 2, 0.3397, 0.0048, 2, 0.14, 0.0, 48, 3, 0, 0, 0, 969, 10, 1], "semantic": {"name": "self._result", "arg_names": [], "import_names": [], "rhs_call_name": "_Formatted", "annotation": ""}, "snippet": " self._result = _Formatted()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99833:Assign_L72_C8", "label": "self._table = _TableFormatter()", "type": "assigned_variable", "loc": [72, 72], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L70_C4", "vector": [14, 2, 0.3445, 0.0048, 2, 0.14, 0.5, 840, 3, 0, 0, 0, 198, 10, 1], "semantic": {"name": "self._table", "arg_names": [], "import_names": [], "rhs_call_name": "_TableFormatter", "annotation": ""}, "snippet": " self._table = _TableFormatter()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99833:Assign_L73_C8", "label": "self._line_formatter = _LineFormatter()", "type": "assigned_variable", "loc": [73, 73], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L70_C4", "vector": [14, 2, 0.3493, 0.0048, 2, 0.14, 1.0, 810, 3, 0, 0, 0, 332, 10, 1], "semantic": {"name": "self._line_formatter", "arg_names": [], "import_names": [], "rhs_call_name": "_LineFormatter", "annotation": ""}, "snippet": " self._line_formatter = _LineFormatter()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L75_C4", "label": "add_line", "type": "function", "loc": [75, 83], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99833:ClassDef_L67_C0", "vector": [2, 1, 0.378, 0.0431, 1, 0.36, 0.4, 474, 0, 2, 0, 0, 0, 0, 8], "semantic": {"name": "add_line", "arg_names": ["self", "line"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def add_line(self, line):\n if self._add_table_row(line):\n return\n if self._table.is_started():\n self._result.add(self._table.end(), join_after=False)\n if self._is_hr(line):\n self._result.add('<hr />\\n', join_after=False)\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99833:If_L76_C8", "label": "if", "type": "if", "loc": [76, 77], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L75_C4", "vector": [4, 2, 0.366, 0.0096, 2, 0.97, 0.0, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self._add_table_row(line):\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99833:Return_L77_C12", "label": "return", "type": "return", "loc": [77, 77], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99833:If_L76_C8", "vector": [13, 3, 0.3684, 0.0048, 3, 0.81, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99833:If_L78_C8", "label": "if", "type": "if", "loc": [78, 79], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L75_C4", "vector": [4, 2, 0.3756, 0.0096, 2, 0.97, 0.3333, 0, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self._table.is_started():\n self._result.add(self._table.end(), join_after=False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99833:Expr_L79_C12", "label": "add()", "type": "expression", "loc": [79, 79], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99833:If_L78_C8", "vector": [8, 3, 0.378, 0.0048, 3, 0.32, 0.0, 241, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " self._result.add(self._table.end(), join_after=False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99833:If_L80_C8", "label": "if", "type": "if", "loc": [80, 82], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L75_C4", "vector": [4, 2, 0.3876, 0.0144, 2, 0.97, 0.6667, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self._is_hr(line):\n self._result.add('<hr />\\n', join_after=False)\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99833:Expr_L81_C12", "label": "add()", "type": "expression", "loc": [81, 81], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99833:If_L80_C8", "vector": [8, 3, 0.3876, 0.0048, 3, 0.8, 0.0, 241, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " self._result.add('<hr />\\n', join_after=False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99833:Return_L82_C12", "label": "return", "type": "return", "loc": [82, 82], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99833:If_L80_C8", "vector": [13, 3, 0.3923, 0.0048, 3, 0.8, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99833:Expr_L83_C8", "label": "add()", "type": "expression", "loc": [83, 83], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L75_C4", "vector": [8, 2, 0.3971, 0.0048, 2, 0.97, 1.0, 241, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " self._result.add(self._line_formatter.format(line))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L85_C4", "label": "_add_table_row", "type": "function", "loc": [85, 89], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99833:ClassDef_L67_C0", "vector": [2, 1, 0.4163, 0.0239, 1, 0.36, 0.6, 876, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "_add_table_row", "arg_names": ["self", "row"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _add_table_row(self, row):\n if self._table.is_table_row(row):\n self._table.add_row(row)\n return True\n return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99833:If_L86_C8", "label": "if", "type": "if", "loc": [86, 88], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L85_C4", "vector": [4, 2, 0.4163, 0.0144, 2, 0.74, 0.0, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self._table.is_table_row(row):\n self._table.add_row(row)\n return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99833:Expr_L87_C12", "label": "add_row()", "type": "expression", "loc": [87, 87], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99833:If_L86_C8", "vector": [8, 3, 0.4163, 0.0048, 3, 0.44, 0.0, 141, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "add_row", "arg_names": [], "import_names": [], "rhs_call_name": "add_row", "annotation": ""}, "snippet": " self._table.add_row(row)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99833:Return_L88_C12", "label": "return", "type": "return", "loc": [88, 88], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99833:If_L86_C8", "vector": [13, 3, 0.4211, 0.0048, 3, 0.44, 1.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99833:Return_L89_C8", "label": "return", "type": "return", "loc": [89, 89], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L85_C4", "vector": [13, 2, 0.4258, 0.0048, 2, 0.74, 1.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L91_C4", "label": "_is_hr", "type": "function", "loc": [91, 92], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99833:ClassDef_L67_C0", "vector": [2, 1, 0.4378, 0.0096, 1, 0.36, 0.8, 434, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "_is_hr", "arg_names": ["self", "line"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _is_hr(self, line):\n return bool(self._hr_re.match(line))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99833:Return_L92_C8", "label": "return", "type": "return", "loc": [92, 92], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L91_C4", "vector": [13, 2, 0.4402, 0.0048, 2, 0.32, 0.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return bool(self._hr_re.match(line))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L94_C4", "label": "get_result", "type": "function", "loc": [94, 97], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99833:ClassDef_L67_C0", "vector": [2, 1, 0.4569, 0.0191, 1, 0.36, 1.0, 569, 0, 1, 1, 0, 0, 0, 4], "semantic": {"name": "get_result", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_result(self):\n if self._table.is_started():\n self._result.add(self._table.end())\n return self._result.get_result()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99833:If_L95_C8", "label": "if", "type": "if", "loc": [95, 96], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L94_C4", "vector": [4, 2, 0.4569, 0.0096, 2, 0.25, 0.0, 0, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self._table.is_started():\n self._result.add(self._table.end())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99833:Expr_L96_C12", "label": "add()", "type": "expression", "loc": [96, 96], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99833:If_L95_C8", "vector": [8, 3, 0.4593, 0.0048, 3, 0.48, 0.0, 241, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " self._result.add(self._table.end())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99833:Return_L97_C8", "label": "return", "type": "return", "loc": [97, 97], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L94_C4", "vector": [13, 2, 0.4641, 0.0048, 2, 0.25, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._result.get_result()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99833:ClassDef_L100_C0", "label": "_Formatted", "type": "class", "loc": [100, 111], "level": 0, "parent": null, "vector": [3, 0, 0.5048, 0.0574, 0, 0.66, 0.7273, 969, 0, 3, 0, 0, 186, 0, 2], "semantic": {"name": "_Formatted", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class _Formatted(object):\n\n def __init__(self):\n self._result = []\n self._joiner = ''\n\n def add(self, line, join_after=True):\n self._result.extend([self._joiner, line])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L102_C4", "label": "__init__", "type": "function", "loc": [102, 104], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99833:ClassDef_L100_C0", "vector": [2, 1, 0.4928, 0.0144, 1, 0.54, 0.0, 555, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self):\n self._result = []\n self._joiner = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99833:Assign_L103_C8", "label": "self._result =", "type": "assigned_variable", "loc": [103, 103], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L102_C4", "vector": [14, 2, 0.4928, 0.0048, 2, 0.74, 0.0, 48, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self._result", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._result = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99833:Assign_L104_C8", "label": "self._joiner =", "type": "assigned_variable", "loc": [104, 104], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L102_C4", "vector": [14, 2, 0.4976, 0.0048, 2, 0.74, 1.0, 910, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "self._joiner", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._joiner = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L106_C4", "label": "add", "type": "function", "loc": [106, 108], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99833:ClassDef_L100_C0", "vector": [2, 1, 0.512, 0.0144, 1, 0.54, 0.5, 241, 0, 3, 0, 0, 0, 0, 1], "semantic": {"name": "add", "arg_names": ["self", "line", "join_after"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def add(self, line, join_after=True):\n self._result.extend([self._joiner, line])\n self._joiner = '\\n' if join_after else ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99833:Expr_L107_C8", "label": "extend()", "type": "expression", "loc": [107, 107], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L106_C4", "vector": [8, 2, 0.512, 0.0048, 2, 0.71, 0.0, 660, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "extend", "arg_names": [], "import_names": [], "rhs_call_name": "extend", "annotation": ""}, "snippet": " self._result.extend([self._joiner, line])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99833:Assign_L108_C8", "label": "self._joiner =", "type": "assigned_variable", "loc": [108, 108], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L106_C4", "vector": [14, 2, 0.5167, 0.0048, 2, 0.71, 1.0, 910, 8, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._joiner", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._joiner = '\\n' if join_after else ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L110_C4", "label": "get_result", "type": "function", "loc": [110, 111], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99833:ClassDef_L100_C0", "vector": [2, 1, 0.5287, 0.0096, 1, 0.54, 1.0, 569, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "get_result", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_result(self):\n return ''.join(self._result)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99833:Return_L111_C8", "label": "return", "type": "return", "loc": [111, 111], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L110_C4", "vector": [13, 2, 0.5311, 0.0048, 2, 0.81, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ''.join(self._result)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99833:ClassDef_L114_C0", "label": "_UrlFormatter", "type": "class", "loc": [114, 139], "level": 0, "parent": null, "vector": [3, 0, 0.6053, 0.1244, 0, 0.66, 0.8182, 721, 0, 4, 0, 0, 186, 0, 9], "semantic": {"name": "_UrlFormatter", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class _UrlFormatter(object):\n _formatting = False\n _image_exts = ('.jpg', '.jpeg', '.png', '.gif', '.bmp')\n _url = re.compile('''\n( (^|\\ ) [\"'([]* ) # begin of line or space and opt. any char \"'([\n(\\w{3,9}://[\\S]+?) # url (protocol is any alphanum 3-9 long string)\n(?= [])\"'.,!?:;]* ($|\\ ) ) # opt. any char ])\"'.,!?:; and end of line or space\n''', re.VERBOSE)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99833:Assign_L115_C4", "label": "_formatting =", "type": "assigned_variable", "loc": [115, 115], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99833:ClassDef_L114_C0", "vector": [14, 1, 0.5502, 0.0048, 1, 0.17, 0.0, 711, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "_formatting", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " _formatting = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99833:Assign_L116_C4", "label": "_image_exts =", "type": "assigned_variable", "loc": [116, 116], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99833:ClassDef_L114_C0", "vector": [14, 1, 0.555, 0.0048, 1, 0.17, 0.1667, 673, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "_image_exts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " _image_exts = ('.jpg', '.jpeg', '.png', '.gif', '.bmp')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99833:Assign_L117_C4", "label": "_url = compile()", "type": "assigned_variable", "loc": [117, 121], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99833:ClassDef_L114_C0", "vector": [14, 1, 0.5694, 0.0239, 1, 0.17, 0.3333, 508, 3, 2, 0, 0, 821, 10, 1], "semantic": {"name": "_url", "arg_names": [], "import_names": [], "rhs_call_name": "compile", "annotation": ""}, "snippet": " _url = re.compile('''\n( (^|\\ ) [\"'([]* ) # begin of line or space and opt. any char \"'([\n(\\w{3,9}://[\\S]+?) # url (protocol is any alphanum 3-9 long string)\n(?= [])\"'.,!?:;]* ($|\\ ) ) # opt. any char ])\"'.,!?:; and end of line or space\n''', re.VERBOSE)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L123_C4", "label": "format", "type": "function", "loc": [123, 124], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99833:ClassDef_L114_C0", "vector": [2, 1, 0.5909, 0.0096, 1, 0.17, 0.5, 293, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "format", "arg_names": ["self", "line"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def format(self, line):\n return self._format_url(line)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99833:Return_L124_C8", "label": "return", "type": "return", "loc": [124, 124], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L123_C4", "vector": [13, 2, 0.5933, 0.0048, 2, 0.57, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._format_url(line)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L126_C4", "label": "_format_url", "type": "function", "loc": [126, 127], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99833:ClassDef_L114_C0", "vector": [2, 1, 0.6053, 0.0096, 1, 0.17, 0.6667, 934, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "_format_url", "arg_names": ["self", "line"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _format_url(self, line):\n return self._url.sub(self._repl_url, line) if ':' in line else line"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99833:Return_L127_C8", "label": "return", "type": "return", "loc": [127, 127], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L126_C4", "vector": [13, 2, 0.6077, 0.0048, 2, 0.9, 0.0, 0, 8, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._url.sub(self._repl_url, line) if ':' in line else line"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L129_C4", "label": "_repl_url", "type": "function", "loc": [129, 136], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99833:ClassDef_L114_C0", "vector": [2, 1, 0.634, 0.0383, 1, 0.17, 0.8333, 534, 0, 2, 1, 0, 0, 0, 4], "semantic": {"name": "_repl_url", "arg_names": ["self", "match"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _repl_url(self, match):\n pre = match.group(1)\n url = match.group(3).replace('\"', '"')\n if self._format_as_image(url):\n tmpl = '<img src=\"%s\" title=\"%s\" style=\"border: 1px solid gray\" />'\n else:\n tmpl = '<a href=\"%s\">%s</a>'\n return pre + tmpl % (url, url)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99833:Assign_L130_C8", "label": "pre = group()", "type": "assigned_variable", "loc": [130, 130], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L129_C4", "vector": [14, 2, 0.622, 0.0048, 2, 0.62, 0.0, 793, 3, 1, 0, 0, 43, 10, 1], "semantic": {"name": "pre", "arg_names": [], "import_names": [], "rhs_call_name": "group", "annotation": ""}, "snippet": " pre = match.group(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99833:Assign_L131_C8", "label": "url = replace()", "type": "assigned_variable", "loc": [131, 131], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L129_C4", "vector": [14, 2, 0.6268, 0.0048, 2, 0.62, 0.3333, 789, 3, 2, 0, 0, 293, 10, 2], "semantic": {"name": "url", "arg_names": [], "import_names": [], "rhs_call_name": "replace", "annotation": ""}, "snippet": " url = match.group(3).replace('\"', '"')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99833:If_L132_C8", "label": "if", "type": "if", "loc": [132, 135], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L129_C4", "vector": [4, 2, 0.6388, 0.0191, 2, 0.62, 0.6667, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self._format_as_image(url):\n tmpl = '<img src=\"%s\" title=\"%s\" style=\"border: 1px solid gray\" />'\n else:\n tmpl = '<a href=\"%s\">%s</a>'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99833:Assign_L133_C12", "label": "tmpl =", "type": "assigned_variable", "loc": [133, 133], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99833:If_L132_C8", "vector": [14, 3, 0.6364, 0.0048, 3, 0.41, 0.0, 407, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "tmpl", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tmpl = '<img src=\"%s\" title=\"%s\" style=\"border: 1px solid gray\" />'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99833:Assign_L135_C12", "label": "tmpl =", "type": "assigned_variable", "loc": [135, 135], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99833:If_L132_C8", "vector": [14, 3, 0.6459, 0.0048, 3, 0.41, 1.0, 407, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "tmpl", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tmpl = '<a href=\"%s\">%s</a>'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99833:Return_L136_C8", "label": "return", "type": "return", "loc": [136, 136], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L129_C4", "vector": [13, 2, 0.6507, 0.0048, 2, 0.62, 1.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return pre + tmpl % (url, url)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L138_C4", "label": "_format_as_image", "type": "function", "loc": [138, 139], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99833:ClassDef_L114_C0", "vector": [2, 1, 0.6627, 0.0096, 1, 0.17, 1.0, 331, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "_format_as_image", "arg_names": ["self", "url"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _format_as_image(self, url):\n return self._formatting and url.lower().endswith(self._image_exts)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99833:Return_L139_C8", "label": "return", "type": "return", "loc": [139, 139], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L138_C4", "vector": [13, 2, 0.6651, 0.0048, 2, 0.7, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._formatting and url.lower().endswith(self._image_exts)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99833:ClassDef_L142_C0", "label": "_LineFormatter", "type": "class", "loc": [142, 172], "level": 0, "parent": null, "vector": [3, 0, 0.7512, 0.1483, 0, 0.66, 0.9091, 332, 0, 3, 0, 0, 721, 0, 7], "semantic": {"name": "_LineFormatter", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class _LineFormatter(_UrlFormatter):\n _formatting = True\n _bold = re.compile('''\n( # prefix (group 1)\n (^|\\ ) # begin of line or space\n [\"'(]* _? # optionally any char \"'( and optional begin of italic\n) #\n\\* # start of bold"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99833:Assign_L143_C4", "label": "_formatting =", "type": "assigned_variable", "loc": [143, 143], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99833:ClassDef_L142_C0", "vector": [14, 1, 0.6842, 0.0048, 1, 0.62, 0.0, 711, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "_formatting", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " _formatting = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99833:Assign_L144_C4", "label": "_bold = compile()", "type": "assigned_variable", "loc": [144, 156], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99833:ClassDef_L142_C0", "vector": [14, 1, 0.7177, 0.0622, 1, 0.62, 0.2, 541, 3, 2, 0, 0, 821, 10, 1], "semantic": {"name": "_bold", "arg_names": [], "import_names": [], "rhs_call_name": "compile", "annotation": ""}, "snippet": " _bold = re.compile('''\n( # prefix (group 1)\n (^|\\ ) # begin of line or space\n [\"'(]* _? # optionally any char \"'( and optional begin of italic\n) #\n\\* # start of bold\n([^\\ ].*?) # no space and then anything (group 3)\n\\* # end of bold"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99833:Assign_L157_C4", "label": "_italic = compile()", "type": "assigned_variable", "loc": [157, 163], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99833:ClassDef_L142_C0", "vector": [14, 1, 0.7656, 0.0335, 1, 0.62, 0.4, 171, 3, 2, 0, 0, 821, 10, 1], "semantic": {"name": "_italic", "arg_names": [], "import_names": [], "rhs_call_name": "compile", "annotation": ""}, "snippet": " _italic = re.compile('''\n( (^|\\ ) [\"'(]* ) # begin of line or space and opt. any char \"'(\n_ # start of italic\n([^\\ _].*?) # no space or underline and then anything\n_ # end of italic\n(?= [\"').,!?:;]* ($|\\ ) ) # opt. any char \"').,!?:; and end of line or space\n''', re.VERBOSE)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L165_C4", "label": "format", "type": "function", "loc": [165, 166], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99833:ClassDef_L142_C0", "vector": [2, 1, 0.7919, 0.0096, 1, 0.62, 0.6, 293, 0, 2, 1, 0, 0, 0, 3], "semantic": {"name": "format", "arg_names": ["self", "line"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def format(self, line):\n return self._format_url(self._format_italic(self._format_bold(line)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99833:Return_L166_C8", "label": "return", "type": "return", "loc": [166, 166], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L165_C4", "vector": [13, 2, 0.7943, 0.0048, 2, 0.6, 0.0, 0, 3, 0, 0, 0, 0, 10, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._format_url(self._format_italic(self._format_bold(line)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L168_C4", "label": "_format_bold", "type": "function", "loc": [168, 169], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99833:ClassDef_L142_C0", "vector": [2, 1, 0.8062, 0.0096, 1, 0.62, 0.8, 858, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "_format_bold", "arg_names": ["self", "line"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _format_bold(self, line):\n return self._bold.sub('\\\\1<b>\\\\3</b>', line) if '*' in line else line"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99833:Return_L169_C8", "label": "return", "type": "return", "loc": [169, 169], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L168_C4", "vector": [13, 2, 0.8086, 0.0048, 2, 0.17, 0.0, 0, 8, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._bold.sub('\\\\1<b>\\\\3</b>', line) if '*' in line else line"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L171_C4", "label": "_format_italic", "type": "function", "loc": [171, 172], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99833:ClassDef_L142_C0", "vector": [2, 1, 0.8206, 0.0096, 1, 0.62, 1.0, 42, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "_format_italic", "arg_names": ["self", "line"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _format_italic(self, line):\n return self._italic.sub('\\\\1<i>\\\\3</i>', line) if '_' in line else line"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99833:Return_L172_C8", "label": "return", "type": "return", "loc": [172, 172], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L171_C4", "vector": [13, 2, 0.823, 0.0048, 2, 0.26, 0.0, 0, 8, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._italic.sub('\\\\1<i>\\\\3</i>', line) if '_' in line else line"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99833:ClassDef_L175_C0", "label": "_TableFormatter", "type": "class", "loc": [175, 209], "level": 0, "parent": null, "vector": [3, 0, 0.9187, 0.1675, 0, 0.66, 1.0, 198, 0, 6, 0, 0, 186, 0, 20], "semantic": {"name": "_TableFormatter", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class _TableFormatter(object):\n _is_table_line = re.compile('^\\s*\\| (.* |)\\|\\s*$')\n _line_splitter = re.compile(' \\|(?= )')\n\n def __init__(self):\n self._rows = []\n self._line_formatter = _LineFormatter()\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99833:Assign_L176_C4", "label": "_is_table_line = compile()", "type": "assigned_variable", "loc": [176, 176], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99833:ClassDef_L175_C0", "vector": [14, 1, 0.8421, 0.0048, 1, 0.36, 0.0, 881, 3, 1, 0, 0, 821, 10, 1], "semantic": {"name": "_is_table_line", "arg_names": [], "import_names": [], "rhs_call_name": "compile", "annotation": ""}, "snippet": " _is_table_line = re.compile('^\\s*\\| (.* |)\\|\\s*$')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99833:Assign_L177_C4", "label": "_line_splitter = compile()", "type": "assigned_variable", "loc": [177, 177], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99833:ClassDef_L175_C0", "vector": [14, 1, 0.8469, 0.0048, 1, 0.36, 0.1429, 620, 3, 1, 0, 0, 821, 10, 1], "semantic": {"name": "_line_splitter", "arg_names": [], "import_names": [], "rhs_call_name": "compile", "annotation": ""}, "snippet": " _line_splitter = re.compile(' \\|(?= )')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L179_C4", "label": "__init__", "type": "function", "loc": [179, 181], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99833:ClassDef_L175_C0", "vector": [2, 1, 0.8612, 0.0144, 1, 0.36, 0.2857, 555, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self):\n self._rows = []\n self._line_formatter = _LineFormatter()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99833:Assign_L180_C8", "label": "self._rows =", "type": "assigned_variable", "loc": [180, 180], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L179_C4", "vector": [14, 2, 0.8612, 0.0048, 2, 0.82, 0.0, 824, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self._rows", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._rows = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99833:Assign_L181_C8", "label": "self._line_formatter = _LineFormatter()", "type": "assigned_variable", "loc": [181, 181], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L179_C4", "vector": [14, 2, 0.866, 0.0048, 2, 0.82, 1.0, 810, 3, 0, 0, 0, 332, 10, 1], "semantic": {"name": "self._line_formatter", "arg_names": [], "import_names": [], "rhs_call_name": "_LineFormatter", "annotation": ""}, "snippet": " self._line_formatter = _LineFormatter()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L183_C4", "label": "is_table_row", "type": "function", "loc": [183, 184], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99833:ClassDef_L175_C0", "vector": [2, 1, 0.878, 0.0096, 1, 0.36, 0.4286, 243, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "is_table_row", "arg_names": ["self", "row"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def is_table_row(self, row):\n return bool(self._is_table_line.match(row))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99833:Return_L184_C8", "label": "return", "type": "return", "loc": [184, 184], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L183_C4", "vector": [13, 2, 0.8804, 0.0048, 2, 0.74, 0.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return bool(self._is_table_line.match(row))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L186_C4", "label": "is_started", "type": "function", "loc": [186, 187], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99833:ClassDef_L175_C0", "vector": [2, 1, 0.8923, 0.0096, 1, 0.36, 0.5714, 143, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "is_started", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def is_started(self):\n return bool(self._rows)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99833:Return_L187_C8", "label": "return", "type": "return", "loc": [187, 187], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L186_C4", "vector": [13, 2, 0.8947, 0.0048, 2, 0.19, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return bool(self._rows)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L189_C4", "label": "add_row", "type": "function", "loc": [189, 192], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99833:ClassDef_L175_C0", "vector": [2, 1, 0.9115, 0.0191, 1, 0.36, 0.7143, 141, 0, 2, 0, 0, 0, 0, 4], "semantic": {"name": "add_row", "arg_names": ["self", "text"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def add_row(self, text):\n text = text.strip()[1:-1] # remove outer whitespace and pipes\n cells = [cell.strip() for cell in self._line_splitter.split(text)]\n self._rows.append(cells)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99833:Assign_L190_C8", "label": "text =", "type": "assigned_variable", "loc": [190, 190], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L189_C4", "vector": [14, 2, 0.9091, 0.0048, 2, 0.31, 0.0, 439, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "text", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " text = text.strip()[1:-1] # remove outer whitespace and pipes"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99833:Assign_L191_C8", "label": "cells =", "type": "assigned_variable", "loc": [191, 191], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L189_C4", "vector": [14, 2, 0.9139, 0.0048, 2, 0.31, 0.5, 757, 5, 0, 0, 0, 0, 0, 2], "semantic": {"name": "cells", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cells = [cell.strip() for cell in self._line_splitter.split(text)]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99833:Expr_L192_C8", "label": "append()", "type": "expression", "loc": [192, 192], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L189_C4", "vector": [8, 2, 0.9187, 0.0048, 2, 0.31, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self._rows.append(cells)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L194_C4", "label": "end", "type": "function", "loc": [194, 197], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99833:ClassDef_L175_C0", "vector": [2, 1, 0.9354, 0.0191, 1, 0.36, 0.8571, 128, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "end", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def end(self):\n ret = self._format_table(self._rows)\n self._rows = []\n return ret"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99833:Assign_L195_C8", "label": "ret = _format_table()", "type": "assigned_variable", "loc": [195, 195], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L194_C4", "vector": [14, 2, 0.933, 0.0048, 2, 0.05, 0.0, 501, 3, 1, 0, 0, 246, 10, 1], "semantic": {"name": "ret", "arg_names": [], "import_names": [], "rhs_call_name": "_format_table", "annotation": ""}, "snippet": " ret = self._format_table(self._rows)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99833:Assign_L196_C8", "label": "self._rows =", "type": "assigned_variable", "loc": [196, 196], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L194_C4", "vector": [14, 2, 0.9378, 0.0048, 2, 0.05, 0.5, 824, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self._rows", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._rows = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99833:Return_L197_C8", "label": "return", "type": "return", "loc": [197, 197], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L194_C4", "vector": [13, 2, 0.9426, 0.0048, 2, 0.05, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ret"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L199_C4", "label": "_format_table", "type": "function", "loc": [199, 209], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99833:ClassDef_L175_C0", "vector": [2, 1, 0.9761, 0.0526, 1, 0.36, 1.0, 246, 0, 2, 1, 0, 0, 0, 9], "semantic": {"name": "_format_table", "arg_names": ["self", "rows"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _format_table(self, rows):\n maxlen = max(len(row) for row in rows)\n table = ['<table border=\"1\" class=\"doc\">']\n for row in rows:\n row += [''] * (maxlen - len(row)) # fix ragged tables\n table.append('<tr>')\n table.extend(['<td>%s</td>' % self._line_formatter.format(cell)\n for cell in row])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99833:Assign_L200_C8", "label": "maxlen = max()", "type": "assigned_variable", "loc": [200, 200], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L199_C4", "vector": [14, 2, 0.9569, 0.0048, 2, 0.28, 0.0, 529, 3, 1, 0, 0, 442, 10, 2], "semantic": {"name": "maxlen", "arg_names": [], "import_names": [], "rhs_call_name": "max", "annotation": ""}, "snippet": " maxlen = max(len(row) for row in rows)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99833:Assign_L201_C8", "label": "table =", "type": "assigned_variable", "loc": [201, 201], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L199_C4", "vector": [14, 2, 0.9617, 0.0048, 2, 0.28, 0.25, 338, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "table", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " table = ['<table border=\"1\" class=\"doc\">']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99833:For_L202_C8", "label": "for row", "type": "for", "loc": [202, 207], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L199_C4", "vector": [6, 2, 0.9785, 0.0287, 2, 0.28, 0.5, 767, 2, 0, 0, 0, 0, 0, 5], "semantic": {"name": "row", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for row in rows:\n row += [''] * (maxlen - len(row)) # fix ragged tables\n table.append('<tr>')\n table.extend(['<td>%s</td>' % self._line_formatter.format(cell)\n for cell in row])\n table.append('</tr>')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99833:Expr_L204_C12", "label": "append()", "type": "expression", "loc": [204, 204], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99833:For_L202_C8", "vector": [8, 3, 0.9761, 0.0048, 3, 0.7, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " table.append('<tr>')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99833:Expr_L205_C12", "label": "extend()", "type": "expression", "loc": [205, 206], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99833:For_L202_C8", "vector": [8, 3, 0.9833, 0.0096, 3, 0.7, 0.5, 660, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "extend", "arg_names": [], "import_names": [], "rhs_call_name": "extend", "annotation": ""}, "snippet": " table.extend(['<td>%s</td>' % self._line_formatter.format(cell)\n for cell in row])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99833:Expr_L207_C12", "label": "append()", "type": "expression", "loc": [207, 207], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99833:For_L202_C8", "vector": [8, 3, 0.9904, 0.0048, 3, 0.7, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " table.append('</tr>')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99833:Expr_L208_C8", "label": "append()", "type": "expression", "loc": [208, 208], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L199_C4", "vector": [8, 2, 0.9952, 0.0048, 2, 0.28, 0.75, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " table.append('</table>\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99833:Return_L209_C8", "label": "return", "type": "return", "loc": [209, 209], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L199_C4", "vector": [13, 2, 1.0, 0.0048, 2, 0.28, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return '\\n'.join(table)"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99833:If_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99833:If_L22_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99833:Return_L23_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99833:Return_L24_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99833:Return_L28_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L31_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99833:For_L32_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99833:For_L32_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99833:Assign_L34_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L31_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99833:For_L35_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99833:For_L35_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99833:Assign_L36_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L31_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99833:Return_L37_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99833:ClassDef_L40_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L42_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99833:Assign_L43_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99833:For_L44_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99833:For_L44_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99833:Expr_L45_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99833:Return_L46_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99833:ClassDef_L40_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L48_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L48_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99833:For_L49_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99833:For_L49_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99833:Assign_L50_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L48_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99833:Return_L51_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99833:ClassDef_L54_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L56_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L56_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99833:Assign_L57_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L56_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99833:Assign_L58_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99833:ClassDef_L54_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L60_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L60_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99833:Expr_L61_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99833:ClassDef_L54_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L63_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99833:Return_L64_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99833:ClassDef_L67_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99833:Assign_L68_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99833:ClassDef_L67_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L70_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L70_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99833:Assign_L71_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L70_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99833:Assign_L72_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L70_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99833:Assign_L73_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99833:ClassDef_L67_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L75_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L75_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99833:If_L76_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99833:If_L76_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99833:Return_L77_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L75_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99833:If_L78_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99833:If_L78_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99833:Expr_L79_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L75_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99833:If_L80_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99833:If_L80_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99833:Expr_L81_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99833:If_L80_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99833:Return_L82_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L75_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99833:Expr_L83_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99833:ClassDef_L67_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L85_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L85_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99833:If_L86_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99833:If_L86_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99833:Expr_L87_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99833:If_L86_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99833:Return_L88_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L85_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99833:Return_L89_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99833:ClassDef_L67_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L91_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L91_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99833:Return_L92_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99833:ClassDef_L67_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L94_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L94_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99833:If_L95_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99833:If_L95_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99833:Expr_L96_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L94_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99833:Return_L97_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99833:ClassDef_L100_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L102_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L102_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99833:Assign_L103_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L102_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99833:Assign_L104_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99833:ClassDef_L100_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L106_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L106_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99833:Expr_L107_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L106_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99833:Assign_L108_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99833:ClassDef_L100_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L110_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L110_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99833:Return_L111_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99833:ClassDef_L114_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99833:Assign_L115_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99833:ClassDef_L114_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99833:Assign_L116_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99833:ClassDef_L114_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99833:Assign_L117_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99833:ClassDef_L114_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L123_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L123_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99833:Return_L124_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99833:ClassDef_L114_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L126_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L126_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99833:Return_L127_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99833:ClassDef_L114_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L129_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L129_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99833:Assign_L130_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L129_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99833:Assign_L131_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L129_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99833:If_L132_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99833:If_L132_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99833:Assign_L133_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99833:If_L132_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99833:Assign_L135_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L129_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99833:Return_L136_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99833:ClassDef_L114_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L138_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L138_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99833:Return_L139_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99833:ClassDef_L142_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99833:Assign_L143_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99833:ClassDef_L142_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99833:Assign_L144_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99833:ClassDef_L142_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99833:Assign_L157_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99833:ClassDef_L142_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L165_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L165_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99833:Return_L166_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99833:ClassDef_L142_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L168_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L168_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99833:Return_L169_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99833:ClassDef_L142_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L171_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L171_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99833:Return_L172_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99833:ClassDef_L175_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99833:Assign_L176_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99833:ClassDef_L175_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99833:Assign_L177_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99833:ClassDef_L175_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L179_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L179_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99833:Assign_L180_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L179_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99833:Assign_L181_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99833:ClassDef_L175_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L183_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L183_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99833:Return_L184_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99833:ClassDef_L175_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L186_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L186_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99833:Return_L187_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99833:ClassDef_L175_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L189_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L189_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99833:Assign_L190_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L189_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99833:Assign_L191_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L189_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99833:Expr_L192_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99833:ClassDef_L175_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L194_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L194_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99833:Assign_L195_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L194_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99833:Assign_L196_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L194_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99833:Return_L197_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99833:ClassDef_L175_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L199_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L199_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99833:Assign_L200_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L199_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99833:Assign_L201_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L199_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99833:For_L202_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99833:For_L202_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99833:Expr_L204_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99833:For_L202_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99833:Expr_L205_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99833:For_L202_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99833:Expr_L207_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L199_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99833:Expr_L208_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99833:FunctionDef_L199_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99833:Return_L209_C8"}] |
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import sys
import os
from unic import unic
def decode_output(string):
"""Decodes string from console encoding to Unicode."""
if _output_encoding:
return unic(string, _output_encoding)
return string
def encode_output(string, errors='replace'):
"""Encodes string from Unicode to console encoding."""
# http://ironpython.codeplex.com/workitem/29487
if sys.platform == 'cli':
return string
return string.encode(_output_encoding, errors)
def decode_from_file_system(string):
"""Decodes path from file system to Unicode."""
encoding = sys.getfilesystemencoding()
if sys.platform.startswith('java'):
# http://bugs.jython.org/issue1592
from java.lang import String
string = String(string)
return unic(string, encoding) if encoding else unic(string)
def _get_output_encoding():
# Jython is buggy on Windows: http://bugs.jython.org/issue1568
if os.sep == '\\' and sys.platform.startswith('java'):
return 'cp437' # Default DOS encoding
encoding = _get_encoding_from_std_streams()
if encoding:
return encoding
if os.sep == '/':
return _read_encoding_from_unix_env()
return 'cp437' # Default DOS encoding
def _get_encoding_from_std_streams():
# Stream may not have encoding attribute if it is intercepted outside RF
# in Python. Encoding is None if process's outputs are redirected.
return getattr(sys.__stdout__, 'encoding', None) \
or getattr(sys.__stderr__, 'encoding', None) \
or getattr(sys.__stdin__, 'encoding', None)
def _read_encoding_from_unix_env():
for name in 'LANG', 'LC_CTYPE', 'LANGUAGE', 'LC_ALL':
try:
# Encoding can be in format like `UTF-8` or `en_US.UTF-8`
encoding = os.environ[name].split('.')[-1]
'testing that encoding is valid'.encode(encoding)
except (KeyError, LookupError):
pass
else:
return encoding
return 'ascii'
_output_encoding = _get_output_encoding()
| ajibawa-2023/Python-Code-Large/train/row_99834 | 39 | 74 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99834:Import_L15_C0", "label": "sys import sys", "type": "import", "loc": [15, 15], "level": 0, "parent": null, "vector": [1, 0, 0.2027, 0.0135, 0, 0.66, 0.0, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sys"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99834:Import_L16_C0", "label": "os import os", "type": "import", "loc": [16, 16], "level": 0, "parent": null, "vector": [1, 0, 0.2162, 0.0135, 0, 0.66, 0.1111, 688, 0, 1, 0, 0, 688, 0, 0], "semantic": {"name": "os", "arg_names": [], "import_names": ["os"], "rhs_call_name": "", "annotation": ""}, "snippet": "import os"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99834:ImportFrom_L18_C0", "label": "from unic import unic", "type": "import", "loc": [18, 18], "level": 0, "parent": null, "vector": [1, 0, 0.2432, 0.0135, 0, 0.66, 0.2222, 992, 0, 1, 0, 0, 992, 0, 0], "semantic": {"name": "unic", "arg_names": [], "import_names": ["unic"], "rhs_call_name": "", "annotation": ""}, "snippet": "from unic import unic"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99834:FunctionDef_L21_C0", "label": "decode_output", "type": "function", "loc": [21, 25], "level": 0, "parent": null, "vector": [2, 0, 0.3108, 0.0676, 0, 0.66, 0.3333, 794, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "decode_output", "arg_names": ["string"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def decode_output(string):\n \"\"\"Decodes string from console encoding to Unicode.\"\"\"\n if _output_encoding:\n return unic(string, _output_encoding)\n return string"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99834:Expr_L22_C4", "label": "expression", "type": "expression", "loc": [22, 22], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99834:FunctionDef_L21_C0", "vector": [8, 1, 0.2973, 0.0135, 1, 0.34, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Decodes string from console encoding to Unicode.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99834:If_L23_C4", "label": "if", "type": "if", "loc": [23, 24], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99834:FunctionDef_L21_C0", "vector": [4, 1, 0.3176, 0.027, 1, 0.34, 0.5, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if _output_encoding:\n return unic(string, _output_encoding)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99834:Return_L24_C8", "label": "return", "type": "return", "loc": [24, 24], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99834:If_L23_C4", "vector": [13, 2, 0.3243, 0.0135, 2, 0.39, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return unic(string, _output_encoding)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99834:Return_L25_C4", "label": "return", "type": "return", "loc": [25, 25], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99834:FunctionDef_L21_C0", "vector": [13, 1, 0.3378, 0.0135, 1, 0.34, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return string"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99834:FunctionDef_L27_C0", "label": "encode_output", "type": "function", "loc": [27, 32], "level": 0, "parent": null, "vector": [2, 0, 0.3986, 0.0811, 0, 0.66, 0.4444, 807, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "encode_output", "arg_names": ["string", "errors"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def encode_output(string, errors='replace'):\n \"\"\"Encodes string from Unicode to console encoding.\"\"\"\n # http://ironpython.codeplex.com/workitem/29487\n if sys.platform == 'cli':\n return string\n return string.encode(_output_encoding, errors)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99834:Expr_L28_C4", "label": "expression", "type": "expression", "loc": [28, 28], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99834:FunctionDef_L27_C0", "vector": [8, 1, 0.3784, 0.0135, 1, 0.08, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Encodes string from Unicode to console encoding.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99834:If_L30_C4", "label": "if", "type": "if", "loc": [30, 31], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99834:FunctionDef_L27_C0", "vector": [4, 1, 0.4122, 0.027, 1, 0.08, 0.5, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if sys.platform == 'cli':\n return string"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99834:Return_L31_C8", "label": "return", "type": "return", "loc": [31, 31], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99834:If_L30_C4", "vector": [13, 2, 0.4189, 0.0135, 2, 0.2, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return string"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99834:Return_L32_C4", "label": "return", "type": "return", "loc": [32, 32], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99834:FunctionDef_L27_C0", "vector": [13, 1, 0.4324, 0.0135, 1, 0.08, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return string.encode(_output_encoding, errors)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99834:FunctionDef_L34_C0", "label": "decode_from_file_system", "type": "function", "loc": [34, 41], "level": 0, "parent": null, "vector": [2, 0, 0.5068, 0.1081, 0, 0.66, 0.5556, 676, 0, 1, 1, 0, 0, 0, 5], "semantic": {"name": "decode_from_file_system", "arg_names": ["string"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def decode_from_file_system(string):\n \"\"\"Decodes path from file system to Unicode.\"\"\"\n encoding = sys.getfilesystemencoding()\n if sys.platform.startswith('java'):\n # http://bugs.jython.org/issue1592\n from java.lang import String\n string = String(string)\n return unic(string, encoding) if encoding else unic(string)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99834:Expr_L35_C4", "label": "expression", "type": "expression", "loc": [35, 35], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99834:FunctionDef_L34_C0", "vector": [8, 1, 0.473, 0.0135, 1, 0.89, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Decodes path from file system to Unicode.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99834:Assign_L36_C4", "label": "encoding = getfilesystemencoding()", "type": "assigned_variable", "loc": [36, 36], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99834:FunctionDef_L34_C0", "vector": [14, 1, 0.4865, 0.0135, 1, 0.89, 0.3333, 325, 3, 0, 0, 0, 196, 10, 1], "semantic": {"name": "encoding", "arg_names": [], "import_names": [], "rhs_call_name": "getfilesystemencoding", "annotation": ""}, "snippet": " encoding = sys.getfilesystemencoding()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99834:If_L37_C4", "label": "if", "type": "if", "loc": [37, 40], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99834:FunctionDef_L34_C0", "vector": [4, 1, 0.5203, 0.0541, 1, 0.89, 0.6667, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if sys.platform.startswith('java'):\n # http://bugs.jython.org/issue1592\n from java.lang import String\n string = String(string)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99834:ImportFrom_L39_C8", "label": "from java.lang import String", "type": "import", "loc": [39, 39], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99834:If_L37_C4", "vector": [1, 2, 0.527, 0.0135, 2, 0.08, 0.0, 100, 0, 1, 0, 0, 100, 0, 0], "semantic": {"name": "java.lang", "arg_names": [], "import_names": ["String"], "rhs_call_name": "", "annotation": ""}, "snippet": " from java.lang import String"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99834:Assign_L40_C8", "label": "string = String()", "type": "assigned_variable", "loc": [40, 40], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99834:If_L37_C4", "vector": [14, 2, 0.5405, 0.0135, 2, 0.08, 1.0, 890, 3, 1, 0, 0, 214, 10, 1], "semantic": {"name": "string", "arg_names": [], "import_names": [], "rhs_call_name": "String", "annotation": ""}, "snippet": " string = String(string)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99834:Return_L41_C4", "label": "return", "type": "return", "loc": [41, 41], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99834:FunctionDef_L34_C0", "vector": [13, 1, 0.5541, 0.0135, 1, 0.89, 1.0, 0, 8, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return unic(string, encoding) if encoding else unic(string)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99834:FunctionDef_L44_C0", "label": "_get_output_encoding", "type": "function", "loc": [44, 53], "level": 0, "parent": null, "vector": [2, 0, 0.6554, 0.1351, 0, 0.66, 0.6667, 193, 0, 0, 1, 0, 0, 0, 3], "semantic": {"name": "_get_output_encoding", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def _get_output_encoding():\n # Jython is buggy on Windows: http://bugs.jython.org/issue1568\n if os.sep == '\\\\' and sys.platform.startswith('java'):\n return 'cp437' # Default DOS encoding\n encoding = _get_encoding_from_std_streams()\n if encoding:\n return encoding\n if os.sep == '/':"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99834:If_L46_C4", "label": "if", "type": "if", "loc": [46, 47], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99834:FunctionDef_L44_C0", "vector": [4, 1, 0.6284, 0.027, 1, 0.13, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if os.sep == '\\\\' and sys.platform.startswith('java'):\n return 'cp437' # Default DOS encoding"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99834:Return_L47_C8", "label": "return", "type": "return", "loc": [47, 47], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99834:If_L46_C4", "vector": [13, 2, 0.6351, 0.0135, 2, 0.24, 0.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 'cp437' # Default DOS encoding"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99834:Assign_L48_C4", "label": "encoding = _get_encoding_from_std_streams()", "type": "assigned_variable", "loc": [48, 48], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99834:FunctionDef_L44_C0", "vector": [14, 1, 0.6486, 0.0135, 1, 0.13, 0.25, 325, 3, 0, 0, 0, 454, 10, 1], "semantic": {"name": "encoding", "arg_names": [], "import_names": [], "rhs_call_name": "_get_encoding_from_std_streams", "annotation": ""}, "snippet": " encoding = _get_encoding_from_std_streams()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99834:If_L49_C4", "label": "if", "type": "if", "loc": [49, 50], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99834:FunctionDef_L44_C0", "vector": [4, 1, 0.6689, 0.027, 1, 0.13, 0.5, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if encoding:\n return encoding"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99834:Return_L50_C8", "label": "return", "type": "return", "loc": [50, 50], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99834:If_L49_C4", "vector": [13, 2, 0.6757, 0.0135, 2, 0.23, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return encoding"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99834:If_L51_C4", "label": "if", "type": "if", "loc": [51, 52], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99834:FunctionDef_L44_C0", "vector": [4, 1, 0.6959, 0.027, 1, 0.13, 0.75, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if os.sep == '/':\n return _read_encoding_from_unix_env()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99834:Return_L52_C8", "label": "return", "type": "return", "loc": [52, 52], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99834:If_L51_C4", "vector": [13, 2, 0.7027, 0.0135, 2, 0.93, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return _read_encoding_from_unix_env()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99834:Return_L53_C4", "label": "return", "type": "return", "loc": [53, 53], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99834:FunctionDef_L44_C0", "vector": [13, 1, 0.7162, 0.0135, 1, 0.13, 1.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 'cp437' # Default DOS encoding"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99834:FunctionDef_L55_C0", "label": "_get_encoding_from_std_streams", "type": "function", "loc": [55, 60], "level": 0, "parent": null, "vector": [2, 0, 0.777, 0.0811, 0, 0.66, 0.7778, 454, 0, 0, 1, 0, 0, 0, 3], "semantic": {"name": "_get_encoding_from_std_streams", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def _get_encoding_from_std_streams():\n # Stream may not have encoding attribute if it is intercepted outside RF\n # in Python. Encoding is None if process's outputs are redirected.\n return getattr(sys.__stdout__, 'encoding', None) \\\n or getattr(sys.__stderr__, 'encoding', None) \\\n or getattr(sys.__stdin__, 'encoding', None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99834:Return_L58_C4", "label": "return", "type": "return", "loc": [58, 60], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99834:FunctionDef_L55_C0", "vector": [13, 1, 0.7973, 0.0405, 1, 0.85, 0.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return getattr(sys.__stdout__, 'encoding', None) \\\n or getattr(sys.__stderr__, 'encoding', None) \\\n or getattr(sys.__stdin__, 'encoding', None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99834:FunctionDef_L62_C0", "label": "_read_encoding_from_unix_env", "type": "function", "loc": [62, 72], "level": 0, "parent": null, "vector": [2, 0, 0.9054, 0.1486, 0, 0.66, 0.8889, 287, 0, 0, 1, 0, 0, 0, 2], "semantic": {"name": "_read_encoding_from_unix_env", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def _read_encoding_from_unix_env():\n for name in 'LANG', 'LC_CTYPE', 'LANGUAGE', 'LC_ALL':\n try:\n # Encoding can be in format like `UTF-8` or `en_US.UTF-8`\n encoding = os.environ[name].split('.')[-1]\n 'testing that encoding is valid'.encode(encoding)\n except (KeyError, LookupError):\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99834:For_L63_C4", "label": "for name", "type": "for", "loc": [63, 71], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99834:FunctionDef_L62_C0", "vector": [6, 1, 0.9054, 0.1216, 1, 0.12, 0.0, 57, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for name in 'LANG', 'LC_CTYPE', 'LANGUAGE', 'LC_ALL':\n try:\n # Encoding can be in format like `UTF-8` or `en_US.UTF-8`\n encoding = os.environ[name].split('.')[-1]\n 'testing that encoding is valid'.encode(encoding)\n except (KeyError, LookupError):\n pass\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99834:Try_L64_C8", "label": "try", "type": "try", "loc": [64, 71], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99834:For_L63_C4", "vector": [7, 2, 0.9122, 0.1081, 2, 0.82, 0.0, 0, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n # Encoding can be in format like `UTF-8` or `en_US.UTF-8`\n encoding = os.environ[name].split('.')[-1]\n 'testing that encoding is valid'.encode(encoding)\n except (KeyError, LookupError):\n pass\n else:\n return encoding"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99834:Assign_L66_C12", "label": "encoding =", "type": "assigned_variable", "loc": [66, 66], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99834:Try_L64_C8", "vector": [14, 3, 0.8919, 0.0135, 3, 0.18, 0.0, 325, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "encoding", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " encoding = os.environ[name].split('.')[-1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99834:Expr_L67_C12", "label": "encode()", "type": "expression", "loc": [67, 67], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99834:Try_L64_C8", "vector": [8, 3, 0.9054, 0.0135, 3, 0.18, 0.5, 623, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "encode", "arg_names": [], "import_names": [], "rhs_call_name": "encode", "annotation": ""}, "snippet": " 'testing that encoding is valid'.encode(encoding)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99834:Return_L71_C12", "label": "return", "type": "return", "loc": [71, 71], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99834:Try_L64_C8", "vector": [13, 3, 0.9595, 0.0135, 3, 0.18, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return encoding"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99834:Return_L72_C4", "label": "return", "type": "return", "loc": [72, 72], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99834:FunctionDef_L62_C0", "vector": [13, 1, 0.973, 0.0135, 1, 0.12, 1.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 'ascii'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99834:Assign_L74_C0", "label": "_output_encoding = _get_output_encoding()", "type": "assigned_variable", "loc": [74, 74], "level": 0, "parent": null, "vector": [14, 0, 1.0, 0.0135, 0, 0.66, 1.0, 636, 3, 0, 0, 0, 193, 10, 1], "semantic": {"name": "_output_encoding", "arg_names": [], "import_names": [], "rhs_call_name": "_get_output_encoding", "annotation": ""}, "snippet": "_output_encoding = _get_output_encoding()"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99834:FunctionDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99834:Expr_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99834:FunctionDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99834:If_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99834:If_L23_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99834:Return_L24_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99834:FunctionDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99834:Return_L25_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99834:FunctionDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99834:Expr_L28_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99834:FunctionDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99834:If_L30_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99834:If_L30_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99834:Return_L31_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99834:FunctionDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99834:Return_L32_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99834:FunctionDef_L34_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99834:Expr_L35_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99834:FunctionDef_L34_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99834:Assign_L36_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99834:FunctionDef_L34_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99834:If_L37_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99834:If_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99834:ImportFrom_L39_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99834:If_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99834:Assign_L40_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99834:FunctionDef_L34_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99834:Return_L41_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99834:FunctionDef_L44_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99834:If_L46_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99834:If_L46_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99834:Return_L47_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99834:FunctionDef_L44_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99834:Assign_L48_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99834:FunctionDef_L44_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99834:If_L49_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99834:If_L49_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99834:Return_L50_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99834:FunctionDef_L44_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99834:If_L51_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99834:If_L51_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99834:Return_L52_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99834:FunctionDef_L44_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99834:Return_L53_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99834:FunctionDef_L55_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99834:Return_L58_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99834:FunctionDef_L62_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99834:For_L63_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99834:For_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99834:Try_L64_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99834:Try_L64_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99834:Assign_L66_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99834:Try_L64_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99834:Expr_L67_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99834:Try_L64_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99834:Return_L71_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99834:FunctionDef_L62_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99834:Return_L72_C4"}] |
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from java.io import FileOutputStream
from javax.xml.transform.sax import SAXTransformerFactory
from javax.xml.transform.stream import StreamResult
from org.xml.sax.helpers import AttributesImpl
from abstractxmlwriter import AbstractXmlWriter
class XmlWriter(AbstractXmlWriter):
def __init__(self, path):
self.path = path
self._output = FileOutputStream(path)
self._writer = SAXTransformerFactory.newInstance().newTransformerHandler()
self._writer.setResult(StreamResult(self._output))
self._writer.startDocument()
self.content('\n')
self.closed = False
def _start(self, name, attrs):
self._writer.startElement('', '', name, self._get_attrs_impl(attrs))
def _get_attrs_impl(self, attrs):
ai = AttributesImpl()
for name, value in attrs.items():
ai.addAttribute('', '', name, '', value)
return ai
def _content(self, content):
self._writer.characters(content, 0, len(content))
def _end(self, name):
self._writer.endElement('', '', name)
| ajibawa-2023/Python-Code-Large/train/row_99835 | 25 | 48 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99835:ImportFrom_L16_C0", "label": "from java.io import FileOutputStream", "type": "import", "loc": [16, 16], "level": 0, "parent": null, "vector": [1, 0, 0.3333, 0.0208, 0, 0.66, 0.0, 181, 0, 1, 0, 0, 181, 0, 0], "semantic": {"name": "java.io", "arg_names": [], "import_names": ["FileOutputStream"], "rhs_call_name": "", "annotation": ""}, "snippet": "from java.io import FileOutputStream"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99835:ImportFrom_L17_C0", "label": "from javax.xml.transform.sax import SAXTransformerFactory", "type": "import", "loc": [17, 17], "level": 0, "parent": null, "vector": [1, 0, 0.3542, 0.0208, 0, 0.66, 0.2, 576, 0, 1, 0, 0, 576, 0, 0], "semantic": {"name": "javax.xml.transform.sax", "arg_names": [], "import_names": ["SAXTransformerFactory"], "rhs_call_name": "", "annotation": ""}, "snippet": "from javax.xml.transform.sax import SAXTransformerFactory"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99835:ImportFrom_L18_C0", "label": "from javax.xml.transform.stream import StreamResult", "type": "import", "loc": [18, 18], "level": 0, "parent": null, "vector": [1, 0, 0.375, 0.0208, 0, 0.66, 0.4, 501, 0, 1, 0, 0, 501, 0, 0], "semantic": {"name": "javax.xml.transform.stream", "arg_names": [], "import_names": ["StreamResult"], "rhs_call_name": "", "annotation": ""}, "snippet": "from javax.xml.transform.stream import StreamResult"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99835:ImportFrom_L19_C0", "label": "from org.xml.sax.helpers import AttributesImpl", "type": "import", "loc": [19, 19], "level": 0, "parent": null, "vector": [1, 0, 0.3958, 0.0208, 0, 0.66, 0.6, 432, 0, 1, 0, 0, 432, 0, 0], "semantic": {"name": "org.xml.sax.helpers", "arg_names": [], "import_names": ["AttributesImpl"], "rhs_call_name": "", "annotation": ""}, "snippet": "from org.xml.sax.helpers import AttributesImpl"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99835:ImportFrom_L21_C0", "label": "from abstractxmlwriter import AbstractXmlWriter", "type": "import", "loc": [21, 21], "level": 0, "parent": null, "vector": [1, 0, 0.4375, 0.0208, 0, 0.66, 0.8, 993, 0, 1, 0, 0, 993, 0, 0], "semantic": {"name": "abstractxmlwriter", "arg_names": [], "import_names": ["AbstractXmlWriter"], "rhs_call_name": "", "annotation": ""}, "snippet": "from abstractxmlwriter import AbstractXmlWriter"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99835:ClassDef_L24_C0", "label": "XmlWriter", "type": "class", "loc": [24, 48], "level": 0, "parent": null, "vector": [3, 0, 0.75, 0.5208, 0, 0.66, 1.0, 730, 0, 5, 0, 0, 934, 0, 15], "semantic": {"name": "XmlWriter", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class XmlWriter(AbstractXmlWriter):\n\n def __init__(self, path):\n self.path = path\n self._output = FileOutputStream(path)\n self._writer = SAXTransformerFactory.newInstance().newTransformerHandler()\n self._writer.setResult(StreamResult(self._output))\n self._writer.startDocument()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99835:FunctionDef_L26_C4", "label": "__init__", "type": "function", "loc": [26, 33], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99835:ClassDef_L24_C0", "vector": [2, 1, 0.6146, 0.1667, 1, 0.8, 0.0, 555, 0, 2, 0, 0, 0, 0, 7], "semantic": {"name": "__init__", "arg_names": ["self", "path"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, path):\n self.path = path\n self._output = FileOutputStream(path)\n self._writer = SAXTransformerFactory.newInstance().newTransformerHandler()\n self._writer.setResult(StreamResult(self._output))\n self._writer.startDocument()\n self.content('\\n')\n self.closed = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99835:Assign_L27_C8", "label": "self.path =", "type": "assigned_variable", "loc": [27, 27], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99835:FunctionDef_L26_C4", "vector": [14, 2, 0.5625, 0.0208, 2, 0.14, 0.0, 425, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.path", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.path = path"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99835:Assign_L28_C8", "label": "self._output = FileOutputStream()", "type": "assigned_variable", "loc": [28, 28], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99835:FunctionDef_L26_C4", "vector": [14, 2, 0.5833, 0.0208, 2, 0.14, 0.1667, 867, 3, 1, 0, 0, 158, 10, 1], "semantic": {"name": "self._output", "arg_names": [], "import_names": [], "rhs_call_name": "FileOutputStream", "annotation": ""}, "snippet": " self._output = FileOutputStream(path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99835:Assign_L29_C8", "label": "self._writer = newTransformerHandler()", "type": "assigned_variable", "loc": [29, 29], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99835:FunctionDef_L26_C4", "vector": [14, 2, 0.6042, 0.0208, 2, 0.14, 0.3333, 446, 3, 0, 0, 0, 212, 10, 2], "semantic": {"name": "self._writer", "arg_names": [], "import_names": [], "rhs_call_name": "newTransformerHandler", "annotation": ""}, "snippet": " self._writer = SAXTransformerFactory.newInstance().newTransformerHandler()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99835:Expr_L30_C8", "label": "setResult()", "type": "expression", "loc": [30, 30], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99835:FunctionDef_L26_C4", "vector": [8, 2, 0.625, 0.0208, 2, 0.14, 0.5, 484, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "setResult", "arg_names": [], "import_names": [], "rhs_call_name": "setResult", "annotation": ""}, "snippet": " self._writer.setResult(StreamResult(self._output))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99835:Expr_L31_C8", "label": "startDocument()", "type": "expression", "loc": [31, 31], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99835:FunctionDef_L26_C4", "vector": [8, 2, 0.6458, 0.0208, 2, 0.14, 0.6667, 326, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "startDocument", "arg_names": [], "import_names": [], "rhs_call_name": "startDocument", "annotation": ""}, "snippet": " self._writer.startDocument()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99835:Expr_L32_C8", "label": "content()", "type": "expression", "loc": [32, 32], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99835:FunctionDef_L26_C4", "vector": [8, 2, 0.6667, 0.0208, 2, 0.14, 0.8333, 273, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "content", "arg_names": [], "import_names": [], "rhs_call_name": "content", "annotation": ""}, "snippet": " self.content('\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99835:Assign_L33_C8", "label": "self.closed =", "type": "assigned_variable", "loc": [33, 33], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99835:FunctionDef_L26_C4", "vector": [14, 2, 0.6875, 0.0208, 2, 0.14, 1.0, 494, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.closed", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.closed = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99835:FunctionDef_L35_C4", "label": "_start", "type": "function", "loc": [35, 36], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99835:ClassDef_L24_C0", "vector": [2, 1, 0.7396, 0.0417, 1, 0.8, 0.25, 212, 0, 3, 0, 0, 0, 0, 2], "semantic": {"name": "_start", "arg_names": ["self", "name", "attrs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _start(self, name, attrs):\n self._writer.startElement('', '', name, self._get_attrs_impl(attrs))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99835:Expr_L36_C8", "label": "startElement()", "type": "expression", "loc": [36, 36], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99835:FunctionDef_L35_C4", "vector": [8, 2, 0.75, 0.0208, 2, 0.18, 0.0, 862, 3, 4, 0, 0, 0, 0, 2], "semantic": {"name": "startElement", "arg_names": [], "import_names": [], "rhs_call_name": "startElement", "annotation": ""}, "snippet": " self._writer.startElement('', '', name, self._get_attrs_impl(attrs))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99835:FunctionDef_L38_C4", "label": "_get_attrs_impl", "type": "function", "loc": [38, 42], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99835:ClassDef_L24_C0", "vector": [2, 1, 0.8333, 0.1042, 1, 0.8, 0.5, 925, 0, 2, 1, 0, 0, 0, 3], "semantic": {"name": "_get_attrs_impl", "arg_names": ["self", "attrs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _get_attrs_impl(self, attrs):\n ai = AttributesImpl()\n for name, value in attrs.items():\n ai.addAttribute('', '', name, '', value)\n return ai"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99835:Assign_L39_C8", "label": "ai = AttributesImpl()", "type": "assigned_variable", "loc": [39, 39], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99835:FunctionDef_L38_C4", "vector": [14, 2, 0.8125, 0.0208, 2, 0.74, 0.0, 896, 3, 0, 0, 0, 719, 10, 1], "semantic": {"name": "ai", "arg_names": [], "import_names": [], "rhs_call_name": "AttributesImpl", "annotation": ""}, "snippet": " ai = AttributesImpl()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99835:For_L40_C8", "label": "for name, value", "type": "for", "loc": [40, 41], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99835:FunctionDef_L38_C4", "vector": [6, 2, 0.8438, 0.0417, 2, 0.74, 0.5, 509, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "name, value", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for name, value in attrs.items():\n ai.addAttribute('', '', name, '', value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99835:Expr_L41_C12", "label": "addAttribute()", "type": "expression", "loc": [41, 41], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99835:For_L40_C8", "vector": [8, 3, 0.8542, 0.0208, 3, 0.24, 0.0, 333, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "addAttribute", "arg_names": [], "import_names": [], "rhs_call_name": "addAttribute", "annotation": ""}, "snippet": " ai.addAttribute('', '', name, '', value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99835:Return_L42_C8", "label": "return", "type": "return", "loc": [42, 42], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99835:FunctionDef_L38_C4", "vector": [13, 2, 0.875, 0.0208, 2, 0.74, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ai"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99835:FunctionDef_L44_C4", "label": "_content", "type": "function", "loc": [44, 45], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99835:ClassDef_L24_C0", "vector": [2, 1, 0.9271, 0.0417, 1, 0.8, 0.75, 26, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "_content", "arg_names": ["self", "content"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _content(self, content):\n self._writer.characters(content, 0, len(content))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99835:Expr_L45_C8", "label": "characters()", "type": "expression", "loc": [45, 45], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99835:FunctionDef_L44_C4", "vector": [8, 2, 0.9375, 0.0208, 2, 0.35, 0.0, 731, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "characters", "arg_names": [], "import_names": [], "rhs_call_name": "characters", "annotation": ""}, "snippet": " self._writer.characters(content, 0, len(content))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99835:FunctionDef_L47_C4", "label": "_end", "type": "function", "loc": [47, 48], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99835:ClassDef_L24_C0", "vector": [2, 1, 0.9896, 0.0417, 1, 0.8, 1.0, 964, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "_end", "arg_names": ["self", "name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _end(self, name):\n self._writer.endElement('', '', name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99835:Expr_L48_C8", "label": "endElement()", "type": "expression", "loc": [48, 48], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99835:FunctionDef_L47_C4", "vector": [8, 2, 1.0, 0.0208, 2, 0.51, 0.0, 563, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "endElement", "arg_names": [], "import_names": [], "rhs_call_name": "endElement", "annotation": ""}, "snippet": " self._writer.endElement('', '', name)"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99835:ClassDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99835:FunctionDef_L26_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99835:FunctionDef_L26_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99835:Assign_L27_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99835:FunctionDef_L26_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99835:Assign_L28_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99835:FunctionDef_L26_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99835:Assign_L29_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99835:FunctionDef_L26_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99835:Expr_L30_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99835:FunctionDef_L26_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99835:Expr_L31_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99835:FunctionDef_L26_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99835:Expr_L32_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99835:FunctionDef_L26_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99835:Assign_L33_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99835:ClassDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99835:FunctionDef_L35_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99835:FunctionDef_L35_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99835:Expr_L36_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99835:ClassDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99835:FunctionDef_L38_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99835:FunctionDef_L38_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99835:Assign_L39_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99835:FunctionDef_L38_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99835:For_L40_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99835:For_L40_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99835:Expr_L41_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99835:FunctionDef_L38_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99835:Return_L42_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99835:ClassDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99835:FunctionDef_L44_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99835:FunctionDef_L44_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99835:Expr_L45_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99835:ClassDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99835:FunctionDef_L47_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99835:FunctionDef_L47_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99835:Expr_L48_C8"}] |
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import os.path
import sys
import re
import traceback
from unic import unic
from robot.errors import DataError, TimeoutError, RemoteError
RERAISED_EXCEPTIONS = (KeyboardInterrupt, SystemExit, MemoryError)
if sys.platform.startswith('java'):
from java.io import StringWriter, PrintWriter
from java.lang import Throwable, OutOfMemoryError
RERAISED_EXCEPTIONS += (OutOfMemoryError,)
_java_trace_re = re.compile('^\s+at (\w.+)')
_ignored_java_trace = ('org.python.', 'robot.running.', 'robot$py.',
'sun.reflect.', 'java.lang.reflect.')
_ignore_trace_until = (os.path.join('robot','running','handlers.py'), '<lambda>')
_generic_exceptions = ('AssertionError', 'AssertionFailedError', 'Exception',
'Error', 'RuntimeError', 'RuntimeException',
'DataError', 'TimeoutError', 'RemoteError')
def get_error_message():
"""Returns error message of the last occurred exception.
This method handles also exceptions containing unicode messages. Thus it
MUST be used to get messages from all exceptions originating outside the
framework.
"""
return ErrorDetails().message
def get_error_details():
"""Returns error message and details of the last occurred exception.
"""
dets = ErrorDetails()
return dets.message, dets.traceback
class ErrorDetails(object):
"""This class wraps the last occurred exception
It has attributes message, traceback and error, where message contains
type and message of the original error, traceback it's contains traceback
(or stack trace in case of Java exception) and error contains the original
error instance
This class handles also exceptions containing unicode messages. Thus it
MUST be used to get messages from all exceptions originating outside the
framework.
"""
def __init__(self):
exc_type, exc_value, exc_traceback = sys.exc_info()
if exc_type in RERAISED_EXCEPTIONS:
raise exc_value
if _is_java_exception(exc_value):
self.message = _get_java_message(exc_type, exc_value)
self.traceback = _get_java_details(exc_value)
else:
self.message = _get_python_message(exc_type, exc_value)
self.traceback = _get_python_details(exc_value, exc_traceback)
self.error = exc_value
def _is_java_exception(exc):
return sys.platform.startswith('java') and isinstance(exc, Throwable)
def _get_name(exc_type):
try:
return exc_type.__name__
except AttributeError:
return unic(exc_type)
def _get_java_message(exc_type, exc_value):
exc_name = _get_name(exc_type)
# OOME.getMessage and even toString seem to throw NullPointerException
if exc_type is OutOfMemoryError:
exc_msg = str(exc_value)
else:
exc_msg = exc_value.getMessage()
return _format_message(exc_name, exc_msg, java=True)
def _get_java_details(exc_value):
# OOME.printStackTrace seems to throw NullPointerException
if isinstance(exc_value, OutOfMemoryError):
return ''
output = StringWriter()
exc_value.printStackTrace(PrintWriter(output))
lines = [ line for line in output.toString().splitlines()
if line and not _is_ignored_stacktrace_line(line) ]
details = '\n'.join(lines)
msg = unic(exc_value.getMessage() or '')
if msg:
details = details.replace(msg, '', 1)
return details
def _is_ignored_stacktrace_line(line):
res = _java_trace_re.match(line)
if res is None:
return False
location = res.group(1)
for entry in _ignored_java_trace:
if location.startswith(entry):
return True
return False
def _get_python_message(exc_type, exc_value):
# If exception is a "string exception" without a message exc_value is None
if exc_value is None:
return unic(exc_type)
name = _get_name(exc_type)
try:
msg = unicode(exc_value)
except UnicodeError: # Happens if message is Unicode and version < 2.6
msg = ' '.join(unic(a) for a in exc_value.args)
return _format_message(name, msg)
def _get_python_details(exc_value, exc_tb):
if isinstance(exc_value, (DataError, TimeoutError)):
return ''
if isinstance(exc_value, RemoteError):
return exc_value.traceback
tb = traceback.extract_tb(exc_tb)
for row, (path, _, func, _) in enumerate(tb):
if path.endswith(_ignore_trace_until[0]) and func == _ignore_trace_until[1]:
tb = tb[row+1:]
break
details = 'Traceback (most recent call last):\n' \
+ ''.join(traceback.format_list(tb))
return details.strip()
def _format_message(name, message, java=False):
message = unic(message or '')
if java:
message = _clean_up_java_message(message, name)
name = name.split('.')[-1] # Use only last part of the name
if message == '':
return name
if name in _generic_exceptions:
return message
return '%s: %s' % (name, message)
def _clean_up_java_message(msg, name):
# Remove possible stack trace from messages
lines = msg.splitlines()
while lines:
if _java_trace_re.match(lines[-1]):
lines.pop()
else:
break
msg = '\n'.join(lines)
# Remove possible exception name from the message
tokens = msg.split(':', 1)
if len(tokens) == 2 and tokens[0] == name:
msg = tokens[1]
return msg.strip()
| ajibawa-2023/Python-Code-Large/train/row_99836 | 103 | 179 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99836:Import_L16_C0", "label": "os.path import os.path", "type": "import", "loc": [16, 16], "level": 0, "parent": null, "vector": [1, 0, 0.0894, 0.0056, 0, 0.66, 0.0, 79, 0, 1, 0, 0, 79, 0, 0], "semantic": {"name": "os.path", "arg_names": [], "import_names": ["os.path"], "rhs_call_name": "", "annotation": ""}, "snippet": "import os.path"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99836:Import_L17_C0", "label": "sys import sys", "type": "import", "loc": [17, 17], "level": 0, "parent": null, "vector": [1, 0, 0.095, 0.0056, 0, 0.66, 0.0435, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sys"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99836:Import_L18_C0", "label": "re import re", "type": "import", "loc": [18, 18], "level": 0, "parent": null, "vector": [1, 0, 0.1006, 0.0056, 0, 0.66, 0.087, 540, 0, 1, 0, 0, 540, 0, 0], "semantic": {"name": "re", "arg_names": [], "import_names": ["re"], "rhs_call_name": "", "annotation": ""}, "snippet": "import re"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99836:Import_L19_C0", "label": "traceback import traceback", "type": "import", "loc": [19, 19], "level": 0, "parent": null, "vector": [1, 0, 0.1061, 0.0056, 0, 0.66, 0.1304, 423, 0, 1, 0, 0, 423, 0, 0], "semantic": {"name": "traceback", "arg_names": [], "import_names": ["traceback"], "rhs_call_name": "", "annotation": ""}, "snippet": "import traceback"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99836:ImportFrom_L21_C0", "label": "from unic import unic", "type": "import", "loc": [21, 21], "level": 0, "parent": null, "vector": [1, 0, 0.1173, 0.0056, 0, 0.66, 0.1739, 992, 0, 1, 0, 0, 992, 0, 0], "semantic": {"name": "unic", "arg_names": [], "import_names": ["unic"], "rhs_call_name": "", "annotation": ""}, "snippet": "from unic import unic"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99836:ImportFrom_L22_C0", "label": "from robot.errors import DataError, TimeoutError, RemoteError", "type": "import", "loc": [22, 22], "level": 0, "parent": null, "vector": [1, 0, 0.1229, 0.0056, 0, 0.66, 0.2174, 299, 0, 3, 0, 0, 299, 0, 0], "semantic": {"name": "robot.errors", "arg_names": [], "import_names": ["DataError", "TimeoutError", "RemoteError"], "rhs_call_name": "", "annotation": ""}, "snippet": "from robot.errors import DataError, TimeoutError, RemoteError"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99836:Assign_L24_C0", "label": "RERAISED_EXCEPTIONS =", "type": "assigned_variable", "loc": [24, 24], "level": 0, "parent": null, "vector": [14, 0, 0.1341, 0.0056, 0, 0.66, 0.2609, 185, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "RERAISED_EXCEPTIONS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "RERAISED_EXCEPTIONS = (KeyboardInterrupt, SystemExit, MemoryError)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99836:If_L25_C0", "label": "if", "type": "if", "loc": [25, 28], "level": 0, "parent": null, "vector": [4, 0, 0.148, 0.0223, 0, 0.66, 0.3043, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if sys.platform.startswith('java'):\n from java.io import StringWriter, PrintWriter\n from java.lang import Throwable, OutOfMemoryError\n RERAISED_EXCEPTIONS += (OutOfMemoryError,)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99836:ImportFrom_L26_C4", "label": "from java.io import StringWriter, PrintWriter", "type": "import", "loc": [26, 26], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99836:If_L25_C0", "vector": [1, 1, 0.1453, 0.0056, 1, 0.61, 0.0, 181, 0, 2, 0, 0, 181, 0, 0], "semantic": {"name": "java.io", "arg_names": [], "import_names": ["StringWriter", "PrintWriter"], "rhs_call_name": "", "annotation": ""}, "snippet": " from java.io import StringWriter, PrintWriter"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99836:ImportFrom_L27_C4", "label": "from java.lang import Throwable, OutOfMemoryError", "type": "import", "loc": [27, 27], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99836:If_L25_C0", "vector": [1, 1, 0.1508, 0.0056, 1, 0.61, 1.0, 100, 0, 2, 0, 0, 100, 0, 0], "semantic": {"name": "java.lang", "arg_names": [], "import_names": ["Throwable", "OutOfMemoryError"], "rhs_call_name": "", "annotation": ""}, "snippet": " from java.lang import Throwable, OutOfMemoryError"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99836:Assign_L30_C0", "label": "_java_trace_re = compile()", "type": "assigned_variable", "loc": [30, 30], "level": 0, "parent": null, "vector": [14, 0, 0.1676, 0.0056, 0, 0.66, 0.3478, 201, 3, 1, 0, 0, 821, 10, 1], "semantic": {"name": "_java_trace_re", "arg_names": [], "import_names": [], "rhs_call_name": "compile", "annotation": ""}, "snippet": "_java_trace_re = re.compile('^\\s+at (\\w.+)')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99836:Assign_L31_C0", "label": "_ignored_java_trace =", "type": "assigned_variable", "loc": [31, 32], "level": 0, "parent": null, "vector": [14, 0, 0.176, 0.0112, 0, 0.66, 0.3913, 405, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "_ignored_java_trace", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "_ignored_java_trace = ('org.python.', 'robot.running.', 'robot$py.',\n 'sun.reflect.', 'java.lang.reflect.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99836:Assign_L33_C0", "label": "_ignore_trace_until =", "type": "assigned_variable", "loc": [33, 33], "level": 0, "parent": null, "vector": [14, 0, 0.1844, 0.0056, 0, 0.66, 0.4348, 977, 0, 0, 0, 0, 0, 8, 1], "semantic": {"name": "_ignore_trace_until", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "_ignore_trace_until = (os.path.join('robot','running','handlers.py'), '<lambda>')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99836:Assign_L34_C0", "label": "_generic_exceptions =", "type": "assigned_variable", "loc": [34, 36], "level": 0, "parent": null, "vector": [14, 0, 0.1955, 0.0168, 0, 0.66, 0.4783, 819, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "_generic_exceptions", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "_generic_exceptions = ('AssertionError', 'AssertionFailedError', 'Exception',\n 'Error', 'RuntimeError', 'RuntimeException',\n 'DataError', 'TimeoutError', 'RemoteError')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99836:FunctionDef_L39_C0", "label": "get_error_message", "type": "function", "loc": [39, 46], "level": 0, "parent": null, "vector": [2, 0, 0.2374, 0.0447, 0, 0.66, 0.5217, 159, 0, 0, 1, 0, 0, 0, 1], "semantic": {"name": "get_error_message", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def get_error_message():\n \"\"\"Returns error message of the last occurred exception.\n\n This method handles also exceptions containing unicode messages. Thus it\n MUST be used to get messages from all exceptions originating outside the\n framework.\n \"\"\"\n return ErrorDetails().message"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99836:Expr_L40_C4", "label": "expression", "type": "expression", "loc": [40, 45], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99836:FunctionDef_L39_C0", "vector": [8, 1, 0.2374, 0.0335, 1, 0.68, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Returns error message of the last occurred exception.\n\n This method handles also exceptions containing unicode messages. Thus it\n MUST be used to get messages from all exceptions originating outside the\n framework.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99836:Return_L46_C4", "label": "return", "type": "return", "loc": [46, 46], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99836:FunctionDef_L39_C0", "vector": [13, 1, 0.257, 0.0056, 1, 0.68, 1.0, 0, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ErrorDetails().message"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99836:FunctionDef_L49_C0", "label": "get_error_details", "type": "function", "loc": [49, 53], "level": 0, "parent": null, "vector": [2, 0, 0.2849, 0.0279, 0, 0.66, 0.5652, 692, 0, 0, 1, 0, 0, 0, 1], "semantic": {"name": "get_error_details", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def get_error_details():\n \"\"\"Returns error message and details of the last occurred exception.\n \"\"\"\n dets = ErrorDetails()\n return dets.message, dets.traceback"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99836:Expr_L50_C4", "label": "expression", "type": "expression", "loc": [50, 51], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99836:FunctionDef_L49_C0", "vector": [8, 1, 0.2821, 0.0112, 1, 0.89, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Returns error message and details of the last occurred exception.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99836:Assign_L52_C4", "label": "dets = ErrorDetails()", "type": "assigned_variable", "loc": [52, 52], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99836:FunctionDef_L49_C0", "vector": [14, 1, 0.2905, 0.0056, 1, 0.89, 0.5, 600, 3, 0, 0, 0, 879, 10, 1], "semantic": {"name": "dets", "arg_names": [], "import_names": [], "rhs_call_name": "ErrorDetails", "annotation": ""}, "snippet": " dets = ErrorDetails()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99836:Return_L53_C4", "label": "return", "type": "return", "loc": [53, 53], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99836:FunctionDef_L49_C0", "vector": [13, 1, 0.2961, 0.0056, 1, 0.89, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return dets.message, dets.traceback"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99836:ClassDef_L56_C0", "label": "ErrorDetails", "type": "class", "loc": [56, 79], "level": 0, "parent": null, "vector": [3, 0, 0.3771, 0.1341, 0, 0.66, 0.6087, 879, 0, 1, 0, 0, 186, 0, 6], "semantic": {"name": "ErrorDetails", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class ErrorDetails(object):\n \"\"\"This class wraps the last occurred exception\n\n It has attributes message, traceback and error, where message contains\n type and message of the original error, traceback it's contains traceback\n (or stack trace in case of Java exception) and error contains the original\n error instance\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99836:Expr_L57_C4", "label": "expression", "type": "expression", "loc": [57, 67], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99836:ClassDef_L56_C0", "vector": [8, 1, 0.3464, 0.0615, 1, 0.11, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"This class wraps the last occurred exception\n\n It has attributes message, traceback and error, where message contains\n type and message of the original error, traceback it's contains traceback\n (or stack trace in case of Java exception) and error contains the original\n error instance\n\n This class handles also exceptions containing unicode messages. Thus it"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99836:FunctionDef_L69_C4", "label": "__init__", "type": "function", "loc": [69, 79], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99836:ClassDef_L56_C0", "vector": [2, 1, 0.4134, 0.0615, 1, 0.11, 1.0, 555, 0, 1, 0, 0, 0, 0, 6], "semantic": {"name": "__init__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self):\n exc_type, exc_value, exc_traceback = sys.exc_info()\n if exc_type in RERAISED_EXCEPTIONS:\n raise exc_value\n if _is_java_exception(exc_value):\n self.message = _get_java_message(exc_type, exc_value)\n self.traceback = _get_java_details(exc_value)\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99836:Assign_L70_C8", "label": "exc_type, exc_value, exc_traceback = exc_info()", "type": "assigned_variable", "loc": [70, 70], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99836:FunctionDef_L69_C4", "vector": [14, 2, 0.3911, 0.0056, 2, 0.07, 0.0, 161, 3, 0, 0, 0, 289, 10, 1], "semantic": {"name": "exc_type, exc_value, exc_traceback", "arg_names": [], "import_names": [], "rhs_call_name": "exc_info", "annotation": ""}, "snippet": " exc_type, exc_value, exc_traceback = sys.exc_info()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99836:If_L71_C8", "label": "if", "type": "if", "loc": [71, 72], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99836:FunctionDef_L69_C4", "vector": [4, 2, 0.3994, 0.0112, 2, 0.07, 0.3333, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if exc_type in RERAISED_EXCEPTIONS:\n raise exc_value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99836:If_L73_C8", "label": "if", "type": "if", "loc": [73, 78], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99836:FunctionDef_L69_C4", "vector": [4, 2, 0.4218, 0.0335, 2, 0.07, 0.6667, 0, 3, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if _is_java_exception(exc_value):\n self.message = _get_java_message(exc_type, exc_value)\n self.traceback = _get_java_details(exc_value)\n else:\n self.message = _get_python_message(exc_type, exc_value)\n self.traceback = _get_python_details(exc_value, exc_traceback)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99836:Assign_L74_C12", "label": "self.message = _get_java_message()", "type": "assigned_variable", "loc": [74, 74], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99836:If_L73_C8", "vector": [14, 3, 0.4134, 0.0056, 3, 0.49, 0.0, 709, 3, 2, 0, 0, 90, 10, 1], "semantic": {"name": "self.message", "arg_names": [], "import_names": [], "rhs_call_name": "_get_java_message", "annotation": ""}, "snippet": " self.message = _get_java_message(exc_type, exc_value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99836:Assign_L75_C12", "label": "self.traceback = _get_java_details()", "type": "assigned_variable", "loc": [75, 75], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99836:If_L73_C8", "vector": [14, 3, 0.419, 0.0056, 3, 0.49, 0.3333, 966, 3, 1, 0, 0, 7, 10, 1], "semantic": {"name": "self.traceback", "arg_names": [], "import_names": [], "rhs_call_name": "_get_java_details", "annotation": ""}, "snippet": " self.traceback = _get_java_details(exc_value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99836:Assign_L77_C12", "label": "self.message = _get_python_message()", "type": "assigned_variable", "loc": [77, 77], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99836:If_L73_C8", "vector": [14, 3, 0.4302, 0.0056, 3, 0.49, 0.6667, 709, 3, 2, 0, 0, 546, 10, 1], "semantic": {"name": "self.message", "arg_names": [], "import_names": [], "rhs_call_name": "_get_python_message", "annotation": ""}, "snippet": " self.message = _get_python_message(exc_type, exc_value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99836:Assign_L78_C12", "label": "self.traceback = _get_python_details()", "type": "assigned_variable", "loc": [78, 78], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99836:If_L73_C8", "vector": [14, 3, 0.4358, 0.0056, 3, 0.49, 1.0, 966, 3, 2, 0, 0, 162, 10, 1], "semantic": {"name": "self.traceback", "arg_names": [], "import_names": [], "rhs_call_name": "_get_python_details", "annotation": ""}, "snippet": " self.traceback = _get_python_details(exc_value, exc_traceback)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99836:Assign_L79_C8", "label": "self.error =", "type": "assigned_variable", "loc": [79, 79], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99836:FunctionDef_L69_C4", "vector": [14, 2, 0.4413, 0.0056, 2, 0.07, 1.0, 784, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.error", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.error = exc_value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99836:FunctionDef_L82_C0", "label": "_is_java_exception", "type": "function", "loc": [82, 83], "level": 0, "parent": null, "vector": [2, 0, 0.4609, 0.0112, 0, 0.66, 0.6522, 937, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "_is_java_exception", "arg_names": ["exc"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def _is_java_exception(exc):\n return sys.platform.startswith('java') and isinstance(exc, Throwable)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99836:Return_L83_C4", "label": "return", "type": "return", "loc": [83, 83], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99836:FunctionDef_L82_C0", "vector": [13, 1, 0.4637, 0.0056, 1, 0.47, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return sys.platform.startswith('java') and isinstance(exc, Throwable)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99836:FunctionDef_L85_C0", "label": "_get_name", "type": "function", "loc": [85, 89], "level": 0, "parent": null, "vector": [2, 0, 0.486, 0.0279, 0, 0.66, 0.6957, 340, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "_get_name", "arg_names": ["exc_type"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def _get_name(exc_type):\n try:\n return exc_type.__name__\n except AttributeError:\n return unic(exc_type)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99836:Try_L86_C4", "label": "try", "type": "try", "loc": [86, 89], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99836:FunctionDef_L85_C0", "vector": [7, 1, 0.4888, 0.0223, 1, 0.44, 0.0, 0, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n return exc_type.__name__\n except AttributeError:\n return unic(exc_type)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99836:Return_L87_C8", "label": "return", "type": "return", "loc": [87, 87], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99836:Try_L86_C4", "vector": [13, 2, 0.486, 0.0056, 2, 0.5, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return exc_type.__name__"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99836:Return_L89_C8", "label": "return", "type": "return", "loc": [89, 89], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99836:Try_L86_C4", "vector": [13, 2, 0.4972, 0.0056, 2, 0.5, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return unic(exc_type)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99836:FunctionDef_L92_C0", "label": "_get_java_message", "type": "function", "loc": [92, 99], "level": 0, "parent": null, "vector": [2, 0, 0.5335, 0.0447, 0, 0.66, 0.7391, 90, 0, 2, 1, 0, 0, 0, 4], "semantic": {"name": "_get_java_message", "arg_names": ["exc_type", "exc_value"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def _get_java_message(exc_type, exc_value):\n exc_name = _get_name(exc_type)\n # OOME.getMessage and even toString seem to throw NullPointerException\n if exc_type is OutOfMemoryError:\n exc_msg = str(exc_value)\n else:\n exc_msg = exc_value.getMessage()\n return _format_message(exc_name, exc_msg, java=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99836:Assign_L93_C4", "label": "exc_name = _get_name()", "type": "assigned_variable", "loc": [93, 93], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99836:FunctionDef_L92_C0", "vector": [14, 1, 0.5196, 0.0056, 1, 0.59, 0.0, 433, 3, 1, 0, 0, 340, 10, 1], "semantic": {"name": "exc_name", "arg_names": [], "import_names": [], "rhs_call_name": "_get_name", "annotation": ""}, "snippet": " exc_name = _get_name(exc_type)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99836:If_L95_C4", "label": "if", "type": "if", "loc": [95, 98], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99836:FunctionDef_L92_C0", "vector": [4, 1, 0.5391, 0.0223, 1, 0.59, 0.5, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if exc_type is OutOfMemoryError:\n exc_msg = str(exc_value)\n else:\n exc_msg = exc_value.getMessage()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99836:Assign_L96_C8", "label": "exc_msg = str()", "type": "assigned_variable", "loc": [96, 96], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99836:If_L95_C4", "vector": [14, 2, 0.5363, 0.0056, 2, 0.31, 0.0, 555, 3, 1, 0, 0, 52, 10, 1], "semantic": {"name": "exc_msg", "arg_names": [], "import_names": [], "rhs_call_name": "str", "annotation": ""}, "snippet": " exc_msg = str(exc_value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99836:Assign_L98_C8", "label": "exc_msg = getMessage()", "type": "assigned_variable", "loc": [98, 98], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99836:If_L95_C4", "vector": [14, 2, 0.5475, 0.0056, 2, 0.31, 1.0, 555, 3, 0, 0, 0, 55, 10, 1], "semantic": {"name": "exc_msg", "arg_names": [], "import_names": [], "rhs_call_name": "getMessage", "annotation": ""}, "snippet": " exc_msg = exc_value.getMessage()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99836:Return_L99_C4", "label": "return", "type": "return", "loc": [99, 99], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99836:FunctionDef_L92_C0", "vector": [13, 1, 0.5531, 0.0056, 1, 0.59, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return _format_message(exc_name, exc_msg, java=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99836:FunctionDef_L102_C0", "label": "_get_java_details", "type": "function", "loc": [102, 114], "level": 0, "parent": null, "vector": [2, 0, 0.6034, 0.0726, 0, 0.66, 0.7826, 7, 0, 1, 1, 0, 0, 0, 11], "semantic": {"name": "_get_java_details", "arg_names": ["exc_value"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def _get_java_details(exc_value):\n # OOME.printStackTrace seems to throw NullPointerException\n if isinstance(exc_value, OutOfMemoryError):\n return ''\n output = StringWriter()\n exc_value.printStackTrace(PrintWriter(output))\n lines = [ line for line in output.toString().splitlines()\n if line and not _is_ignored_stacktrace_line(line) ]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99836:If_L104_C4", "label": "if", "type": "if", "loc": [104, 105], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99836:FunctionDef_L102_C0", "vector": [4, 1, 0.5838, 0.0112, 1, 0.64, 0.0, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if isinstance(exc_value, OutOfMemoryError):\n return ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99836:Return_L105_C8", "label": "return", "type": "return", "loc": [105, 105], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99836:If_L104_C4", "vector": [13, 2, 0.5866, 0.0056, 2, 0.77, 0.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99836:Assign_L106_C4", "label": "output = StringWriter()", "type": "assigned_variable", "loc": [106, 106], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99836:FunctionDef_L102_C0", "vector": [14, 1, 0.5922, 0.0056, 1, 0.64, 0.1429, 886, 3, 0, 0, 0, 356, 10, 1], "semantic": {"name": "output", "arg_names": [], "import_names": [], "rhs_call_name": "StringWriter", "annotation": ""}, "snippet": " output = StringWriter()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99836:Expr_L107_C4", "label": "printStackTrace()", "type": "expression", "loc": [107, 107], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99836:FunctionDef_L102_C0", "vector": [8, 1, 0.5978, 0.0056, 1, 0.64, 0.2857, 558, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "printStackTrace", "arg_names": [], "import_names": [], "rhs_call_name": "printStackTrace", "annotation": ""}, "snippet": " exc_value.printStackTrace(PrintWriter(output))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99836:Assign_L108_C4", "label": "lines =", "type": "assigned_variable", "loc": [108, 109], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99836:FunctionDef_L102_C0", "vector": [14, 1, 0.6061, 0.0112, 1, 0.64, 0.4286, 73, 5, 0, 0, 0, 0, 0, 3], "semantic": {"name": "lines", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " lines = [ line for line in output.toString().splitlines()\n if line and not _is_ignored_stacktrace_line(line) ]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99836:Assign_L110_C4", "label": "details = join()", "type": "assigned_variable", "loc": [110, 110], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99836:FunctionDef_L102_C0", "vector": [14, 1, 0.6145, 0.0056, 1, 0.64, 0.5714, 254, 3, 1, 0, 0, 933, 10, 1], "semantic": {"name": "details", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": " details = '\\n'.join(lines)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99836:Assign_L111_C4", "label": "msg = unic()", "type": "assigned_variable", "loc": [111, 111], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99836:FunctionDef_L102_C0", "vector": [14, 1, 0.6201, 0.0056, 1, 0.64, 0.7143, 712, 3, 1, 0, 0, 992, 10, 2], "semantic": {"name": "msg", "arg_names": [], "import_names": [], "rhs_call_name": "unic", "annotation": ""}, "snippet": " msg = unic(exc_value.getMessage() or '')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99836:If_L112_C4", "label": "if", "type": "if", "loc": [112, 113], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99836:FunctionDef_L102_C0", "vector": [4, 1, 0.6285, 0.0112, 1, 0.64, 0.8571, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if msg:\n details = details.replace(msg, '', 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99836:Assign_L113_C8", "label": "details = replace()", "type": "assigned_variable", "loc": [113, 113], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99836:If_L112_C4", "vector": [14, 2, 0.6313, 0.0056, 2, 0.3, 0.0, 254, 3, 3, 0, 0, 293, 10, 1], "semantic": {"name": "details", "arg_names": [], "import_names": [], "rhs_call_name": "replace", "annotation": ""}, "snippet": " details = details.replace(msg, '', 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99836:Return_L114_C4", "label": "return", "type": "return", "loc": [114, 114], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99836:FunctionDef_L102_C0", "vector": [13, 1, 0.6369, 0.0056, 1, 0.64, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return details"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99836:FunctionDef_L116_C0", "label": "_is_ignored_stacktrace_line", "type": "function", "loc": [116, 124], "level": 0, "parent": null, "vector": [2, 0, 0.6704, 0.0503, 0, 0.66, 0.8261, 980, 0, 1, 1, 0, 0, 0, 3], "semantic": {"name": "_is_ignored_stacktrace_line", "arg_names": ["line"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def _is_ignored_stacktrace_line(line):\n res = _java_trace_re.match(line)\n if res is None:\n return False\n location = res.group(1)\n for entry in _ignored_java_trace:\n if location.startswith(entry):\n return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99836:Assign_L117_C4", "label": "res = match()", "type": "assigned_variable", "loc": [117, 117], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99836:FunctionDef_L116_C0", "vector": [14, 1, 0.6536, 0.0056, 1, 0.76, 0.0, 413, 3, 1, 0, 0, 36, 10, 1], "semantic": {"name": "res", "arg_names": [], "import_names": [], "rhs_call_name": "match", "annotation": ""}, "snippet": " res = _java_trace_re.match(line)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99836:If_L118_C4", "label": "if", "type": "if", "loc": [118, 119], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99836:FunctionDef_L116_C0", "vector": [4, 1, 0.662, 0.0112, 1, 0.76, 0.25, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if res is None:\n return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99836:Return_L119_C8", "label": "return", "type": "return", "loc": [119, 119], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99836:If_L118_C4", "vector": [13, 2, 0.6648, 0.0056, 2, 0.32, 0.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99836:Assign_L120_C4", "label": "location = group()", "type": "assigned_variable", "loc": [120, 120], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99836:FunctionDef_L116_C0", "vector": [14, 1, 0.6704, 0.0056, 1, 0.76, 0.5, 771, 3, 1, 0, 0, 43, 10, 1], "semantic": {"name": "location", "arg_names": [], "import_names": [], "rhs_call_name": "group", "annotation": ""}, "snippet": " location = res.group(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99836:For_L121_C4", "label": "for entry", "type": "for", "loc": [121, 123], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99836:FunctionDef_L116_C0", "vector": [6, 1, 0.6816, 0.0168, 1, 0.76, 0.75, 812, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "entry", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for entry in _ignored_java_trace:\n if location.startswith(entry):\n return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99836:If_L122_C8", "label": "if", "type": "if", "loc": [122, 123], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99836:For_L121_C4", "vector": [4, 2, 0.6844, 0.0112, 2, 0.76, 0.0, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if location.startswith(entry):\n return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99836:Return_L123_C12", "label": "return", "type": "return", "loc": [123, 123], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99836:If_L122_C8", "vector": [13, 3, 0.6872, 0.0056, 3, 0.98, 0.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99836:Return_L124_C4", "label": "return", "type": "return", "loc": [124, 124], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99836:FunctionDef_L116_C0", "vector": [13, 1, 0.6927, 0.0056, 1, 0.76, 1.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99836:FunctionDef_L127_C0", "label": "_get_python_message", "type": "function", "loc": [127, 136], "level": 0, "parent": null, "vector": [2, 0, 0.7346, 0.0559, 0, 0.66, 0.8696, 546, 0, 2, 1, 0, 0, 0, 6], "semantic": {"name": "_get_python_message", "arg_names": ["exc_type", "exc_value"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def _get_python_message(exc_type, exc_value):\n # If exception is a \"string exception\" without a message exc_value is None\n if exc_value is None:\n return unic(exc_type)\n name = _get_name(exc_type)\n try:\n msg = unicode(exc_value)\n except UnicodeError: # Happens if message is Unicode and version < 2.6"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99836:If_L129_C4", "label": "if", "type": "if", "loc": [129, 130], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99836:FunctionDef_L127_C0", "vector": [4, 1, 0.7235, 0.0112, 1, 0.53, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if exc_value is None:\n return unic(exc_type)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99836:Return_L130_C8", "label": "return", "type": "return", "loc": [130, 130], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99836:If_L129_C4", "vector": [13, 2, 0.7263, 0.0056, 2, 0.25, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return unic(exc_type)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99836:Assign_L131_C4", "label": "name = _get_name()", "type": "assigned_variable", "loc": [131, 131], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99836:FunctionDef_L127_C0", "vector": [14, 1, 0.7318, 0.0056, 1, 0.53, 0.3333, 57, 3, 1, 0, 0, 340, 10, 1], "semantic": {"name": "name", "arg_names": [], "import_names": [], "rhs_call_name": "_get_name", "annotation": ""}, "snippet": " name = _get_name(exc_type)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99836:Try_L132_C4", "label": "try", "type": "try", "loc": [132, 135], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99836:FunctionDef_L127_C0", "vector": [7, 1, 0.7458, 0.0223, 1, 0.53, 0.6667, 0, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n msg = unicode(exc_value)\n except UnicodeError: # Happens if message is Unicode and version < 2.6\n msg = ' '.join(unic(a) for a in exc_value.args)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99836:Assign_L133_C8", "label": "msg = unicode()", "type": "assigned_variable", "loc": [133, 133], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99836:Try_L132_C4", "vector": [14, 2, 0.743, 0.0056, 2, 0.22, 0.0, 712, 3, 1, 0, 0, 733, 10, 1], "semantic": {"name": "msg", "arg_names": [], "import_names": [], "rhs_call_name": "unicode", "annotation": ""}, "snippet": " msg = unicode(exc_value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99836:Assign_L135_C8", "label": "msg = join()", "type": "assigned_variable", "loc": [135, 135], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99836:Try_L132_C4", "vector": [14, 2, 0.7542, 0.0056, 2, 0.22, 0.0, 712, 3, 1, 0, 0, 933, 10, 2], "semantic": {"name": "msg", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": " msg = ' '.join(unic(a) for a in exc_value.args)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99836:Return_L136_C4", "label": "return", "type": "return", "loc": [136, 136], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99836:FunctionDef_L127_C0", "vector": [13, 1, 0.7598, 0.0056, 1, 0.53, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return _format_message(name, msg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99836:FunctionDef_L139_C0", "label": "_get_python_details", "type": "function", "loc": [139, 151], "level": 0, "parent": null, "vector": [2, 0, 0.8101, 0.0726, 0, 0.66, 0.913, 162, 0, 2, 1, 0, 0, 0, 8], "semantic": {"name": "_get_python_details", "arg_names": ["exc_value", "exc_tb"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def _get_python_details(exc_value, exc_tb):\n if isinstance(exc_value, (DataError, TimeoutError)):\n return ''\n if isinstance(exc_value, RemoteError):\n return exc_value.traceback\n tb = traceback.extract_tb(exc_tb)\n for row, (path, _, func, _) in enumerate(tb):\n if path.endswith(_ignore_trace_until[0]) and func == _ignore_trace_until[1]:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99836:If_L140_C4", "label": "if", "type": "if", "loc": [140, 141], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99836:FunctionDef_L139_C0", "vector": [4, 1, 0.7849, 0.0112, 1, 0.27, 0.0, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if isinstance(exc_value, (DataError, TimeoutError)):\n return ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99836:Return_L141_C8", "label": "return", "type": "return", "loc": [141, 141], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99836:If_L140_C4", "vector": [13, 2, 0.7877, 0.0056, 2, 0.72, 0.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99836:If_L142_C4", "label": "if", "type": "if", "loc": [142, 143], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99836:FunctionDef_L139_C0", "vector": [4, 1, 0.7961, 0.0112, 1, 0.27, 0.2, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if isinstance(exc_value, RemoteError):\n return exc_value.traceback"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99836:Return_L143_C8", "label": "return", "type": "return", "loc": [143, 143], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99836:If_L142_C4", "vector": [13, 2, 0.7989, 0.0056, 2, 0.9, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return exc_value.traceback"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99836:Assign_L144_C4", "label": "tb = extract_tb()", "type": "assigned_variable", "loc": [144, 144], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99836:FunctionDef_L139_C0", "vector": [14, 1, 0.8045, 0.0056, 1, 0.27, 0.4, 469, 3, 1, 0, 0, 838, 10, 1], "semantic": {"name": "tb", "arg_names": [], "import_names": [], "rhs_call_name": "extract_tb", "annotation": ""}, "snippet": " tb = traceback.extract_tb(exc_tb)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99836:For_L145_C4", "label": "for row", "type": "for", "loc": [145, 148], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99836:FunctionDef_L139_C0", "vector": [6, 1, 0.8184, 0.0223, 1, 0.27, 0.6, 767, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "row", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for row, (path, _, func, _) in enumerate(tb):\n if path.endswith(_ignore_trace_until[0]) and func == _ignore_trace_until[1]:\n tb = tb[row+1:]\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99836:If_L146_C8", "label": "if", "type": "if", "loc": [146, 148], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99836:For_L145_C4", "vector": [4, 2, 0.8212, 0.0168, 2, 0.52, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if path.endswith(_ignore_trace_until[0]) and func == _ignore_trace_until[1]:\n tb = tb[row+1:]\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99836:Assign_L147_C12", "label": "tb =", "type": "assigned_variable", "loc": [147, 147], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99836:If_L146_C8", "vector": [14, 3, 0.8212, 0.0056, 3, 0.09, 0.0, 469, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "tb", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tb = tb[row+1:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99836:Assign_L149_C4", "label": "details =", "type": "assigned_variable", "loc": [149, 150], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99836:FunctionDef_L139_C0", "vector": [14, 1, 0.8352, 0.0112, 1, 0.27, 0.8, 254, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "details", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " details = 'Traceback (most recent call last):\\n' \\\n + ''.join(traceback.format_list(tb))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99836:Return_L151_C4", "label": "return", "type": "return", "loc": [151, 151], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99836:FunctionDef_L139_C0", "vector": [13, 1, 0.8436, 0.0056, 1, 0.27, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return details.strip()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99836:FunctionDef_L154_C0", "label": "_format_message", "type": "function", "loc": [154, 163], "level": 0, "parent": null, "vector": [2, 0, 0.8855, 0.0559, 0, 0.66, 0.9565, 222, 0, 3, 1, 0, 0, 0, 3], "semantic": {"name": "_format_message", "arg_names": ["name", "message", "java"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def _format_message(name, message, java=False):\n message = unic(message or '')\n if java:\n message = _clean_up_java_message(message, name)\n name = name.split('.')[-1] # Use only last part of the name\n if message == '':\n return name\n if name in _generic_exceptions:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99836:Assign_L155_C4", "label": "message = unic()", "type": "assigned_variable", "loc": [155, 155], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99836:FunctionDef_L154_C0", "vector": [14, 1, 0.8659, 0.0056, 1, 0.81, 0.0, 635, 3, 1, 0, 0, 992, 10, 1], "semantic": {"name": "message", "arg_names": [], "import_names": [], "rhs_call_name": "unic", "annotation": ""}, "snippet": " message = unic(message or '')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99836:If_L156_C4", "label": "if", "type": "if", "loc": [156, 157], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99836:FunctionDef_L154_C0", "vector": [4, 1, 0.8743, 0.0112, 1, 0.81, 0.2, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if java:\n message = _clean_up_java_message(message, name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99836:Assign_L157_C8", "label": "message = _clean_up_java_message()", "type": "assigned_variable", "loc": [157, 157], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99836:If_L156_C4", "vector": [14, 2, 0.8771, 0.0056, 2, 0.05, 0.0, 635, 3, 2, 0, 0, 568, 10, 1], "semantic": {"name": "message", "arg_names": [], "import_names": [], "rhs_call_name": "_clean_up_java_message", "annotation": ""}, "snippet": " message = _clean_up_java_message(message, name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99836:Assign_L158_C4", "label": "name =", "type": "assigned_variable", "loc": [158, 158], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99836:FunctionDef_L154_C0", "vector": [14, 1, 0.8827, 0.0056, 1, 0.81, 0.4, 57, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " name = name.split('.')[-1] # Use only last part of the name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99836:If_L159_C4", "label": "if", "type": "if", "loc": [159, 160], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99836:FunctionDef_L154_C0", "vector": [4, 1, 0.8911, 0.0112, 1, 0.81, 0.6, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if message == '':\n return name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99836:Return_L160_C8", "label": "return", "type": "return", "loc": [160, 160], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99836:If_L159_C4", "vector": [13, 2, 0.8939, 0.0056, 2, 0.35, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99836:If_L161_C4", "label": "if", "type": "if", "loc": [161, 162], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99836:FunctionDef_L154_C0", "vector": [4, 1, 0.9022, 0.0112, 1, 0.81, 0.8, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if name in _generic_exceptions:\n return message"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99836:Return_L162_C8", "label": "return", "type": "return", "loc": [162, 162], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99836:If_L161_C4", "vector": [13, 2, 0.905, 0.0056, 2, 0.09, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return message"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99836:Return_L163_C4", "label": "return", "type": "return", "loc": [163, 163], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99836:FunctionDef_L154_C0", "vector": [13, 1, 0.9106, 0.0056, 1, 0.81, 1.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return '%s: %s' % (name, message)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99836:FunctionDef_L166_C0", "label": "_clean_up_java_message", "type": "function", "loc": [166, 179], "level": 0, "parent": null, "vector": [2, 0, 0.9637, 0.0782, 0, 0.66, 1.0, 568, 0, 2, 1, 0, 0, 0, 7], "semantic": {"name": "_clean_up_java_message", "arg_names": ["msg", "name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def _clean_up_java_message(msg, name):\n # Remove possible stack trace from messages\n lines = msg.splitlines()\n while lines:\n if _java_trace_re.match(lines[-1]):\n lines.pop()\n else:\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99836:Assign_L168_C4", "label": "lines = splitlines()", "type": "assigned_variable", "loc": [168, 168], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99836:FunctionDef_L166_C0", "vector": [14, 1, 0.9385, 0.0056, 1, 0.03, 0.0, 73, 3, 0, 0, 0, 296, 10, 1], "semantic": {"name": "lines", "arg_names": [], "import_names": [], "rhs_call_name": "splitlines", "annotation": ""}, "snippet": " lines = msg.splitlines()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99836:While_L169_C4", "label": "while", "type": "while", "loc": [169, 173], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99836:FunctionDef_L166_C0", "vector": [5, 1, 0.9553, 0.0279, 1, 0.03, 0.2, 0, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while lines:\n if _java_trace_re.match(lines[-1]):\n lines.pop()\n else:\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99836:If_L170_C8", "label": "if", "type": "if", "loc": [170, 173], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99836:While_L169_C4", "vector": [4, 2, 0.9581, 0.0223, 2, 0.88, 0.0, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if _java_trace_re.match(lines[-1]):\n lines.pop()\n else:\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99836:Expr_L171_C12", "label": "pop()", "type": "expression", "loc": [171, 171], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99836:If_L170_C8", "vector": [8, 3, 0.9553, 0.0056, 3, 0.94, 0.0, 969, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "pop", "arg_names": [], "import_names": [], "rhs_call_name": "pop", "annotation": ""}, "snippet": " lines.pop()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99836:Assign_L174_C4", "label": "msg = join()", "type": "assigned_variable", "loc": [174, 174], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99836:FunctionDef_L166_C0", "vector": [14, 1, 0.9721, 0.0056, 1, 0.03, 0.4, 712, 3, 1, 0, 0, 933, 10, 1], "semantic": {"name": "msg", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": " msg = '\\n'.join(lines)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99836:Assign_L176_C4", "label": "tokens = split()", "type": "assigned_variable", "loc": [176, 176], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99836:FunctionDef_L166_C0", "vector": [14, 1, 0.9832, 0.0056, 1, 0.03, 0.6, 700, 3, 2, 0, 0, 908, 10, 1], "semantic": {"name": "tokens", "arg_names": [], "import_names": [], "rhs_call_name": "split", "annotation": ""}, "snippet": " tokens = msg.split(':', 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99836:If_L177_C4", "label": "if", "type": "if", "loc": [177, 178], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99836:FunctionDef_L166_C0", "vector": [4, 1, 0.9916, 0.0112, 1, 0.03, 0.8, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(tokens) == 2 and tokens[0] == name:\n msg = tokens[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99836:Assign_L178_C8", "label": "msg =", "type": "assigned_variable", "loc": [178, 178], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99836:If_L177_C4", "vector": [14, 2, 0.9944, 0.0056, 2, 0.58, 0.0, 712, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "msg", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " msg = tokens[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99836:Return_L179_C4", "label": "return", "type": "return", "loc": [179, 179], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99836:FunctionDef_L166_C0", "vector": [13, 1, 1.0, 0.0056, 1, 0.03, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return msg.strip()"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99836:If_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99836:ImportFrom_L26_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99836:If_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99836:ImportFrom_L27_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99836:FunctionDef_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99836:Expr_L40_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99836:FunctionDef_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99836:Return_L46_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99836:FunctionDef_L49_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99836:Expr_L50_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99836:FunctionDef_L49_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99836:Assign_L52_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99836:FunctionDef_L49_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99836:Return_L53_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99836:ClassDef_L56_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99836:Expr_L57_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99836:ClassDef_L56_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99836:FunctionDef_L69_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99836:FunctionDef_L69_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99836:Assign_L70_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99836:FunctionDef_L69_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99836:If_L71_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99836:FunctionDef_L69_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99836:If_L73_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99836:If_L73_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99836:Assign_L74_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99836:If_L73_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99836:Assign_L75_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99836:If_L73_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99836:Assign_L77_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99836:If_L73_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99836:Assign_L78_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99836:FunctionDef_L69_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99836:Assign_L79_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99836:FunctionDef_L82_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99836:Return_L83_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99836:FunctionDef_L85_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99836:Try_L86_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99836:Try_L86_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99836:Return_L87_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99836:Try_L86_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99836:Return_L89_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99836:FunctionDef_L92_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99836:Assign_L93_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99836:FunctionDef_L92_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99836:If_L95_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99836:If_L95_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99836:Assign_L96_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99836:If_L95_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99836:Assign_L98_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99836:FunctionDef_L92_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99836:Return_L99_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99836:FunctionDef_L102_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99836:If_L104_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99836:If_L104_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99836:Return_L105_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99836:FunctionDef_L102_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99836:Assign_L106_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99836:FunctionDef_L102_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99836:Expr_L107_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99836:FunctionDef_L102_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99836:Assign_L108_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99836:FunctionDef_L102_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99836:Assign_L110_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99836:FunctionDef_L102_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99836:Assign_L111_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99836:FunctionDef_L102_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99836:If_L112_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99836:If_L112_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99836:Assign_L113_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99836:FunctionDef_L102_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99836:Return_L114_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99836:FunctionDef_L116_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99836:Assign_L117_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99836:FunctionDef_L116_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99836:If_L118_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99836:If_L118_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99836:Return_L119_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99836:FunctionDef_L116_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99836:Assign_L120_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99836:FunctionDef_L116_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99836:For_L121_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99836:For_L121_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99836:If_L122_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99836:If_L122_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99836:Return_L123_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99836:FunctionDef_L116_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99836:Return_L124_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99836:FunctionDef_L127_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99836:If_L129_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99836:If_L129_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99836:Return_L130_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99836:FunctionDef_L127_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99836:Assign_L131_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99836:FunctionDef_L127_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99836:Try_L132_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99836:Try_L132_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99836:Assign_L133_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99836:Try_L132_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99836:Assign_L135_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99836:FunctionDef_L127_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99836:Return_L136_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99836:FunctionDef_L139_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99836:If_L140_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99836:If_L140_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99836:Return_L141_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99836:FunctionDef_L139_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99836:If_L142_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99836:If_L142_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99836:Return_L143_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99836:FunctionDef_L139_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99836:Assign_L144_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99836:FunctionDef_L139_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99836:For_L145_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99836:For_L145_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99836:If_L146_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99836:If_L146_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99836:Assign_L147_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99836:FunctionDef_L139_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99836:Assign_L149_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99836:FunctionDef_L139_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99836:Return_L151_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99836:FunctionDef_L154_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99836:Assign_L155_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99836:FunctionDef_L154_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99836:If_L156_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99836:If_L156_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99836:Assign_L157_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99836:FunctionDef_L154_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99836:Assign_L158_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99836:FunctionDef_L154_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99836:If_L159_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99836:If_L159_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99836:Return_L160_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99836:FunctionDef_L154_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99836:If_L161_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99836:If_L161_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99836:Return_L162_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99836:FunctionDef_L154_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99836:Return_L163_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99836:FunctionDef_L166_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99836:Assign_L168_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99836:FunctionDef_L166_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99836:While_L169_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99836:While_L169_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99836:If_L170_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99836:If_L170_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99836:Expr_L171_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99836:FunctionDef_L166_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99836:Assign_L174_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99836:FunctionDef_L166_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99836:Assign_L176_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99836:FunctionDef_L166_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99836:If_L177_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99836:If_L177_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99836:Assign_L178_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99836:FunctionDef_L166_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99836:Return_L179_C4"}] |
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from unic import unic
_ILLEGAL_CHARS_IN_XML = u'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x0b\x0c\x0e' \
+ u'\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f\ufffe'
class AbstractXmlWriter:
def start(self, name, attributes={}, newline=True):
self._start(name, self._escape_attrs(attributes))
if newline:
self.content('\n')
def _start(self, name, attrs):
raise NotImplementedError
def _escape_attrs(self, attrs):
return dict((n, self._escape(v)) for n, v in attrs.items())
def _escape(self, content):
content = unic(content)
for char in _ILLEGAL_CHARS_IN_XML:
# Avoid bug http://ironpython.codeplex.com/workitem/29402
if char in content:
content = content.replace(char, '')
return content
def content(self, content):
if content is not None:
self._content(self._escape(content))
def _content(self, content):
raise NotImplementedError
def end(self, name, newline=True):
self._end(name)
if newline:
self.content('\n')
def _end(self, name):
raise NotImplementedError
def element(self, name, content=None, attributes={}, newline=True):
self.start(name, attributes, newline=False)
self.content(content)
self.end(name, newline)
def close(self):
self._close()
self.closed = True
def _close(self):
self._writer.endDocument()
self._output.close()
| ajibawa-2023/Python-Code-Large/train/row_99837 | 35 | 69 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99837:ImportFrom_L15_C0", "label": "from unic import unic", "type": "import", "loc": [15, 15], "level": 0, "parent": null, "vector": [1, 0, 0.2174, 0.0145, 0, 0.66, 0.0, 992, 0, 1, 0, 0, 992, 0, 0], "semantic": {"name": "unic", "arg_names": [], "import_names": ["unic"], "rhs_call_name": "", "annotation": ""}, "snippet": "from unic import unic"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99837:Assign_L18_C0", "label": "_ILLEGAL_CHARS_IN_XML =", "type": "assigned_variable", "loc": [18, 19], "level": 0, "parent": null, "vector": [14, 0, 0.2681, 0.029, 0, 0.66, 0.5, 484, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "_ILLEGAL_CHARS_IN_XML", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "_ILLEGAL_CHARS_IN_XML = u'\\x00\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\x0b\\x0c\\x0e' \\\n + u'\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f\\ufffe'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99837:ClassDef_L22_C0", "label": "AbstractXmlWriter", "type": "class", "loc": [22, 69], "level": 0, "parent": null, "vector": [3, 0, 0.6594, 0.6957, 0, 0.66, 1.0, 934, 0, 11, 0, 0, 0, 0, 18], "semantic": {"name": "AbstractXmlWriter", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class AbstractXmlWriter:\n\n def start(self, name, attributes={}, newline=True):\n self._start(name, self._escape_attrs(attributes))\n if newline:\n self.content('\\n')\n\n def _start(self, name, attrs):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99837:FunctionDef_L24_C4", "label": "start", "type": "function", "loc": [24, 27], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99837:ClassDef_L22_C0", "vector": [2, 1, 0.3696, 0.058, 1, 0.75, 0.0, 511, 0, 4, 0, 0, 0, 0, 3], "semantic": {"name": "start", "arg_names": ["self", "name", "attributes", "newline"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def start(self, name, attributes={}, newline=True):\n self._start(name, self._escape_attrs(attributes))\n if newline:\n self.content('\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99837:Expr_L25_C8", "label": "_start()", "type": "expression", "loc": [25, 25], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99837:FunctionDef_L24_C4", "vector": [8, 2, 0.3623, 0.0145, 2, 0.88, 0.0, 212, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "_start", "arg_names": [], "import_names": [], "rhs_call_name": "_start", "annotation": ""}, "snippet": " self._start(name, self._escape_attrs(attributes))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99837:If_L26_C8", "label": "if", "type": "if", "loc": [26, 27], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99837:FunctionDef_L24_C4", "vector": [4, 2, 0.3841, 0.029, 2, 0.88, 1.0, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if newline:\n self.content('\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99837:Expr_L27_C12", "label": "content()", "type": "expression", "loc": [27, 27], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99837:If_L26_C8", "vector": [8, 3, 0.3913, 0.0145, 3, 0.54, 0.0, 273, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "content", "arg_names": [], "import_names": [], "rhs_call_name": "content", "annotation": ""}, "snippet": " self.content('\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99837:FunctionDef_L29_C4", "label": "_start", "type": "function", "loc": [29, 30], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99837:ClassDef_L22_C0", "vector": [2, 1, 0.4275, 0.029, 1, 0.75, 0.1, 212, 0, 3, 0, 0, 0, 0, 0], "semantic": {"name": "_start", "arg_names": ["self", "name", "attrs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _start(self, name, attrs):\n raise NotImplementedError"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99837:FunctionDef_L32_C4", "label": "_escape_attrs", "type": "function", "loc": [32, 33], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99837:ClassDef_L22_C0", "vector": [2, 1, 0.471, 0.029, 1, 0.75, 0.2, 709, 0, 2, 1, 0, 0, 0, 3], "semantic": {"name": "_escape_attrs", "arg_names": ["self", "attrs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _escape_attrs(self, attrs):\n return dict((n, self._escape(v)) for n, v in attrs.items())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99837:Return_L33_C8", "label": "return", "type": "return", "loc": [33, 33], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99837:FunctionDef_L32_C4", "vector": [13, 2, 0.4783, 0.0145, 2, 0.17, 0.0, 0, 3, 0, 0, 0, 0, 10, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return dict((n, self._escape(v)) for n, v in attrs.items())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99837:FunctionDef_L35_C4", "label": "_escape", "type": "function", "loc": [35, 41], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99837:ClassDef_L22_C0", "vector": [2, 1, 0.5507, 0.1014, 1, 0.75, 0.3, 328, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "_escape", "arg_names": ["self", "content"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _escape(self, content):\n content = unic(content)\n for char in _ILLEGAL_CHARS_IN_XML:\n # Avoid bug http://ironpython.codeplex.com/workitem/29402\n if char in content:\n content = content.replace(char, '')\n return content"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99837:Assign_L36_C8", "label": "content = unic()", "type": "assigned_variable", "loc": [36, 36], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99837:FunctionDef_L35_C4", "vector": [14, 2, 0.5217, 0.0145, 2, 0.37, 0.0, 273, 3, 1, 0, 0, 992, 10, 1], "semantic": {"name": "content", "arg_names": [], "import_names": [], "rhs_call_name": "unic", "annotation": ""}, "snippet": " content = unic(content)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99837:For_L37_C8", "label": "for char", "type": "for", "loc": [37, 40], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99837:FunctionDef_L35_C4", "vector": [6, 2, 0.558, 0.058, 2, 0.37, 0.5, 272, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "char", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for char in _ILLEGAL_CHARS_IN_XML:\n # Avoid bug http://ironpython.codeplex.com/workitem/29402\n if char in content:\n content = content.replace(char, '')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99837:If_L39_C12", "label": "if", "type": "if", "loc": [39, 40], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99837:For_L37_C8", "vector": [4, 3, 0.5725, 0.029, 3, 0.62, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if char in content:\n content = content.replace(char, '')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99837:Assign_L40_C16", "label": "content = replace()", "type": "assigned_variable", "loc": [40, 40], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99837:If_L39_C12", "vector": [14, 4, 0.5797, 0.0145, 4, 0.42, 0.0, 273, 3, 2, 0, 0, 293, 10, 1], "semantic": {"name": "content", "arg_names": [], "import_names": [], "rhs_call_name": "replace", "annotation": ""}, "snippet": " content = content.replace(char, '')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99837:Return_L41_C8", "label": "return", "type": "return", "loc": [41, 41], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99837:FunctionDef_L35_C4", "vector": [13, 2, 0.5942, 0.0145, 2, 0.37, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return content"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99837:FunctionDef_L43_C4", "label": "content", "type": "function", "loc": [43, 45], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99837:ClassDef_L22_C0", "vector": [2, 1, 0.6377, 0.0435, 1, 0.75, 0.4, 273, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "content", "arg_names": ["self", "content"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def content(self, content):\n if content is not None:\n self._content(self._escape(content))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99837:If_L44_C8", "label": "if", "type": "if", "loc": [44, 45], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99837:FunctionDef_L43_C4", "vector": [4, 2, 0.6449, 0.029, 2, 0.66, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if content is not None:\n self._content(self._escape(content))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99837:Expr_L45_C12", "label": "_content()", "type": "expression", "loc": [45, 45], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99837:If_L44_C8", "vector": [8, 3, 0.6522, 0.0145, 3, 0.37, 0.0, 26, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "_content", "arg_names": [], "import_names": [], "rhs_call_name": "_content", "annotation": ""}, "snippet": " self._content(self._escape(content))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99837:FunctionDef_L47_C4", "label": "_content", "type": "function", "loc": [47, 48], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99837:ClassDef_L22_C0", "vector": [2, 1, 0.6884, 0.029, 1, 0.75, 0.5, 26, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "_content", "arg_names": ["self", "content"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _content(self, content):\n raise NotImplementedError"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99837:FunctionDef_L50_C4", "label": "end", "type": "function", "loc": [50, 53], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99837:ClassDef_L22_C0", "vector": [2, 1, 0.7464, 0.058, 1, 0.75, 0.6, 128, 0, 3, 0, 0, 0, 0, 2], "semantic": {"name": "end", "arg_names": ["self", "name", "newline"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def end(self, name, newline=True):\n self._end(name)\n if newline:\n self.content('\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99837:Expr_L51_C8", "label": "_end()", "type": "expression", "loc": [51, 51], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99837:FunctionDef_L50_C4", "vector": [8, 2, 0.7391, 0.0145, 2, 0.95, 0.0, 964, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_end", "arg_names": [], "import_names": [], "rhs_call_name": "_end", "annotation": ""}, "snippet": " self._end(name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99837:If_L52_C8", "label": "if", "type": "if", "loc": [52, 53], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99837:FunctionDef_L50_C4", "vector": [4, 2, 0.7609, 0.029, 2, 0.95, 1.0, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if newline:\n self.content('\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99837:Expr_L53_C12", "label": "content()", "type": "expression", "loc": [53, 53], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99837:If_L52_C8", "vector": [8, 3, 0.7681, 0.0145, 3, 0.6, 0.0, 273, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "content", "arg_names": [], "import_names": [], "rhs_call_name": "content", "annotation": ""}, "snippet": " self.content('\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99837:FunctionDef_L55_C4", "label": "_end", "type": "function", "loc": [55, 56], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99837:ClassDef_L22_C0", "vector": [2, 1, 0.8043, 0.029, 1, 0.75, 0.7, 964, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "_end", "arg_names": ["self", "name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _end(self, name):\n raise NotImplementedError"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99837:FunctionDef_L58_C4", "label": "element", "type": "function", "loc": [58, 61], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99837:ClassDef_L22_C0", "vector": [2, 1, 0.8623, 0.058, 1, 0.75, 0.8, 736, 0, 5, 0, 0, 0, 0, 3], "semantic": {"name": "element", "arg_names": ["self", "name", "content", "attributes", "newline"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def element(self, name, content=None, attributes={}, newline=True):\n self.start(name, attributes, newline=False)\n self.content(content)\n self.end(name, newline)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99837:Expr_L59_C8", "label": "start()", "type": "expression", "loc": [59, 59], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99837:FunctionDef_L58_C4", "vector": [8, 2, 0.8551, 0.0145, 2, 0.75, 0.0, 511, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "start", "arg_names": [], "import_names": [], "rhs_call_name": "start", "annotation": ""}, "snippet": " self.start(name, attributes, newline=False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99837:Expr_L60_C8", "label": "content()", "type": "expression", "loc": [60, 60], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99837:FunctionDef_L58_C4", "vector": [8, 2, 0.8696, 0.0145, 2, 0.75, 0.5, 273, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "content", "arg_names": [], "import_names": [], "rhs_call_name": "content", "annotation": ""}, "snippet": " self.content(content)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99837:Expr_L61_C8", "label": "end()", "type": "expression", "loc": [61, 61], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99837:FunctionDef_L58_C4", "vector": [8, 2, 0.8841, 0.0145, 2, 0.75, 1.0, 128, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "end", "arg_names": [], "import_names": [], "rhs_call_name": "end", "annotation": ""}, "snippet": " self.end(name, newline)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99837:FunctionDef_L63_C4", "label": "close", "type": "function", "loc": [63, 65], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99837:ClassDef_L22_C0", "vector": [2, 1, 0.9275, 0.0435, 1, 0.75, 0.9, 77, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def close(self):\n self._close()\n self.closed = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99837:Expr_L64_C8", "label": "_close()", "type": "expression", "loc": [64, 64], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99837:FunctionDef_L63_C4", "vector": [8, 2, 0.9275, 0.0145, 2, 0.08, 0.0, 884, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_close", "arg_names": [], "import_names": [], "rhs_call_name": "_close", "annotation": ""}, "snippet": " self._close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99837:Assign_L65_C8", "label": "self.closed =", "type": "assigned_variable", "loc": [65, 65], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99837:FunctionDef_L63_C4", "vector": [14, 2, 0.942, 0.0145, 2, 0.08, 1.0, 494, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.closed", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.closed = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99837:FunctionDef_L67_C4", "label": "_close", "type": "function", "loc": [67, 69], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99837:ClassDef_L22_C0", "vector": [2, 1, 0.9855, 0.0435, 1, 0.75, 1.0, 884, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "_close", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _close(self):\n self._writer.endDocument()\n self._output.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99837:Expr_L68_C8", "label": "endDocument()", "type": "expression", "loc": [68, 68], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99837:FunctionDef_L67_C4", "vector": [8, 2, 0.9855, 0.0145, 2, 0.14, 0.0, 761, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "endDocument", "arg_names": [], "import_names": [], "rhs_call_name": "endDocument", "annotation": ""}, "snippet": " self._writer.endDocument()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99837:Expr_L69_C8", "label": "close()", "type": "expression", "loc": [69, 69], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99837:FunctionDef_L67_C4", "vector": [8, 2, 1.0, 0.0145, 2, 0.14, 1.0, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": " self._output.close()"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99837:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99837:FunctionDef_L24_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99837:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99837:Expr_L25_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99837:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99837:If_L26_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99837:If_L26_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99837:Expr_L27_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99837:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99837:FunctionDef_L29_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99837:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99837:FunctionDef_L32_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99837:FunctionDef_L32_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99837:Return_L33_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99837:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99837:FunctionDef_L35_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99837:FunctionDef_L35_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99837:Assign_L36_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99837:FunctionDef_L35_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99837:For_L37_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99837:For_L37_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99837:If_L39_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99837:If_L39_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99837:Assign_L40_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99837:FunctionDef_L35_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99837:Return_L41_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99837:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99837:FunctionDef_L43_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99837:FunctionDef_L43_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99837:If_L44_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99837:If_L44_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99837:Expr_L45_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99837:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99837:FunctionDef_L47_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99837:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99837:FunctionDef_L50_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99837:FunctionDef_L50_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99837:Expr_L51_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99837:FunctionDef_L50_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99837:If_L52_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99837:If_L52_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99837:Expr_L53_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99837:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99837:FunctionDef_L55_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99837:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99837:FunctionDef_L58_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99837:FunctionDef_L58_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99837:Expr_L59_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99837:FunctionDef_L58_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99837:Expr_L60_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99837:FunctionDef_L58_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99837:Expr_L61_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99837:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99837:FunctionDef_L63_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99837:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99837:Expr_L64_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99837:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99837:Assign_L65_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99837:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99837:FunctionDef_L67_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99837:FunctionDef_L67_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99837:Expr_L68_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99837:FunctionDef_L67_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99837:Expr_L69_C8"}] |
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import os
import sys
import inspect
from robot.errors import DataError
from error import get_error_message, get_error_details
from robotpath import normpath, abspath
def simple_import(path_to_module):
err_prefix = "Importing '%s' failed: " % path_to_module
if not os.path.exists(path_to_module):
raise DataError(err_prefix + 'File does not exist')
try:
return _import_module_by_path(path_to_module)
except:
raise DataError(err_prefix + get_error_message())
def _import_module_by_path(path):
moddir, modname = _split_path_to_module(path)
sys.path.insert(0, moddir)
try:
module = __import__(modname)
if hasattr(module, '__file__'):
impdir = os.path.dirname(module.__file__)
if normpath(impdir) != normpath(moddir):
del sys.modules[modname]
module = __import__(modname)
return module
finally:
sys.path.pop(0)
def _split_path_to_module(path):
moddir, modfile = os.path.split(abspath(path))
modname = os.path.splitext(modfile)[0]
return moddir, modname
def import_(name, type_='test library'):
"""Imports Python class/module or Java class with given name.
'name' can also be a path to the library and in that case the directory
containing the lib is automatically put into sys.path and removed there
afterwards.
'type_' is used in error message if importing fails.
Class can either live in a module/package or be 'standalone'. In the former
case tha name is something like 'MyClass' and in the latter it could be
'your.package.YourLibrary'). Python classes always live in a module but if
the module name is exactly same as the class name the former also works in
Python.
Example: If you have a Python class 'MyLibrary' in a module 'mymodule'
it must be imported with name 'mymodule.MyLibrary'. If the name of
the module is also 'MyLibrary' then it is possible to use only
name 'MyLibrary'.
"""
if '.' not in name or os.path.exists(name):
code, module = _non_dotted_import(name, type_)
else:
code, module = _dotted_import(name, type_)
source = _get_module_source(module)
return code, source
def _non_dotted_import(name, type_):
try:
if os.path.exists(name):
module = _import_module_by_path(name)
else:
module = __import__(name)
except:
_raise_import_failed(type_, name)
try:
code = getattr(module, module.__name__)
if not inspect.isclass(code):
raise AttributeError
except AttributeError:
code = module
return code, module
def _dotted_import(name, type_):
parentname, libname = name.rsplit('.', 1)
try:
try:
module = __import__(parentname, fromlist=[str(libname)])
except ImportError:
# Hack to support standalone Jython:
# http://code.google.com/p/robotframework/issues/detail?id=515
if not sys.platform.startswith('java'):
raise
__import__(name)
module = __import__(parentname, fromlist=[str(libname)])
except:
_raise_import_failed(type_, name)
try:
code = getattr(module, libname)
except AttributeError:
_raise_no_lib_in_module(type_, parentname, libname)
if not (inspect.ismodule(code) or inspect.isclass(code)):
_raise_invalid_type(type_, code)
return code, module
def _get_module_source(module):
source = getattr(module, '__file__', None)
return abspath(source) if source else '<unknown>'
def _raise_import_failed(type_, name):
error_msg, error_details = get_error_details()
msg = ["Importing %s '%s' failed: %s" % (type_, name, error_msg),
"PYTHONPATH: %s" % sys.path, error_details]
if sys.platform.startswith('java'):
from java.lang import System
msg.insert(-1, 'CLASSPATH: %s' % System.getProperty('java.class.path'))
raise DataError('\n'.join(msg))
def _raise_no_lib_in_module(type_, modname, libname):
raise DataError("%s module '%s' does not contain '%s'."
% (type_.capitalize(), modname, libname))
def _raise_invalid_type(type_, code):
raise DataError("Imported %s should be a class or module, got %s."
% (type_, type(code).__name__))
| ajibawa-2023/Python-Code-Large/train/row_99838 | 70 | 138 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99838:Import_L15_C0", "label": "os import os", "type": "import", "loc": [15, 15], "level": 0, "parent": null, "vector": [1, 0, 0.1087, 0.0072, 0, 0.66, 0.0, 688, 0, 1, 0, 0, 688, 0, 0], "semantic": {"name": "os", "arg_names": [], "import_names": ["os"], "rhs_call_name": "", "annotation": ""}, "snippet": "import os"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99838:Import_L16_C0", "label": "sys import sys", "type": "import", "loc": [16, 16], "level": 0, "parent": null, "vector": [1, 0, 0.1159, 0.0072, 0, 0.66, 0.0667, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sys"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99838:Import_L17_C0", "label": "inspect import inspect", "type": "import", "loc": [17, 17], "level": 0, "parent": null, "vector": [1, 0, 0.1232, 0.0072, 0, 0.66, 0.1333, 878, 0, 1, 0, 0, 878, 0, 0], "semantic": {"name": "inspect", "arg_names": [], "import_names": ["inspect"], "rhs_call_name": "", "annotation": ""}, "snippet": "import inspect"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99838:ImportFrom_L19_C0", "label": "from robot.errors import DataError", "type": "import", "loc": [19, 19], "level": 0, "parent": null, "vector": [1, 0, 0.1377, 0.0072, 0, 0.66, 0.2, 299, 0, 1, 0, 0, 299, 0, 0], "semantic": {"name": "robot.errors", "arg_names": [], "import_names": ["DataError"], "rhs_call_name": "", "annotation": ""}, "snippet": "from robot.errors import DataError"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99838:ImportFrom_L21_C0", "label": "from error import get_error_message, get_error_details", "type": "import", "loc": [21, 21], "level": 0, "parent": null, "vector": [1, 0, 0.1522, 0.0072, 0, 0.66, 0.2667, 771, 0, 2, 0, 0, 771, 0, 0], "semantic": {"name": "error", "arg_names": [], "import_names": ["get_error_message", "get_error_details"], "rhs_call_name": "", "annotation": ""}, "snippet": "from error import get_error_message, get_error_details"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99838:ImportFrom_L22_C0", "label": "from robotpath import normpath, abspath", "type": "import", "loc": [22, 22], "level": 0, "parent": null, "vector": [1, 0, 0.1594, 0.0072, 0, 0.66, 0.3333, 605, 0, 2, 0, 0, 605, 0, 0], "semantic": {"name": "robotpath", "arg_names": [], "import_names": ["normpath", "abspath"], "rhs_call_name": "", "annotation": ""}, "snippet": "from robotpath import normpath, abspath"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99838:FunctionDef_L25_C0", "label": "simple_import", "type": "function", "loc": [25, 32], "level": 0, "parent": null, "vector": [2, 0, 0.2065, 0.058, 0, 0.66, 0.4, 460, 0, 1, 1, 0, 0, 0, 5], "semantic": {"name": "simple_import", "arg_names": ["path_to_module"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def simple_import(path_to_module):\n err_prefix = \"Importing '%s' failed: \" % path_to_module\n if not os.path.exists(path_to_module):\n raise DataError(err_prefix + 'File does not exist')\n try:\n return _import_module_by_path(path_to_module)\n except:\n raise DataError(err_prefix + get_error_message())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99838:Assign_L26_C4", "label": "err_prefix =", "type": "assigned_variable", "loc": [26, 26], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99838:FunctionDef_L25_C0", "vector": [14, 1, 0.1884, 0.0072, 1, 0.94, 0.0, 377, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "err_prefix", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " err_prefix = \"Importing '%s' failed: \" % path_to_module"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99838:If_L27_C4", "label": "if", "type": "if", "loc": [27, 28], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99838:FunctionDef_L25_C0", "vector": [4, 1, 0.1993, 0.0145, 1, 0.94, 0.5, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not os.path.exists(path_to_module):\n raise DataError(err_prefix + 'File does not exist')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99838:Try_L29_C4", "label": "try", "type": "try", "loc": [29, 32], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99838:FunctionDef_L25_C0", "vector": [7, 1, 0.221, 0.029, 1, 0.94, 1.0, 0, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n return _import_module_by_path(path_to_module)\n except:\n raise DataError(err_prefix + get_error_message())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99838:Return_L30_C8", "label": "return", "type": "return", "loc": [30, 30], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99838:Try_L29_C4", "vector": [13, 2, 0.2174, 0.0072, 2, 0.56, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return _import_module_by_path(path_to_module)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99838:FunctionDef_L34_C0", "label": "_import_module_by_path", "type": "function", "loc": [34, 46], "level": 0, "parent": null, "vector": [2, 0, 0.2899, 0.0942, 0, 0.66, 0.4667, 650, 0, 1, 1, 0, 0, 0, 9], "semantic": {"name": "_import_module_by_path", "arg_names": ["path"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def _import_module_by_path(path):\n moddir, modname = _split_path_to_module(path)\n sys.path.insert(0, moddir)\n try:\n module = __import__(modname)\n if hasattr(module, '__file__'):\n impdir = os.path.dirname(module.__file__)\n if normpath(impdir) != normpath(moddir):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99838:Assign_L35_C4", "label": "moddir, modname = _split_path_to_module()", "type": "assigned_variable", "loc": [35, 35], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99838:FunctionDef_L34_C0", "vector": [14, 1, 0.2536, 0.0072, 1, 0.18, 0.0, 473, 3, 1, 0, 0, 771, 10, 1], "semantic": {"name": "moddir, modname", "arg_names": [], "import_names": [], "rhs_call_name": "_split_path_to_module", "annotation": ""}, "snippet": " moddir, modname = _split_path_to_module(path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99838:Expr_L36_C4", "label": "insert()", "type": "expression", "loc": [36, 36], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99838:FunctionDef_L34_C0", "vector": [8, 1, 0.2609, 0.0072, 1, 0.18, 0.5, 368, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "insert", "arg_names": [], "import_names": [], "rhs_call_name": "insert", "annotation": ""}, "snippet": " sys.path.insert(0, moddir)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99838:Try_L37_C4", "label": "try", "type": "try", "loc": [37, 46], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99838:FunctionDef_L34_C0", "vector": [7, 1, 0.3007, 0.0725, 1, 0.18, 1.0, 0, 0, 0, 0, 0, 0, 0, 7], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n module = __import__(modname)\n if hasattr(module, '__file__'):\n impdir = os.path.dirname(module.__file__)\n if normpath(impdir) != normpath(moddir):\n del sys.modules[modname]\n module = __import__(modname)\n return module"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99838:Assign_L38_C8", "label": "module = __import__()", "type": "assigned_variable", "loc": [38, 38], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99838:Try_L37_C4", "vector": [14, 2, 0.2754, 0.0072, 2, 0.79, 0.0, 98, 3, 1, 0, 0, 744, 10, 1], "semantic": {"name": "module", "arg_names": [], "import_names": [], "rhs_call_name": "__import__", "annotation": ""}, "snippet": " module = __import__(modname)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99838:If_L39_C8", "label": "if", "type": "if", "loc": [39, 43], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99838:Try_L37_C4", "vector": [4, 2, 0.2971, 0.0362, 2, 0.79, 0.3333, 0, 3, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if hasattr(module, '__file__'):\n impdir = os.path.dirname(module.__file__)\n if normpath(impdir) != normpath(moddir):\n del sys.modules[modname]\n module = __import__(modname)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99838:Assign_L40_C12", "label": "impdir = dirname()", "type": "assigned_variable", "loc": [40, 40], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99838:If_L39_C8", "vector": [14, 3, 0.2899, 0.0072, 3, 0.19, 0.0, 763, 3, 1, 0, 0, 959, 10, 1], "semantic": {"name": "impdir", "arg_names": [], "import_names": [], "rhs_call_name": "dirname", "annotation": ""}, "snippet": " impdir = os.path.dirname(module.__file__)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99838:If_L41_C12", "label": "if", "type": "if", "loc": [41, 43], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99838:If_L39_C8", "vector": [4, 3, 0.3043, 0.0217, 3, 0.19, 1.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if normpath(impdir) != normpath(moddir):\n del sys.modules[modname]\n module = __import__(modname)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99838:Assign_L43_C16", "label": "module = __import__()", "type": "assigned_variable", "loc": [43, 43], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99838:If_L41_C12", "vector": [14, 4, 0.3116, 0.0072, 4, 0.49, 0.0, 98, 3, 1, 0, 0, 744, 10, 1], "semantic": {"name": "module", "arg_names": [], "import_names": [], "rhs_call_name": "__import__", "annotation": ""}, "snippet": " module = __import__(modname)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99838:Return_L44_C8", "label": "return", "type": "return", "loc": [44, 44], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99838:Try_L37_C4", "vector": [13, 2, 0.3188, 0.0072, 2, 0.79, 0.6667, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return module"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99838:Expr_L46_C8", "label": "pop()", "type": "expression", "loc": [46, 46], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99838:Try_L37_C4", "vector": [8, 2, 0.3333, 0.0072, 2, 0.79, 1.0, 969, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "pop", "arg_names": [], "import_names": [], "rhs_call_name": "pop", "annotation": ""}, "snippet": " sys.path.pop(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99838:FunctionDef_L48_C0", "label": "_split_path_to_module", "type": "function", "loc": [48, 51], "level": 0, "parent": null, "vector": [2, 0, 0.3587, 0.029, 0, 0.66, 0.5333, 771, 0, 1, 1, 0, 0, 0, 3], "semantic": {"name": "_split_path_to_module", "arg_names": ["path"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def _split_path_to_module(path):\n moddir, modfile = os.path.split(abspath(path))\n modname = os.path.splitext(modfile)[0]\n return moddir, modname"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99838:Assign_L49_C4", "label": "moddir, modfile = split()", "type": "assigned_variable", "loc": [49, 49], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99838:FunctionDef_L48_C0", "vector": [14, 1, 0.3551, 0.0072, 1, 0.7, 0.0, 13, 3, 1, 0, 0, 908, 10, 2], "semantic": {"name": "moddir, modfile", "arg_names": [], "import_names": [], "rhs_call_name": "split", "annotation": ""}, "snippet": " moddir, modfile = os.path.split(abspath(path))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99838:Assign_L50_C4", "label": "modname =", "type": "assigned_variable", "loc": [50, 50], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99838:FunctionDef_L48_C0", "vector": [14, 1, 0.3623, 0.0072, 1, 0.7, 0.5, 909, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "modname", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " modname = os.path.splitext(modfile)[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99838:Return_L51_C4", "label": "return", "type": "return", "loc": [51, 51], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99838:FunctionDef_L48_C0", "vector": [13, 1, 0.3696, 0.0072, 1, 0.7, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return moddir, modname"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99838:FunctionDef_L54_C0", "label": "import_", "type": "function", "loc": [54, 79], "level": 0, "parent": null, "vector": [2, 0, 0.4819, 0.1884, 0, 0.66, 0.6, 10, 0, 2, 1, 0, 0, 0, 4], "semantic": {"name": "import_", "arg_names": ["name", "type_"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def import_(name, type_='test library'):\n \"\"\"Imports Python class/module or Java class with given name.\n\n 'name' can also be a path to the library and in that case the directory\n containing the lib is automatically put into sys.path and removed there\n afterwards.\n\n 'type_' is used in error message if importing fails."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99838:Expr_L55_C4", "label": "expression", "type": "expression", "loc": [55, 73], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99838:FunctionDef_L54_C0", "vector": [8, 1, 0.4638, 0.1377, 1, 0.26, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Imports Python class/module or Java class with given name.\n\n 'name' can also be a path to the library and in that case the directory\n containing the lib is automatically put into sys.path and removed there\n afterwards.\n\n 'type_' is used in error message if importing fails.\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99838:If_L74_C4", "label": "if", "type": "if", "loc": [74, 77], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99838:FunctionDef_L54_C0", "vector": [4, 1, 0.5471, 0.029, 1, 0.26, 0.3333, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if '.' not in name or os.path.exists(name):\n code, module = _non_dotted_import(name, type_)\n else:\n code, module = _dotted_import(name, type_)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99838:Assign_L75_C8", "label": "code, module = _non_dotted_import()", "type": "assigned_variable", "loc": [75, 75], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99838:If_L74_C4", "vector": [14, 2, 0.5435, 0.0072, 2, 0.67, 0.0, 121, 3, 2, 0, 0, 969, 10, 1], "semantic": {"name": "code, module", "arg_names": [], "import_names": [], "rhs_call_name": "_non_dotted_import", "annotation": ""}, "snippet": " code, module = _non_dotted_import(name, type_)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99838:Assign_L77_C8", "label": "code, module = _dotted_import()", "type": "assigned_variable", "loc": [77, 77], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99838:If_L74_C4", "vector": [14, 2, 0.558, 0.0072, 2, 0.67, 1.0, 121, 3, 2, 0, 0, 387, 10, 1], "semantic": {"name": "code, module", "arg_names": [], "import_names": [], "rhs_call_name": "_dotted_import", "annotation": ""}, "snippet": " code, module = _dotted_import(name, type_)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99838:Assign_L78_C4", "label": "source = _get_module_source()", "type": "assigned_variable", "loc": [78, 78], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99838:FunctionDef_L54_C0", "vector": [14, 1, 0.5652, 0.0072, 1, 0.26, 0.6667, 703, 3, 1, 0, 0, 729, 10, 1], "semantic": {"name": "source", "arg_names": [], "import_names": [], "rhs_call_name": "_get_module_source", "annotation": ""}, "snippet": " source = _get_module_source(module)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99838:Return_L79_C4", "label": "return", "type": "return", "loc": [79, 79], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99838:FunctionDef_L54_C0", "vector": [13, 1, 0.5725, 0.0072, 1, 0.26, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return code, source"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99838:FunctionDef_L81_C0", "label": "_non_dotted_import", "type": "function", "loc": [81, 95], "level": 0, "parent": null, "vector": [2, 0, 0.6377, 0.1087, 0, 0.66, 0.6667, 969, 0, 2, 1, 0, 0, 0, 6], "semantic": {"name": "_non_dotted_import", "arg_names": ["name", "type_"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def _non_dotted_import(name, type_):\n try:\n if os.path.exists(name):\n module = _import_module_by_path(name)\n else:\n module = __import__(name)\n except:\n _raise_import_failed(type_, name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99838:Try_L82_C4", "label": "try", "type": "try", "loc": [82, 88], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99838:FunctionDef_L81_C0", "vector": [7, 1, 0.6159, 0.0507, 1, 0.31, 0.0, 0, 0, 1, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n if os.path.exists(name):\n module = _import_module_by_path(name)\n else:\n module = __import__(name)\n except:\n _raise_import_failed(type_, name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99838:If_L83_C8", "label": "if", "type": "if", "loc": [83, 86], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99838:Try_L82_C4", "vector": [4, 2, 0.6123, 0.029, 2, 0.14, 0.0, 0, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if os.path.exists(name):\n module = _import_module_by_path(name)\n else:\n module = __import__(name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99838:Assign_L84_C12", "label": "module = _import_module_by_path()", "type": "assigned_variable", "loc": [84, 84], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99838:If_L83_C8", "vector": [14, 3, 0.6087, 0.0072, 3, 0.57, 0.0, 98, 3, 1, 0, 0, 650, 10, 1], "semantic": {"name": "module", "arg_names": [], "import_names": [], "rhs_call_name": "_import_module_by_path", "annotation": ""}, "snippet": " module = _import_module_by_path(name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99838:Assign_L86_C12", "label": "module = __import__()", "type": "assigned_variable", "loc": [86, 86], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99838:If_L83_C8", "vector": [14, 3, 0.6232, 0.0072, 3, 0.57, 1.0, 98, 3, 1, 0, 0, 744, 10, 1], "semantic": {"name": "module", "arg_names": [], "import_names": [], "rhs_call_name": "__import__", "annotation": ""}, "snippet": " module = __import__(name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99838:Expr_L88_C8", "label": "_raise_import_failed()", "type": "expression", "loc": [88, 88], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99838:Try_L82_C4", "vector": [8, 2, 0.6377, 0.0072, 2, 0.14, 0.0, 916, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "_raise_import_failed", "arg_names": [], "import_names": [], "rhs_call_name": "_raise_import_failed", "annotation": ""}, "snippet": " _raise_import_failed(type_, name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99838:Try_L89_C4", "label": "try", "type": "try", "loc": [89, 94], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99838:FunctionDef_L81_C0", "vector": [7, 1, 0.663, 0.0435, 1, 0.31, 0.5, 0, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n code = getattr(module, module.__name__)\n if not inspect.isclass(code):\n raise AttributeError\n except AttributeError:\n code = module"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99838:Assign_L90_C8", "label": "code = getattr()", "type": "assigned_variable", "loc": [90, 90], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99838:Try_L89_C4", "vector": [14, 2, 0.6522, 0.0072, 2, 0.0, 0.0, 44, 3, 2, 0, 0, 121, 10, 1], "semantic": {"name": "code", "arg_names": [], "import_names": [], "rhs_call_name": "getattr", "annotation": ""}, "snippet": " code = getattr(module, module.__name__)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99838:If_L91_C8", "label": "if", "type": "if", "loc": [91, 92], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99838:Try_L89_C4", "vector": [4, 2, 0.663, 0.0145, 2, 0.0, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not inspect.isclass(code):\n raise AttributeError"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99838:Assign_L94_C8", "label": "code =", "type": "assigned_variable", "loc": [94, 94], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99838:Try_L89_C4", "vector": [14, 2, 0.6812, 0.0072, 2, 0.0, 0.0, 44, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "code", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " code = module"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99838:Return_L95_C4", "label": "return", "type": "return", "loc": [95, 95], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99838:FunctionDef_L81_C0", "vector": [13, 1, 0.6884, 0.0072, 1, 0.31, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return code, module"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99838:FunctionDef_L97_C0", "label": "_dotted_import", "type": "function", "loc": [97, 117], "level": 0, "parent": null, "vector": [2, 0, 0.7754, 0.1522, 0, 0.66, 0.7333, 387, 0, 2, 1, 0, 0, 0, 13], "semantic": {"name": "_dotted_import", "arg_names": ["name", "type_"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def _dotted_import(name, type_):\n parentname, libname = name.rsplit('.', 1)\n try:\n try:\n module = __import__(parentname, fromlist=[str(libname)])\n except ImportError:\n # Hack to support standalone Jython:\n # http://code.google.com/p/robotframework/issues/detail?id=515"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99838:Assign_L98_C4", "label": "parentname, libname = rsplit()", "type": "assigned_variable", "loc": [98, 98], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99838:FunctionDef_L97_C0", "vector": [14, 1, 0.7101, 0.0072, 1, 0.52, 0.0, 586, 3, 2, 0, 0, 310, 10, 1], "semantic": {"name": "parentname, libname", "arg_names": [], "import_names": [], "rhs_call_name": "rsplit", "annotation": ""}, "snippet": " parentname, libname = name.rsplit('.', 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99838:Try_L99_C4", "label": "try", "type": "try", "loc": [99, 110], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99838:FunctionDef_L97_C0", "vector": [7, 1, 0.7572, 0.087, 1, 0.52, 0.25, 0, 0, 1, 0, 0, 0, 0, 7], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n try:\n module = __import__(parentname, fromlist=[str(libname)])\n except ImportError:\n # Hack to support standalone Jython:\n # http://code.google.com/p/robotframework/issues/detail?id=515\n if not sys.platform.startswith('java'):\n raise"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99838:Try_L100_C8", "label": "try", "type": "try", "loc": [100, 108], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99838:Try_L99_C4", "vector": [7, 2, 0.7536, 0.0652, 2, 0.12, 0.0, 0, 0, 1, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n module = __import__(parentname, fromlist=[str(libname)])\n except ImportError:\n # Hack to support standalone Jython:\n # http://code.google.com/p/robotframework/issues/detail?id=515\n if not sys.platform.startswith('java'):\n raise\n __import__(name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99838:Assign_L101_C12", "label": "module = __import__()", "type": "assigned_variable", "loc": [101, 101], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99838:Try_L100_C8", "vector": [14, 3, 0.7319, 0.0072, 3, 0.95, 0.0, 98, 3, 2, 0, 0, 744, 10, 2], "semantic": {"name": "module", "arg_names": [], "import_names": [], "rhs_call_name": "__import__", "annotation": ""}, "snippet": " module = __import__(parentname, fromlist=[str(libname)])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99838:If_L105_C12", "label": "if", "type": "if", "loc": [105, 106], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99838:Try_L100_C8", "vector": [4, 3, 0.7645, 0.0145, 3, 0.95, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not sys.platform.startswith('java'):\n raise"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99838:Expr_L107_C12", "label": "__import__()", "type": "expression", "loc": [107, 107], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99838:Try_L100_C8", "vector": [8, 3, 0.7754, 0.0072, 3, 0.95, 0.5, 744, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "__import__", "arg_names": [], "import_names": [], "rhs_call_name": "__import__", "annotation": ""}, "snippet": " __import__(name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99838:Assign_L108_C12", "label": "module = __import__()", "type": "assigned_variable", "loc": [108, 108], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99838:Try_L100_C8", "vector": [14, 3, 0.7826, 0.0072, 3, 0.95, 1.0, 98, 3, 2, 0, 0, 744, 10, 2], "semantic": {"name": "module", "arg_names": [], "import_names": [], "rhs_call_name": "__import__", "annotation": ""}, "snippet": " module = __import__(parentname, fromlist=[str(libname)])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99838:Expr_L110_C8", "label": "_raise_import_failed()", "type": "expression", "loc": [110, 110], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99838:Try_L99_C4", "vector": [8, 2, 0.7971, 0.0072, 2, 0.12, 0.0, 916, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "_raise_import_failed", "arg_names": [], "import_names": [], "rhs_call_name": "_raise_import_failed", "annotation": ""}, "snippet": " _raise_import_failed(type_, name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99838:Try_L111_C4", "label": "try", "type": "try", "loc": [111, 114], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99838:FunctionDef_L97_C0", "vector": [7, 1, 0.8152, 0.029, 1, 0.52, 0.5, 0, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n code = getattr(module, libname)\n except AttributeError:\n _raise_no_lib_in_module(type_, parentname, libname)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99838:Assign_L112_C8", "label": "code = getattr()", "type": "assigned_variable", "loc": [112, 112], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99838:Try_L111_C4", "vector": [14, 2, 0.8116, 0.0072, 2, 0.16, 0.0, 44, 3, 2, 0, 0, 121, 10, 1], "semantic": {"name": "code", "arg_names": [], "import_names": [], "rhs_call_name": "getattr", "annotation": ""}, "snippet": " code = getattr(module, libname)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99838:Expr_L114_C8", "label": "_raise_no_lib_in_module()", "type": "expression", "loc": [114, 114], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99838:Try_L111_C4", "vector": [8, 2, 0.8261, 0.0072, 2, 0.16, 0.0, 753, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "_raise_no_lib_in_module", "arg_names": [], "import_names": [], "rhs_call_name": "_raise_no_lib_in_module", "annotation": ""}, "snippet": " _raise_no_lib_in_module(type_, parentname, libname)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99838:If_L115_C4", "label": "if", "type": "if", "loc": [115, 116], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99838:FunctionDef_L97_C0", "vector": [4, 1, 0.837, 0.0145, 1, 0.52, 0.75, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not (inspect.ismodule(code) or inspect.isclass(code)):\n _raise_invalid_type(type_, code)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99838:Expr_L116_C8", "label": "_raise_invalid_type()", "type": "expression", "loc": [116, 116], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99838:If_L115_C4", "vector": [8, 2, 0.8406, 0.0072, 2, 0.42, 0.0, 987, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "_raise_invalid_type", "arg_names": [], "import_names": [], "rhs_call_name": "_raise_invalid_type", "annotation": ""}, "snippet": " _raise_invalid_type(type_, code)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99838:Return_L117_C4", "label": "return", "type": "return", "loc": [117, 117], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99838:FunctionDef_L97_C0", "vector": [13, 1, 0.8478, 0.0072, 1, 0.52, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return code, module"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99838:FunctionDef_L119_C0", "label": "_get_module_source", "type": "function", "loc": [119, 121], "level": 0, "parent": null, "vector": [2, 0, 0.8696, 0.0217, 0, 0.66, 0.8, 729, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "_get_module_source", "arg_names": ["module"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def _get_module_source(module):\n source = getattr(module, '__file__', None)\n return abspath(source) if source else '<unknown>'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99838:Assign_L120_C4", "label": "source = getattr()", "type": "assigned_variable", "loc": [120, 120], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99838:FunctionDef_L119_C0", "vector": [14, 1, 0.8696, 0.0072, 1, 0.19, 0.0, 703, 3, 3, 0, 0, 121, 10, 1], "semantic": {"name": "source", "arg_names": [], "import_names": [], "rhs_call_name": "getattr", "annotation": ""}, "snippet": " source = getattr(module, '__file__', None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99838:Return_L121_C4", "label": "return", "type": "return", "loc": [121, 121], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99838:FunctionDef_L119_C0", "vector": [13, 1, 0.8768, 0.0072, 1, 0.19, 1.0, 0, 8, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return abspath(source) if source else '<unknown>'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99838:FunctionDef_L123_C0", "label": "_raise_import_failed", "type": "function", "loc": [123, 130], "level": 0, "parent": null, "vector": [2, 0, 0.9167, 0.058, 0, 0.66, 0.8667, 916, 0, 2, 0, 0, 0, 0, 6], "semantic": {"name": "_raise_import_failed", "arg_names": ["type_", "name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def _raise_import_failed(type_, name):\n error_msg, error_details = get_error_details()\n msg = [\"Importing %s '%s' failed: %s\" % (type_, name, error_msg),\n \"PYTHONPATH: %s\" % sys.path, error_details]\n if sys.platform.startswith('java'):\n from java.lang import System\n msg.insert(-1, 'CLASSPATH: %s' % System.getProperty('java.class.path'))\n raise DataError('\\n'.join(msg))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99838:Assign_L124_C4", "label": "error_msg, error_details = get_error_details()", "type": "assigned_variable", "loc": [124, 124], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99838:FunctionDef_L123_C0", "vector": [14, 1, 0.8986, 0.0072, 1, 0.71, 0.0, 985, 3, 0, 0, 0, 692, 10, 1], "semantic": {"name": "error_msg, error_details", "arg_names": [], "import_names": [], "rhs_call_name": "get_error_details", "annotation": ""}, "snippet": " error_msg, error_details = get_error_details()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99838:Assign_L125_C4", "label": "msg =", "type": "assigned_variable", "loc": [125, 126], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99838:FunctionDef_L123_C0", "vector": [14, 1, 0.9094, 0.0145, 1, 0.71, 0.5, 712, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "msg", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " msg = [\"Importing %s '%s' failed: %s\" % (type_, name, error_msg),\n \"PYTHONPATH: %s\" % sys.path, error_details]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99838:If_L127_C4", "label": "if", "type": "if", "loc": [127, 129], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99838:FunctionDef_L123_C0", "vector": [4, 1, 0.9275, 0.0217, 1, 0.71, 1.0, 0, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if sys.platform.startswith('java'):\n from java.lang import System\n msg.insert(-1, 'CLASSPATH: %s' % System.getProperty('java.class.path'))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99838:ImportFrom_L128_C8", "label": "from java.lang import System", "type": "import", "loc": [128, 128], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99838:If_L127_C4", "vector": [1, 2, 0.9275, 0.0072, 2, 0.5, 0.0, 100, 0, 1, 0, 0, 100, 0, 0], "semantic": {"name": "java.lang", "arg_names": [], "import_names": ["System"], "rhs_call_name": "", "annotation": ""}, "snippet": " from java.lang import System"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99838:Expr_L129_C8", "label": "insert()", "type": "expression", "loc": [129, 129], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99838:If_L127_C4", "vector": [8, 2, 0.9348, 0.0072, 2, 0.5, 1.0, 368, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "insert", "arg_names": [], "import_names": [], "rhs_call_name": "insert", "annotation": ""}, "snippet": " msg.insert(-1, 'CLASSPATH: %s' % System.getProperty('java.class.path'))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99838:FunctionDef_L132_C0", "label": "_raise_no_lib_in_module", "type": "function", "loc": [132, 134], "level": 0, "parent": null, "vector": [2, 0, 0.9638, 0.0217, 0, 0.66, 0.9333, 753, 0, 3, 0, 0, 0, 0, 2], "semantic": {"name": "_raise_no_lib_in_module", "arg_names": ["type_", "modname", "libname"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def _raise_no_lib_in_module(type_, modname, libname):\n raise DataError(\"%s module '%s' does not contain '%s'.\"\n % (type_.capitalize(), modname, libname))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99838:FunctionDef_L136_C0", "label": "_raise_invalid_type", "type": "function", "loc": [136, 138], "level": 0, "parent": null, "vector": [2, 0, 0.9928, 0.0217, 0, 0.66, 1.0, 987, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "_raise_invalid_type", "arg_names": ["type_", "code"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def _raise_invalid_type(type_, code):\n raise DataError(\"Imported %s should be a class or module, got %s.\"\n % (type_, type(code).__name__))"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99838:FunctionDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99838:Assign_L26_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99838:FunctionDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99838:If_L27_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99838:FunctionDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99838:Try_L29_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99838:Try_L29_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99838:Return_L30_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99838:FunctionDef_L34_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99838:Assign_L35_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99838:FunctionDef_L34_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99838:Expr_L36_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99838:FunctionDef_L34_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99838:Try_L37_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99838:Try_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99838:Assign_L38_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99838:Try_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99838:If_L39_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99838:If_L39_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99838:Assign_L40_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99838:If_L39_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99838:If_L41_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99838:If_L41_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99838:Assign_L43_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99838:Try_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99838:Return_L44_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99838:Try_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99838:Expr_L46_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99838:FunctionDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99838:Assign_L49_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99838:FunctionDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99838:Assign_L50_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99838:FunctionDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99838:Return_L51_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99838:FunctionDef_L54_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99838:Expr_L55_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99838:FunctionDef_L54_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99838:If_L74_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99838:If_L74_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99838:Assign_L75_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99838:If_L74_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99838:Assign_L77_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99838:FunctionDef_L54_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99838:Assign_L78_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99838:FunctionDef_L54_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99838:Return_L79_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99838:FunctionDef_L81_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99838:Try_L82_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99838:Try_L82_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99838:If_L83_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99838:If_L83_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99838:Assign_L84_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99838:If_L83_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99838:Assign_L86_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99838:Try_L82_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99838:Expr_L88_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99838:FunctionDef_L81_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99838:Try_L89_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99838:Try_L89_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99838:Assign_L90_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99838:Try_L89_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99838:If_L91_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99838:Try_L89_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99838:Assign_L94_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99838:FunctionDef_L81_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99838:Return_L95_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99838:FunctionDef_L97_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99838:Assign_L98_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99838:FunctionDef_L97_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99838:Try_L99_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99838:Try_L99_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99838:Try_L100_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99838:Try_L100_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99838:Assign_L101_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99838:Try_L100_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99838:If_L105_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99838:Try_L100_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99838:Expr_L107_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99838:Try_L100_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99838:Assign_L108_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99838:Try_L99_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99838:Expr_L110_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99838:FunctionDef_L97_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99838:Try_L111_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99838:Try_L111_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99838:Assign_L112_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99838:Try_L111_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99838:Expr_L114_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99838:FunctionDef_L97_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99838:If_L115_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99838:If_L115_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99838:Expr_L116_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99838:FunctionDef_L97_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99838:Return_L117_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99838:FunctionDef_L119_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99838:Assign_L120_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99838:FunctionDef_L119_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99838:Return_L121_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99838:FunctionDef_L123_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99838:Assign_L124_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99838:FunctionDef_L123_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99838:Assign_L125_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99838:FunctionDef_L123_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99838:If_L127_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99838:If_L127_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99838:ImportFrom_L128_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99838:If_L127_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99838:Expr_L129_C8"}] |
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import os
import urllib
from encoding import decode_from_file_system
if os.sep == '\\':
_CASE_INSENSITIVE_FILESYSTEM = True
else:
try:
_CASE_INSENSITIVE_FILESYSTEM = os.listdir('/tmp') == os.listdir('/TMP')
except OSError:
_CASE_INSENSITIVE_FILESYSTEM = False
def normpath(path):
"""Returns path in normalized and absolute format.
On case-insensitive file systems the path is also case normalized.
If that is not desired, abspath should be used instead.
"""
path = abspath(path)
if _CASE_INSENSITIVE_FILESYSTEM:
path = path.lower()
return path
def abspath(path):
"""Replacement for os.path.abspath with some bug fixes and enhancements.
1) Converts non-Unicode paths to Unicode using file system encoding
2) At least Jython 2.5.1 on Windows returns wrong path with 'c:'.
3) Python until 2.6.5 and at least Jython 2.5.1 don't handle non-ASCII
characters in the working directory: http://bugs.python.org/issue3426
"""
if not isinstance(path, unicode):
path = decode_from_file_system(path)
if os.sep == '\\' and len(path) == 2 and path[1] == ':':
return path + '\\'
return os.path.normpath(os.path.join(os.getcwdu(), path))
def get_link_path(target, base):
"""Returns a relative path to a target from a base.
If base is an existing file, then its parent directory is considered.
Otherwise, base is assumed to be a directory.
Rationale: os.path.relpath is not available before Python 2.6
"""
pathname = _get_pathname(target, base)
url = urllib.pathname2url(pathname.encode('UTF-8'))
if os.path.isabs(pathname):
pre = url.startswith('/') and 'file:' or 'file:///'
url = pre + url
# Want consistent url on all platforms/interpreters
return url.replace('%5C', '/').replace('%3A', ':').replace('|', ':')
def _get_pathname(target, base):
target = abspath(target)
base = abspath(base)
if os.path.isfile(base):
base = os.path.dirname(base)
if base == target:
return os.path.basename(target)
base_drive, base_path = os.path.splitdrive(base)
# if in Windows and base and link on different drives
if os.path.splitdrive(target)[0] != base_drive:
return target
common_len = len(_common_path(base, target))
if base_path == os.sep:
return target[common_len:]
if common_len == len(base_drive) + len(os.sep):
common_len -= len(os.sep)
dirs_up = os.sep.join([os.pardir] * base[common_len:].count(os.sep))
return os.path.join(dirs_up, target[common_len + len(os.sep):])
def _common_path(p1, p2):
"""Returns the longest path common to p1 and p2.
Rationale: as os.path.commonprefix is character based, it doesn't consider
path separators as such, so it may return invalid paths:
commonprefix(('/foo/bar/', '/foo/baz.txt')) -> '/foo/ba' (instead of /foo)
"""
while p1 and p2:
if p1 == p2:
return p1
if len(p1) > len(p2):
p1 = os.path.dirname(p1)
else:
p2 = os.path.dirname(p2)
return ''
| ajibawa-2023/Python-Code-Large/train/row_99839 | 54 | 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_99839:Import_L15_C0", "label": "os import os", "type": "import", "loc": [15, 15], "level": 0, "parent": null, "vector": [1, 0, 0.1415, 0.0094, 0, 0.66, 0.0, 688, 0, 1, 0, 0, 688, 0, 0], "semantic": {"name": "os", "arg_names": [], "import_names": ["os"], "rhs_call_name": "", "annotation": ""}, "snippet": "import os"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99839:Import_L16_C0", "label": "urllib import urllib", "type": "import", "loc": [16, 16], "level": 0, "parent": null, "vector": [1, 0, 0.1509, 0.0094, 0, 0.66, 0.125, 614, 0, 1, 0, 0, 614, 0, 0], "semantic": {"name": "urllib", "arg_names": [], "import_names": ["urllib"], "rhs_call_name": "", "annotation": ""}, "snippet": "import urllib"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99839:ImportFrom_L18_C0", "label": "from encoding import decode_from_file_system", "type": "import", "loc": [18, 18], "level": 0, "parent": null, "vector": [1, 0, 0.1698, 0.0094, 0, 0.66, 0.25, 325, 0, 1, 0, 0, 325, 0, 0], "semantic": {"name": "encoding", "arg_names": [], "import_names": ["decode_from_file_system"], "rhs_call_name": "", "annotation": ""}, "snippet": "from encoding import decode_from_file_system"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99839:If_L21_C0", "label": "if", "type": "if", "loc": [21, 27], "level": 0, "parent": null, "vector": [4, 0, 0.2264, 0.066, 0, 0.66, 0.375, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if os.sep == '\\\\':\n _CASE_INSENSITIVE_FILESYSTEM = True\nelse:\n try:\n _CASE_INSENSITIVE_FILESYSTEM = os.listdir('/tmp') == os.listdir('/TMP')\n except OSError:\n _CASE_INSENSITIVE_FILESYSTEM = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99839:Assign_L22_C4", "label": "_CASE_INSENSITIVE_FILESYSTEM =", "type": "assigned_variable", "loc": [22, 22], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99839:If_L21_C0", "vector": [14, 1, 0.2075, 0.0094, 1, 0.3, 0.0, 824, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "_CASE_INSENSITIVE_FILESYSTEM", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " _CASE_INSENSITIVE_FILESYSTEM = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99839:Try_L24_C4", "label": "try", "type": "try", "loc": [24, 27], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99839:If_L21_C0", "vector": [7, 1, 0.2406, 0.0377, 1, 0.3, 1.0, 0, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n _CASE_INSENSITIVE_FILESYSTEM = os.listdir('/tmp') == os.listdir('/TMP')\n except OSError:\n _CASE_INSENSITIVE_FILESYSTEM = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99839:Assign_L25_C8", "label": "_CASE_INSENSITIVE_FILESYSTEM =", "type": "assigned_variable", "loc": [25, 25], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99839:Try_L24_C4", "vector": [14, 2, 0.2358, 0.0094, 2, 0.99, 0.0, 824, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "_CASE_INSENSITIVE_FILESYSTEM", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " _CASE_INSENSITIVE_FILESYSTEM = os.listdir('/tmp') == os.listdir('/TMP')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99839:Assign_L27_C8", "label": "_CASE_INSENSITIVE_FILESYSTEM =", "type": "assigned_variable", "loc": [27, 27], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99839:Try_L24_C4", "vector": [14, 2, 0.2547, 0.0094, 2, 0.99, 0.0, 824, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "_CASE_INSENSITIVE_FILESYSTEM", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " _CASE_INSENSITIVE_FILESYSTEM = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99839:FunctionDef_L30_C0", "label": "normpath", "type": "function", "loc": [30, 39], "level": 0, "parent": null, "vector": [2, 0, 0.3255, 0.0943, 0, 0.66, 0.5, 638, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "normpath", "arg_names": ["path"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def normpath(path):\n \"\"\"Returns path in normalized and absolute format.\n\n On case-insensitive file systems the path is also case normalized.\n If that is not desired, abspath should be used instead.\n \"\"\"\n path = abspath(path)\n if _CASE_INSENSITIVE_FILESYSTEM:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99839:Expr_L31_C4", "label": "expression", "type": "expression", "loc": [31, 35], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99839:FunctionDef_L30_C0", "vector": [8, 1, 0.3113, 0.0472, 1, 0.97, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Returns path in normalized and absolute format.\n\n On case-insensitive file systems the path is also case normalized.\n If that is not desired, abspath should be used instead.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99839:Assign_L36_C4", "label": "path = abspath()", "type": "assigned_variable", "loc": [36, 36], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99839:FunctionDef_L30_C0", "vector": [14, 1, 0.3396, 0.0094, 1, 0.97, 0.3333, 358, 3, 1, 0, 0, 142, 10, 1], "semantic": {"name": "path", "arg_names": [], "import_names": [], "rhs_call_name": "abspath", "annotation": ""}, "snippet": " path = abspath(path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99839:If_L37_C4", "label": "if", "type": "if", "loc": [37, 38], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99839:FunctionDef_L30_C0", "vector": [4, 1, 0.3538, 0.0189, 1, 0.97, 0.6667, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if _CASE_INSENSITIVE_FILESYSTEM:\n path = path.lower()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99839:Assign_L38_C8", "label": "path = lower()", "type": "assigned_variable", "loc": [38, 38], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99839:If_L37_C4", "vector": [14, 2, 0.3585, 0.0094, 2, 0.29, 0.0, 358, 3, 0, 0, 0, 432, 10, 1], "semantic": {"name": "path", "arg_names": [], "import_names": [], "rhs_call_name": "lower", "annotation": ""}, "snippet": " path = path.lower()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99839:Return_L39_C4", "label": "return", "type": "return", "loc": [39, 39], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99839:FunctionDef_L30_C0", "vector": [13, 1, 0.3679, 0.0094, 1, 0.97, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return path"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99839:FunctionDef_L42_C0", "label": "abspath", "type": "function", "loc": [42, 54], "level": 0, "parent": null, "vector": [2, 0, 0.4528, 0.1226, 0, 0.66, 0.625, 142, 0, 1, 1, 0, 0, 0, 6], "semantic": {"name": "abspath", "arg_names": ["path"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def abspath(path):\n \"\"\"Replacement for os.path.abspath with some bug fixes and enhancements.\n\n 1) Converts non-Unicode paths to Unicode using file system encoding\n 2) At least Jython 2.5.1 on Windows returns wrong path with 'c:'.\n 3) Python until 2.6.5 and at least Jython 2.5.1 don't handle non-ASCII\n characters in the working directory: http://bugs.python.org/issue3426\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99839:Expr_L43_C4", "label": "expression", "type": "expression", "loc": [43, 49], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99839:FunctionDef_L42_C0", "vector": [8, 1, 0.434, 0.066, 1, 0.59, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Replacement for os.path.abspath with some bug fixes and enhancements.\n\n 1) Converts non-Unicode paths to Unicode using file system encoding\n 2) At least Jython 2.5.1 on Windows returns wrong path with 'c:'.\n 3) Python until 2.6.5 and at least Jython 2.5.1 don't handle non-ASCII\n characters in the working directory: http://bugs.python.org/issue3426\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99839:If_L50_C4", "label": "if", "type": "if", "loc": [50, 51], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99839:FunctionDef_L42_C0", "vector": [4, 1, 0.4764, 0.0189, 1, 0.59, 0.3333, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not isinstance(path, unicode):\n path = decode_from_file_system(path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99839:Assign_L51_C8", "label": "path = decode_from_file_system()", "type": "assigned_variable", "loc": [51, 51], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99839:If_L50_C4", "vector": [14, 2, 0.4811, 0.0094, 2, 0.08, 0.0, 358, 3, 1, 0, 0, 676, 10, 1], "semantic": {"name": "path", "arg_names": [], "import_names": [], "rhs_call_name": "decode_from_file_system", "annotation": ""}, "snippet": " path = decode_from_file_system(path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99839:If_L52_C4", "label": "if", "type": "if", "loc": [52, 53], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99839:FunctionDef_L42_C0", "vector": [4, 1, 0.4953, 0.0189, 1, 0.59, 0.6667, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if os.sep == '\\\\' and len(path) == 2 and path[1] == ':':\n return path + '\\\\'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99839:Return_L53_C8", "label": "return", "type": "return", "loc": [53, 53], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99839:If_L52_C4", "vector": [13, 2, 0.5, 0.0094, 2, 0.5, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return path + '\\\\'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99839:Return_L54_C4", "label": "return", "type": "return", "loc": [54, 54], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99839:FunctionDef_L42_C0", "vector": [13, 1, 0.5094, 0.0094, 1, 0.59, 1.0, 0, 3, 0, 0, 0, 0, 10, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return os.path.normpath(os.path.join(os.getcwdu(), path))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99839:FunctionDef_L57_C0", "label": "get_link_path", "type": "function", "loc": [57, 71], "level": 0, "parent": null, "vector": [2, 0, 0.6038, 0.1415, 0, 0.66, 0.75, 587, 0, 2, 1, 0, 0, 0, 8], "semantic": {"name": "get_link_path", "arg_names": ["target", "base"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def get_link_path(target, base):\n \"\"\"Returns a relative path to a target from a base.\n\n If base is an existing file, then its parent directory is considered.\n Otherwise, base is assumed to be a directory.\n\n Rationale: os.path.relpath is not available before Python 2.6\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99839:Expr_L58_C4", "label": "expression", "type": "expression", "loc": [58, 64], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99839:FunctionDef_L57_C0", "vector": [8, 1, 0.5755, 0.066, 1, 0.42, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Returns a relative path to a target from a base.\n\n If base is an existing file, then its parent directory is considered.\n Otherwise, base is assumed to be a directory.\n\n Rationale: os.path.relpath is not available before Python 2.6\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99839:Assign_L65_C4", "label": "pathname = _get_pathname()", "type": "assigned_variable", "loc": [65, 65], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99839:FunctionDef_L57_C0", "vector": [14, 1, 0.6132, 0.0094, 1, 0.42, 0.25, 624, 3, 2, 0, 0, 180, 10, 1], "semantic": {"name": "pathname", "arg_names": [], "import_names": [], "rhs_call_name": "_get_pathname", "annotation": ""}, "snippet": " pathname = _get_pathname(target, base)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99839:Assign_L66_C4", "label": "url = pathname2url()", "type": "assigned_variable", "loc": [66, 66], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99839:FunctionDef_L57_C0", "vector": [14, 1, 0.6226, 0.0094, 1, 0.42, 0.5, 789, 3, 1, 0, 0, 193, 10, 2], "semantic": {"name": "url", "arg_names": [], "import_names": [], "rhs_call_name": "pathname2url", "annotation": ""}, "snippet": " url = urllib.pathname2url(pathname.encode('UTF-8'))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99839:If_L67_C4", "label": "if", "type": "if", "loc": [67, 69], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99839:FunctionDef_L57_C0", "vector": [4, 1, 0.6415, 0.0283, 1, 0.42, 0.75, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if os.path.isabs(pathname):\n pre = url.startswith('/') and 'file:' or 'file:///'\n url = pre + url"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99839:Assign_L68_C8", "label": "pre =", "type": "assigned_variable", "loc": [68, 68], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99839:If_L67_C4", "vector": [14, 2, 0.6415, 0.0094, 2, 0.53, 0.0, 793, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "pre", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pre = url.startswith('/') and 'file:' or 'file:///'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99839:Assign_L69_C8", "label": "url =", "type": "assigned_variable", "loc": [69, 69], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99839:If_L67_C4", "vector": [14, 2, 0.6509, 0.0094, 2, 0.53, 1.0, 789, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "url", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " url = pre + url"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99839:Return_L71_C4", "label": "return", "type": "return", "loc": [71, 71], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99839:FunctionDef_L57_C0", "vector": [13, 1, 0.6698, 0.0094, 1, 0.42, 1.0, 0, 3, 0, 0, 0, 0, 10, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return url.replace('%5C', '/').replace('%3A', ':').replace('|', ':')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99839:FunctionDef_L73_C0", "label": "_get_pathname", "type": "function", "loc": [73, 90], "level": 0, "parent": null, "vector": [2, 0, 0.7689, 0.1698, 0, 0.66, 0.875, 180, 0, 2, 1, 0, 0, 0, 16], "semantic": {"name": "_get_pathname", "arg_names": ["target", "base"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def _get_pathname(target, base):\n target = abspath(target)\n base = abspath(base)\n if os.path.isfile(base):\n base = os.path.dirname(base)\n if base == target:\n return os.path.basename(target)\n base_drive, base_path = os.path.splitdrive(base)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99839:Assign_L74_C4", "label": "target = abspath()", "type": "assigned_variable", "loc": [74, 74], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99839:FunctionDef_L73_C0", "vector": [14, 1, 0.6981, 0.0094, 1, 0.77, 0.0, 766, 3, 1, 0, 0, 142, 10, 1], "semantic": {"name": "target", "arg_names": [], "import_names": [], "rhs_call_name": "abspath", "annotation": ""}, "snippet": " target = abspath(target)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99839:Assign_L75_C4", "label": "base = abspath()", "type": "assigned_variable", "loc": [75, 75], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99839:FunctionDef_L73_C0", "vector": [14, 1, 0.7075, 0.0094, 1, 0.77, 0.1, 47, 3, 1, 0, 0, 142, 10, 1], "semantic": {"name": "base", "arg_names": [], "import_names": [], "rhs_call_name": "abspath", "annotation": ""}, "snippet": " base = abspath(base)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99839:If_L76_C4", "label": "if", "type": "if", "loc": [76, 77], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99839:FunctionDef_L73_C0", "vector": [4, 1, 0.7217, 0.0189, 1, 0.77, 0.2, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if os.path.isfile(base):\n base = os.path.dirname(base)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99839:Assign_L77_C8", "label": "base = dirname()", "type": "assigned_variable", "loc": [77, 77], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99839:If_L76_C4", "vector": [14, 2, 0.7264, 0.0094, 2, 0.49, 0.0, 47, 3, 1, 0, 0, 959, 10, 1], "semantic": {"name": "base", "arg_names": [], "import_names": [], "rhs_call_name": "dirname", "annotation": ""}, "snippet": " base = os.path.dirname(base)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99839:If_L78_C4", "label": "if", "type": "if", "loc": [78, 79], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99839:FunctionDef_L73_C0", "vector": [4, 1, 0.7406, 0.0189, 1, 0.77, 0.3, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if base == target:\n return os.path.basename(target)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99839:Return_L79_C8", "label": "return", "type": "return", "loc": [79, 79], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99839:If_L78_C4", "vector": [13, 2, 0.7453, 0.0094, 2, 0.4, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return os.path.basename(target)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99839:Assign_L80_C4", "label": "base_drive, base_path = splitdrive()", "type": "assigned_variable", "loc": [80, 80], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99839:FunctionDef_L73_C0", "vector": [14, 1, 0.7547, 0.0094, 1, 0.77, 0.4, 633, 3, 1, 0, 0, 813, 10, 1], "semantic": {"name": "base_drive, base_path", "arg_names": [], "import_names": [], "rhs_call_name": "splitdrive", "annotation": ""}, "snippet": " base_drive, base_path = os.path.splitdrive(base)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99839:If_L82_C4", "label": "if", "type": "if", "loc": [82, 83], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99839:FunctionDef_L73_C0", "vector": [4, 1, 0.7783, 0.0189, 1, 0.77, 0.5, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if os.path.splitdrive(target)[0] != base_drive:\n return target"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99839:Return_L83_C8", "label": "return", "type": "return", "loc": [83, 83], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99839:If_L82_C4", "vector": [13, 2, 0.783, 0.0094, 2, 0.09, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return target"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99839:Assign_L84_C4", "label": "common_len = len()", "type": "assigned_variable", "loc": [84, 84], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99839:FunctionDef_L73_C0", "vector": [14, 1, 0.7925, 0.0094, 1, 0.77, 0.6, 692, 3, 1, 0, 0, 890, 10, 2], "semantic": {"name": "common_len", "arg_names": [], "import_names": [], "rhs_call_name": "len", "annotation": ""}, "snippet": " common_len = len(_common_path(base, target))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99839:If_L85_C4", "label": "if", "type": "if", "loc": [85, 86], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99839:FunctionDef_L73_C0", "vector": [4, 1, 0.8066, 0.0189, 1, 0.77, 0.7, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if base_path == os.sep:\n return target[common_len:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99839:Return_L86_C8", "label": "return", "type": "return", "loc": [86, 86], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99839:If_L85_C4", "vector": [13, 2, 0.8113, 0.0094, 2, 0.05, 0.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return target[common_len:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99839:If_L87_C4", "label": "if", "type": "if", "loc": [87, 88], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99839:FunctionDef_L73_C0", "vector": [4, 1, 0.8255, 0.0189, 1, 0.77, 0.8, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if common_len == len(base_drive) + len(os.sep):\n common_len -= len(os.sep)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99839:Assign_L89_C4", "label": "dirs_up = join()", "type": "assigned_variable", "loc": [89, 89], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99839:FunctionDef_L73_C0", "vector": [14, 1, 0.8396, 0.0094, 1, 0.77, 0.9, 639, 3, 1, 0, 0, 933, 10, 2], "semantic": {"name": "dirs_up", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": " dirs_up = os.sep.join([os.pardir] * base[common_len:].count(os.sep))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99839:Return_L90_C4", "label": "return", "type": "return", "loc": [90, 90], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99839:FunctionDef_L73_C0", "vector": [13, 1, 0.8491, 0.0094, 1, 0.77, 1.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return os.path.join(dirs_up, target[common_len + len(os.sep):])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99839:FunctionDef_L92_C0", "label": "_common_path", "type": "function", "loc": [92, 106], "level": 0, "parent": null, "vector": [2, 0, 0.934, 0.1415, 0, 0.66, 1.0, 245, 0, 2, 1, 0, 0, 0, 4], "semantic": {"name": "_common_path", "arg_names": ["p1", "p2"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def _common_path(p1, p2):\n \"\"\"Returns the longest path common to p1 and p2.\n\n Rationale: as os.path.commonprefix is character based, it doesn't consider\n path separators as such, so it may return invalid paths:\n commonprefix(('/foo/bar/', '/foo/baz.txt')) -> '/foo/ba' (instead of /foo)\n \"\"\"\n while p1 and p2:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99839:Expr_L93_C4", "label": "expression", "type": "expression", "loc": [93, 98], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99839:FunctionDef_L92_C0", "vector": [8, 1, 0.9009, 0.0566, 1, 0.96, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Returns the longest path common to p1 and p2.\n\n Rationale: as os.path.commonprefix is character based, it doesn't consider\n path separators as such, so it may return invalid paths:\n commonprefix(('/foo/bar/', '/foo/baz.txt')) -> '/foo/ba' (instead of /foo)\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99839:While_L99_C4", "label": "while", "type": "while", "loc": [99, 105], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99839:FunctionDef_L92_C0", "vector": [5, 1, 0.9623, 0.066, 1, 0.96, 0.5, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while p1 and p2:\n if p1 == p2:\n return p1\n if len(p1) > len(p2):\n p1 = os.path.dirname(p1)\n else:\n p2 = os.path.dirname(p2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99839:If_L100_C8", "label": "if", "type": "if", "loc": [100, 101], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99839:While_L99_C4", "vector": [4, 2, 0.9481, 0.0189, 2, 0.56, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if p1 == p2:\n return p1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99839:Return_L101_C12", "label": "return", "type": "return", "loc": [101, 101], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99839:If_L100_C8", "vector": [13, 3, 0.9528, 0.0094, 3, 0.79, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return p1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99839:If_L102_C8", "label": "if", "type": "if", "loc": [102, 105], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99839:While_L99_C4", "vector": [4, 2, 0.9764, 0.0377, 2, 0.56, 1.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(p1) > len(p2):\n p1 = os.path.dirname(p1)\n else:\n p2 = os.path.dirname(p2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99839:Assign_L103_C12", "label": "p1 = dirname()", "type": "assigned_variable", "loc": [103, 103], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99839:If_L102_C8", "vector": [14, 3, 0.9717, 0.0094, 3, 0.06, 0.0, 87, 3, 1, 0, 0, 959, 10, 1], "semantic": {"name": "p1", "arg_names": [], "import_names": [], "rhs_call_name": "dirname", "annotation": ""}, "snippet": " p1 = os.path.dirname(p1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99839:Assign_L105_C12", "label": "p2 = dirname()", "type": "assigned_variable", "loc": [105, 105], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99839:If_L102_C8", "vector": [14, 3, 0.9906, 0.0094, 3, 0.06, 1.0, 843, 3, 1, 0, 0, 959, 10, 1], "semantic": {"name": "p2", "arg_names": [], "import_names": [], "rhs_call_name": "dirname", "annotation": ""}, "snippet": " p2 = os.path.dirname(p2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99839:Return_L106_C4", "label": "return", "type": "return", "loc": [106, 106], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99839:FunctionDef_L92_C0", "vector": [13, 1, 1.0, 0.0094, 1, 0.96, 1.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ''"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99839:If_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99839:Assign_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99839:If_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99839:Try_L24_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99839:Try_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99839:Assign_L25_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99839:Try_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99839:Assign_L27_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99839:FunctionDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99839:Expr_L31_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99839:FunctionDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99839:Assign_L36_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99839:FunctionDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99839:If_L37_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99839:If_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99839:Assign_L38_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99839:FunctionDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99839:Return_L39_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99839:FunctionDef_L42_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99839:Expr_L43_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99839:FunctionDef_L42_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99839:If_L50_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99839:If_L50_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99839:Assign_L51_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99839:FunctionDef_L42_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99839:If_L52_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99839:If_L52_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99839:Return_L53_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99839:FunctionDef_L42_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99839:Return_L54_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99839:FunctionDef_L57_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99839:Expr_L58_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99839:FunctionDef_L57_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99839:Assign_L65_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99839:FunctionDef_L57_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99839:Assign_L66_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99839:FunctionDef_L57_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99839:If_L67_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99839:If_L67_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99839:Assign_L68_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99839:If_L67_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99839:Assign_L69_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99839:FunctionDef_L57_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99839:Return_L71_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99839:FunctionDef_L73_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99839:Assign_L74_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99839:FunctionDef_L73_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99839:Assign_L75_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99839:FunctionDef_L73_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99839:If_L76_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99839:If_L76_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99839:Assign_L77_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99839:FunctionDef_L73_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99839:If_L78_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99839:If_L78_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99839:Return_L79_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99839:FunctionDef_L73_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99839:Assign_L80_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99839:FunctionDef_L73_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99839:If_L82_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99839:If_L82_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99839:Return_L83_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99839:FunctionDef_L73_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99839:Assign_L84_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99839:FunctionDef_L73_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99839:If_L85_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99839:If_L85_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99839:Return_L86_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99839:FunctionDef_L73_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99839:If_L87_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99839:FunctionDef_L73_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99839:Assign_L89_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99839:FunctionDef_L73_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99839:Return_L90_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99839:FunctionDef_L92_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99839:Expr_L93_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99839:FunctionDef_L92_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99839:While_L99_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99839:While_L99_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99839:If_L100_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99839:If_L100_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99839:Return_L101_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99839:While_L99_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99839:If_L102_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99839:If_L102_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99839:Assign_L103_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99839:If_L102_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99839:Assign_L105_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99839:FunctionDef_L92_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99839:Return_L106_C4"}] |
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from abstractxmlwriter import AbstractXmlWriter
from htmlutils import html_escape, html_attr_escape
from unic import unic
class HtmlWriter(AbstractXmlWriter):
def __init__(self, output):
"""'output' is an open file object.
Given 'output' must have been opened in 'wb' mode to be able to
write into it with UTF-8 encoding.
"""
self.output = output
def start(self, name, attrs=None, newline=True):
self._start(name, attrs, newline=newline)
def start_and_end(self, name, attrs=None, newline=True):
self._start(name, attrs, close=True, newline=newline)
def content(self, content=None, escape=True):
"""Given content doesn't need to be a string"""
if content is not None:
if escape:
content = html_escape(unic(content))
self._write(content)
def end(self, name, newline=True):
self._write('</%s>%s' % (name, '\n' if newline else ''))
def element(self, name, content=None, attrs=None, escape=True,
newline=True):
self.start(name, attrs, newline=False)
self.content(content, escape)
self.end(name, newline)
def start_many(self, names, newline=True):
for name in names:
self.start(name, newline=newline)
def end_many(self, names, newline=True):
for name in names:
self.end(name, newline)
def _start(self, name, attrs, close=False, newline=True):
self._write('<%s%s%s>%s' % (name, self._get_attrs(attrs),
' /' if close else '',
'\n' if newline else ''))
def _get_attrs(self, attrs):
if not attrs:
return ''
return ' ' + ' '.join('%s="%s"' % (name, html_attr_escape(attrs[name]))
for name in sorted(attrs))
def _write(self, text):
self.output.write(text.encode('UTF-8'))
| ajibawa-2023/Python-Code-Large/train/row_99841 | 37 | 72 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99841:ImportFrom_L15_C0", "label": "from abstractxmlwriter import AbstractXmlWriter", "type": "import", "loc": [15, 15], "level": 0, "parent": null, "vector": [1, 0, 0.2083, 0.0139, 0, 0.66, 0.0, 993, 0, 1, 0, 0, 993, 0, 0], "semantic": {"name": "abstractxmlwriter", "arg_names": [], "import_names": ["AbstractXmlWriter"], "rhs_call_name": "", "annotation": ""}, "snippet": "from abstractxmlwriter import AbstractXmlWriter"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99841:ImportFrom_L16_C0", "label": "from htmlutils import html_escape, html_attr_escape", "type": "import", "loc": [16, 16], "level": 0, "parent": null, "vector": [1, 0, 0.2222, 0.0139, 0, 0.66, 0.3333, 801, 0, 2, 0, 0, 801, 0, 0], "semantic": {"name": "htmlutils", "arg_names": [], "import_names": ["html_escape", "html_attr_escape"], "rhs_call_name": "", "annotation": ""}, "snippet": "from htmlutils import html_escape, html_attr_escape"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99841:ImportFrom_L17_C0", "label": "from unic import unic", "type": "import", "loc": [17, 17], "level": 0, "parent": null, "vector": [1, 0, 0.2361, 0.0139, 0, 0.66, 0.6667, 992, 0, 1, 0, 0, 992, 0, 0], "semantic": {"name": "unic", "arg_names": [], "import_names": ["unic"], "rhs_call_name": "", "annotation": ""}, "snippet": "from unic import unic"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99841:ClassDef_L20_C0", "label": "HtmlWriter", "type": "class", "loc": [20, 72], "level": 0, "parent": null, "vector": [3, 0, 0.6389, 0.7361, 0, 0.66, 1.0, 444, 0, 11, 0, 0, 934, 0, 18], "semantic": {"name": "HtmlWriter", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class HtmlWriter(AbstractXmlWriter):\n\n def __init__(self, output):\n \"\"\"'output' is an open file object.\n\n Given 'output' must have been opened in 'wb' mode to be able to\n write into it with UTF-8 encoding.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99841:FunctionDef_L22_C4", "label": "__init__", "type": "function", "loc": [22, 28], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99841:ClassDef_L20_C0", "vector": [2, 1, 0.3472, 0.0972, 1, 0.71, 0.0, 555, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "output"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, output):\n \"\"\"'output' is an open file object.\n\n Given 'output' must have been opened in 'wb' mode to be able to\n write into it with UTF-8 encoding.\n \"\"\"\n self.output = output"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99841:Expr_L23_C8", "label": "expression", "type": "expression", "loc": [23, 27], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99841:FunctionDef_L22_C4", "vector": [8, 2, 0.3472, 0.0694, 2, 0.87, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"'output' is an open file object.\n\n Given 'output' must have been opened in 'wb' mode to be able to\n write into it with UTF-8 encoding.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99841:Assign_L28_C8", "label": "self.output =", "type": "assigned_variable", "loc": [28, 28], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99841:FunctionDef_L22_C4", "vector": [14, 2, 0.3889, 0.0139, 2, 0.87, 1.0, 815, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.output", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.output = output"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99841:FunctionDef_L30_C4", "label": "start", "type": "function", "loc": [30, 31], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99841:ClassDef_L20_C0", "vector": [2, 1, 0.4236, 0.0278, 1, 0.71, 0.1, 511, 0, 4, 0, 0, 0, 0, 1], "semantic": {"name": "start", "arg_names": ["self", "name", "attrs", "newline"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def start(self, name, attrs=None, newline=True):\n self._start(name, attrs, newline=newline)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99841:Expr_L31_C8", "label": "_start()", "type": "expression", "loc": [31, 31], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99841:FunctionDef_L30_C4", "vector": [8, 2, 0.4306, 0.0139, 2, 0.6, 0.0, 212, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "_start", "arg_names": [], "import_names": [], "rhs_call_name": "_start", "annotation": ""}, "snippet": " self._start(name, attrs, newline=newline)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99841:FunctionDef_L33_C4", "label": "start_and_end", "type": "function", "loc": [33, 34], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99841:ClassDef_L20_C0", "vector": [2, 1, 0.4653, 0.0278, 1, 0.71, 0.2, 665, 0, 4, 0, 0, 0, 0, 1], "semantic": {"name": "start_and_end", "arg_names": ["self", "name", "attrs", "newline"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def start_and_end(self, name, attrs=None, newline=True):\n self._start(name, attrs, close=True, newline=newline)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99841:Expr_L34_C8", "label": "_start()", "type": "expression", "loc": [34, 34], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99841:FunctionDef_L33_C4", "vector": [8, 2, 0.4722, 0.0139, 2, 0.7, 0.0, 212, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "_start", "arg_names": [], "import_names": [], "rhs_call_name": "_start", "annotation": ""}, "snippet": " self._start(name, attrs, close=True, newline=newline)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99841:FunctionDef_L36_C4", "label": "content", "type": "function", "loc": [36, 41], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99841:ClassDef_L20_C0", "vector": [2, 1, 0.5347, 0.0833, 1, 0.71, 0.3, 273, 0, 3, 0, 0, 0, 0, 3], "semantic": {"name": "content", "arg_names": ["self", "content", "escape"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def content(self, content=None, escape=True):\n \"\"\"Given content doesn't need to be a string\"\"\"\n if content is not None:\n if escape:\n content = html_escape(unic(content))\n self._write(content)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99841:Expr_L37_C8", "label": "expression", "type": "expression", "loc": [37, 37], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99841:FunctionDef_L36_C4", "vector": [8, 2, 0.5139, 0.0139, 2, 0.07, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Given content doesn't need to be a string\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99841:If_L38_C8", "label": "if", "type": "if", "loc": [38, 41], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99841:FunctionDef_L36_C4", "vector": [4, 2, 0.5486, 0.0556, 2, 0.07, 1.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if content is not None:\n if escape:\n content = html_escape(unic(content))\n self._write(content)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99841:If_L39_C12", "label": "if", "type": "if", "loc": [39, 40], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99841:If_L38_C8", "vector": [4, 3, 0.5486, 0.0278, 3, 0.99, 0.0, 0, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if escape:\n content = html_escape(unic(content))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99841:Assign_L40_C16", "label": "content = html_escape()", "type": "assigned_variable", "loc": [40, 40], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99841:If_L39_C12", "vector": [14, 4, 0.5556, 0.0139, 4, 0.22, 0.0, 273, 3, 1, 0, 0, 435, 10, 2], "semantic": {"name": "content", "arg_names": [], "import_names": [], "rhs_call_name": "html_escape", "annotation": ""}, "snippet": " content = html_escape(unic(content))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99841:Expr_L41_C12", "label": "_write()", "type": "expression", "loc": [41, 41], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99841:If_L38_C8", "vector": [8, 3, 0.5694, 0.0139, 3, 0.99, 1.0, 961, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_write", "arg_names": [], "import_names": [], "rhs_call_name": "_write", "annotation": ""}, "snippet": " self._write(content)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99841:FunctionDef_L43_C4", "label": "end", "type": "function", "loc": [43, 44], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99841:ClassDef_L20_C0", "vector": [2, 1, 0.6042, 0.0278, 1, 0.71, 0.4, 128, 0, 3, 0, 0, 0, 0, 1], "semantic": {"name": "end", "arg_names": ["self", "name", "newline"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def end(self, name, newline=True):\n self._write('</%s>%s' % (name, '\\n' if newline else ''))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99841:Expr_L44_C8", "label": "_write()", "type": "expression", "loc": [44, 44], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99841:FunctionDef_L43_C4", "vector": [8, 2, 0.6111, 0.0139, 2, 0.31, 0.0, 961, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_write", "arg_names": [], "import_names": [], "rhs_call_name": "_write", "annotation": ""}, "snippet": " self._write('</%s>%s' % (name, '\\n' if newline else ''))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99841:FunctionDef_L46_C4", "label": "element", "type": "function", "loc": [46, 50], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99841:ClassDef_L20_C0", "vector": [2, 1, 0.6667, 0.0694, 1, 0.71, 0.5, 736, 0, 6, 0, 0, 0, 0, 3], "semantic": {"name": "element", "arg_names": ["self", "name", "content", "attrs", "escape", "newline"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def element(self, name, content=None, attrs=None, escape=True,\n newline=True):\n self.start(name, attrs, newline=False)\n self.content(content, escape)\n self.end(name, newline)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99841:Expr_L48_C8", "label": "start()", "type": "expression", "loc": [48, 48], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99841:FunctionDef_L46_C4", "vector": [8, 2, 0.6667, 0.0139, 2, 0.27, 0.0, 511, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "start", "arg_names": [], "import_names": [], "rhs_call_name": "start", "annotation": ""}, "snippet": " self.start(name, attrs, newline=False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99841:Expr_L49_C8", "label": "content()", "type": "expression", "loc": [49, 49], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99841:FunctionDef_L46_C4", "vector": [8, 2, 0.6806, 0.0139, 2, 0.27, 0.5, 273, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "content", "arg_names": [], "import_names": [], "rhs_call_name": "content", "annotation": ""}, "snippet": " self.content(content, escape)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99841:Expr_L50_C8", "label": "end()", "type": "expression", "loc": [50, 50], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99841:FunctionDef_L46_C4", "vector": [8, 2, 0.6944, 0.0139, 2, 0.27, 1.0, 128, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "end", "arg_names": [], "import_names": [], "rhs_call_name": "end", "annotation": ""}, "snippet": " self.end(name, newline)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99841:FunctionDef_L52_C4", "label": "start_many", "type": "function", "loc": [52, 54], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99841:ClassDef_L20_C0", "vector": [2, 1, 0.7361, 0.0417, 1, 0.71, 0.6, 993, 0, 3, 0, 0, 0, 0, 1], "semantic": {"name": "start_many", "arg_names": ["self", "names", "newline"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def start_many(self, names, newline=True):\n for name in names:\n self.start(name, newline=newline)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99841:For_L53_C8", "label": "for name", "type": "for", "loc": [53, 54], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99841:FunctionDef_L52_C4", "vector": [6, 2, 0.7431, 0.0278, 2, 0.94, 0.0, 57, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for name in names:\n self.start(name, newline=newline)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99841:Expr_L54_C12", "label": "start()", "type": "expression", "loc": [54, 54], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99841:For_L53_C8", "vector": [8, 3, 0.75, 0.0139, 3, 0.56, 0.0, 511, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "start", "arg_names": [], "import_names": [], "rhs_call_name": "start", "annotation": ""}, "snippet": " self.start(name, newline=newline)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99841:FunctionDef_L56_C4", "label": "end_many", "type": "function", "loc": [56, 58], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99841:ClassDef_L20_C0", "vector": [2, 1, 0.7917, 0.0417, 1, 0.71, 0.7, 555, 0, 3, 0, 0, 0, 0, 1], "semantic": {"name": "end_many", "arg_names": ["self", "names", "newline"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def end_many(self, names, newline=True):\n for name in names:\n self.end(name, newline)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99841:For_L57_C8", "label": "for name", "type": "for", "loc": [57, 58], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99841:FunctionDef_L56_C4", "vector": [6, 2, 0.7986, 0.0278, 2, 0.2, 0.0, 57, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for name in names:\n self.end(name, newline)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99841:Expr_L58_C12", "label": "end()", "type": "expression", "loc": [58, 58], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99841:For_L57_C8", "vector": [8, 3, 0.8056, 0.0139, 3, 0.35, 0.0, 128, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "end", "arg_names": [], "import_names": [], "rhs_call_name": "end", "annotation": ""}, "snippet": " self.end(name, newline)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99841:FunctionDef_L60_C4", "label": "_start", "type": "function", "loc": [60, 63], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99841:ClassDef_L20_C0", "vector": [2, 1, 0.8542, 0.0556, 1, 0.71, 0.8, 212, 0, 5, 0, 0, 0, 0, 2], "semantic": {"name": "_start", "arg_names": ["self", "name", "attrs", "close", "newline"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _start(self, name, attrs, close=False, newline=True):\n self._write('<%s%s%s>%s' % (name, self._get_attrs(attrs),\n ' /' if close else '',\n '\\n' if newline else ''))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99841:Expr_L61_C8", "label": "_write()", "type": "expression", "loc": [61, 63], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99841:FunctionDef_L60_C4", "vector": [8, 2, 0.8611, 0.0417, 2, 0.76, 0.0, 961, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "_write", "arg_names": [], "import_names": [], "rhs_call_name": "_write", "annotation": ""}, "snippet": " self._write('<%s%s%s>%s' % (name, self._get_attrs(attrs),\n ' /' if close else '',\n '\\n' if newline else ''))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99841:FunctionDef_L65_C4", "label": "_get_attrs", "type": "function", "loc": [65, 69], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99841:ClassDef_L20_C0", "vector": [2, 1, 0.9306, 0.0694, 1, 0.71, 0.9, 866, 0, 2, 1, 0, 0, 0, 3], "semantic": {"name": "_get_attrs", "arg_names": ["self", "attrs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _get_attrs(self, attrs):\n if not attrs:\n return ''\n return ' ' + ' '.join('%s=\"%s\"' % (name, html_attr_escape(attrs[name]))\n for name in sorted(attrs))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99841:If_L66_C8", "label": "if", "type": "if", "loc": [66, 67], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99841:FunctionDef_L65_C4", "vector": [4, 2, 0.9236, 0.0278, 2, 0.39, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not attrs:\n return ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99841:Return_L67_C12", "label": "return", "type": "return", "loc": [67, 67], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99841:If_L66_C8", "vector": [13, 3, 0.9306, 0.0139, 3, 0.92, 0.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99841:Return_L68_C8", "label": "return", "type": "return", "loc": [68, 69], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99841:FunctionDef_L65_C4", "vector": [13, 2, 0.9514, 0.0278, 2, 0.39, 1.0, 0, 4, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ' ' + ' '.join('%s=\"%s\"' % (name, html_attr_escape(attrs[name]))\n for name in sorted(attrs))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99841:FunctionDef_L71_C4", "label": "_write", "type": "function", "loc": [71, 72], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99841:ClassDef_L20_C0", "vector": [2, 1, 0.9931, 0.0278, 1, 0.71, 1.0, 961, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "_write", "arg_names": ["self", "text"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _write(self, text):\n self.output.write(text.encode('UTF-8'))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99841:Expr_L72_C8", "label": "write()", "type": "expression", "loc": [72, 72], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99841:FunctionDef_L71_C4", "vector": [8, 2, 1.0, 0.0139, 2, 0.15, 0.0, 837, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " self.output.write(text.encode('UTF-8'))"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99841:ClassDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99841:FunctionDef_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99841:FunctionDef_L22_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99841:Expr_L23_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99841:FunctionDef_L22_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99841:Assign_L28_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99841:ClassDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99841:FunctionDef_L30_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99841:FunctionDef_L30_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99841:Expr_L31_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99841:ClassDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99841:FunctionDef_L33_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99841:FunctionDef_L33_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99841:Expr_L34_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99841:ClassDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99841:FunctionDef_L36_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99841:FunctionDef_L36_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99841:Expr_L37_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99841:FunctionDef_L36_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99841:If_L38_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99841:If_L38_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99841:If_L39_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99841:If_L39_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99841:Assign_L40_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99841:If_L38_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99841:Expr_L41_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99841:ClassDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99841:FunctionDef_L43_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99841:FunctionDef_L43_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99841:Expr_L44_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99841:ClassDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99841:FunctionDef_L46_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99841:FunctionDef_L46_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99841:Expr_L48_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99841:FunctionDef_L46_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99841:Expr_L49_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99841:FunctionDef_L46_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99841:Expr_L50_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99841:ClassDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99841:FunctionDef_L52_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99841:FunctionDef_L52_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99841:For_L53_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99841:For_L53_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99841:Expr_L54_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99841:ClassDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99841:FunctionDef_L56_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99841:FunctionDef_L56_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99841:For_L57_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99841:For_L57_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99841:Expr_L58_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99841:ClassDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99841:FunctionDef_L60_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99841:FunctionDef_L60_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99841:Expr_L61_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99841:ClassDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99841:FunctionDef_L65_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99841:FunctionDef_L65_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99841:If_L66_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99841:If_L66_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99841:Return_L67_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99841:FunctionDef_L65_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99841:Return_L68_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99841:ClassDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99841:FunctionDef_L71_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99841:FunctionDef_L71_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99841:Expr_L72_C8"}] |
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from unic import unic
from misc import seq2str2
from charwidth import get_char_width
_MAX_ASSIGN_LENGTH = 200
_MAX_ERROR_LINES = 40
_MAX_ERROR_LINE_LENGTH = 78
_ERROR_CUT_EXPLN = (' [ Message content over the limit has been removed. ]')
def cut_long_message(msg):
lines = msg.splitlines()
lengths = _count_line_lenghts(lines)
if sum(lengths) <= _MAX_ERROR_LINES:
return msg
start = _prune_excess_lines(lines, lengths)
end = _prune_excess_lines(lines, lengths, True)
return '\n'.join(start + [_ERROR_CUT_EXPLN] + end)
def _prune_excess_lines(lines, lengths, from_end=False):
if from_end:
lines.reverse()
lengths.reverse()
ret = []
total = 0
limit = _MAX_ERROR_LINES/2
for line, length in zip(lines[:limit], lengths[:limit]):
if total + length >= limit:
ret.append(_cut_long_line(line, total, from_end))
break
total += length
ret.append(line)
if from_end:
ret.reverse()
return ret
def _cut_long_line(line, used, from_end):
available_lines = _MAX_ERROR_LINES/2 - used
available_chars = available_lines * _MAX_ERROR_LINE_LENGTH - 3
if len(line) > available_chars:
if not from_end:
line = line[:available_chars] + '...'
else:
line = '...' + line[-available_chars:]
return line
def _count_line_lenghts(lines):
return [ _count_virtual_line_length(line) for line in lines ]
def _count_virtual_line_length(line):
length = len(line) / _MAX_ERROR_LINE_LENGTH
if not len(line) % _MAX_ERROR_LINE_LENGTH == 0 or len(line) == 0:
length += 1
return length
def format_assign_message(variable, value, cut_long=True):
value = unic(value) if variable.startswith('$') else seq2str2(value)
if cut_long and len(value) > _MAX_ASSIGN_LENGTH:
value = value[:_MAX_ASSIGN_LENGTH] + '...'
return '%s = %s' % (variable, value)
def get_console_length(text):
return sum(get_char_width(char) for char in text)
def pad_console_length(text, width, cut_left=False):
if width < 5:
width = 5
diff = get_console_length(text) - width
if diff <= 0:
return _pad_width(text, width)
if cut_left:
return _pad_width('...'+_lose_width_left(text, diff+3), width)
return _pad_width(_lose_width_right(text, diff+3)+'...', width)
def _pad_width(text, width):
more = width - get_console_length(text)
return text + ' ' * more
def _lose_width_right(text, diff):
return _lose_width(text, diff, -1, slice(None, -1))
def _lose_width_left(text, diff):
return _lose_width(text, diff, 0, slice(1, None))
def _lose_width(text, diff, index, slice):
lost = 0
while lost < diff:
lost += get_console_length(text[index])
text = text[slice]
return text | ajibawa-2023/Python-Code-Large/train/row_99842 | 71 | 108 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99842:ImportFrom_L15_C0", "label": "from unic import unic", "type": "import", "loc": [15, 15], "level": 0, "parent": null, "vector": [1, 0, 0.1389, 0.0093, 0, 0.66, 0.0, 992, 0, 1, 0, 0, 992, 0, 0], "semantic": {"name": "unic", "arg_names": [], "import_names": ["unic"], "rhs_call_name": "", "annotation": ""}, "snippet": "from unic import unic"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99842:ImportFrom_L16_C0", "label": "from misc import seq2str2", "type": "import", "loc": [16, 16], "level": 0, "parent": null, "vector": [1, 0, 0.1481, 0.0093, 0, 0.66, 0.0556, 733, 0, 1, 0, 0, 733, 0, 0], "semantic": {"name": "misc", "arg_names": [], "import_names": ["seq2str2"], "rhs_call_name": "", "annotation": ""}, "snippet": "from misc import seq2str2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99842:ImportFrom_L17_C0", "label": "from charwidth import get_char_width", "type": "import", "loc": [17, 17], "level": 0, "parent": null, "vector": [1, 0, 0.1574, 0.0093, 0, 0.66, 0.1111, 129, 0, 1, 0, 0, 129, 0, 0], "semantic": {"name": "charwidth", "arg_names": [], "import_names": ["get_char_width"], "rhs_call_name": "", "annotation": ""}, "snippet": "from charwidth import get_char_width"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99842:Assign_L20_C0", "label": "_MAX_ASSIGN_LENGTH =", "type": "assigned_variable", "loc": [20, 20], "level": 0, "parent": null, "vector": [14, 0, 0.1852, 0.0093, 0, 0.66, 0.1667, 458, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "_MAX_ASSIGN_LENGTH", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "_MAX_ASSIGN_LENGTH = 200"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99842:Assign_L21_C0", "label": "_MAX_ERROR_LINES =", "type": "assigned_variable", "loc": [21, 21], "level": 0, "parent": null, "vector": [14, 0, 0.1944, 0.0093, 0, 0.66, 0.2222, 658, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "_MAX_ERROR_LINES", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "_MAX_ERROR_LINES = 40"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99842:Assign_L22_C0", "label": "_MAX_ERROR_LINE_LENGTH =", "type": "assigned_variable", "loc": [22, 22], "level": 0, "parent": null, "vector": [14, 0, 0.2037, 0.0093, 0, 0.66, 0.2778, 204, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "_MAX_ERROR_LINE_LENGTH", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "_MAX_ERROR_LINE_LENGTH = 78"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99842:Assign_L23_C0", "label": "_ERROR_CUT_EXPLN =", "type": "assigned_variable", "loc": [23, 23], "level": 0, "parent": null, "vector": [14, 0, 0.213, 0.0093, 0, 0.66, 0.3333, 224, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "_ERROR_CUT_EXPLN", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "_ERROR_CUT_EXPLN = (' [ Message content over the limit has been removed. ]')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99842:FunctionDef_L26_C0", "label": "cut_long_message", "type": "function", "loc": [26, 33], "level": 0, "parent": null, "vector": [2, 0, 0.2731, 0.0741, 0, 0.66, 0.3889, 812, 0, 1, 1, 0, 0, 0, 6], "semantic": {"name": "cut_long_message", "arg_names": ["msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def cut_long_message(msg):\n lines = msg.splitlines()\n lengths = _count_line_lenghts(lines)\n if sum(lengths) <= _MAX_ERROR_LINES:\n return msg\n start = _prune_excess_lines(lines, lengths)\n end = _prune_excess_lines(lines, lengths, True)\n return '\\n'.join(start + [_ERROR_CUT_EXPLN] + end)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99842:Assign_L27_C4", "label": "lines = splitlines()", "type": "assigned_variable", "loc": [27, 27], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99842:FunctionDef_L26_C0", "vector": [14, 1, 0.25, 0.0093, 1, 0.65, 0.0, 73, 3, 0, 0, 0, 296, 10, 1], "semantic": {"name": "lines", "arg_names": [], "import_names": [], "rhs_call_name": "splitlines", "annotation": ""}, "snippet": " lines = msg.splitlines()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99842:Assign_L28_C4", "label": "lengths = _count_line_lenghts()", "type": "assigned_variable", "loc": [28, 28], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99842:FunctionDef_L26_C0", "vector": [14, 1, 0.2593, 0.0093, 1, 0.65, 0.2, 214, 3, 1, 0, 0, 199, 10, 1], "semantic": {"name": "lengths", "arg_names": [], "import_names": [], "rhs_call_name": "_count_line_lenghts", "annotation": ""}, "snippet": " lengths = _count_line_lenghts(lines)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99842:If_L29_C4", "label": "if", "type": "if", "loc": [29, 30], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99842:FunctionDef_L26_C0", "vector": [4, 1, 0.2731, 0.0185, 1, 0.65, 0.4, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if sum(lengths) <= _MAX_ERROR_LINES:\n return msg"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99842:Return_L30_C8", "label": "return", "type": "return", "loc": [30, 30], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99842:If_L29_C4", "vector": [13, 2, 0.2778, 0.0093, 2, 0.03, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return msg"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99842:Assign_L31_C4", "label": "start = _prune_excess_lines()", "type": "assigned_variable", "loc": [31, 31], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99842:FunctionDef_L26_C0", "vector": [14, 1, 0.287, 0.0093, 1, 0.65, 0.6, 511, 3, 2, 0, 0, 911, 10, 1], "semantic": {"name": "start", "arg_names": [], "import_names": [], "rhs_call_name": "_prune_excess_lines", "annotation": ""}, "snippet": " start = _prune_excess_lines(lines, lengths)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99842:Assign_L32_C4", "label": "end = _prune_excess_lines()", "type": "assigned_variable", "loc": [32, 32], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99842:FunctionDef_L26_C0", "vector": [14, 1, 0.2963, 0.0093, 1, 0.65, 0.8, 128, 3, 3, 0, 0, 911, 10, 1], "semantic": {"name": "end", "arg_names": [], "import_names": [], "rhs_call_name": "_prune_excess_lines", "annotation": ""}, "snippet": " end = _prune_excess_lines(lines, lengths, True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99842:Return_L33_C4", "label": "return", "type": "return", "loc": [33, 33], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99842:FunctionDef_L26_C0", "vector": [13, 1, 0.3056, 0.0093, 1, 0.65, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return '\\n'.join(start + [_ERROR_CUT_EXPLN] + end)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99842:FunctionDef_L35_C0", "label": "_prune_excess_lines", "type": "function", "loc": [35, 50], "level": 0, "parent": null, "vector": [2, 0, 0.3935, 0.1481, 0, 0.66, 0.4444, 911, 0, 3, 1, 0, 0, 0, 7], "semantic": {"name": "_prune_excess_lines", "arg_names": ["lines", "lengths", "from_end"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def _prune_excess_lines(lines, lengths, from_end=False):\n if from_end:\n lines.reverse()\n lengths.reverse()\n ret = []\n total = 0\n limit = _MAX_ERROR_LINES/2\n for line, length in zip(lines[:limit], lengths[:limit]):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99842:If_L36_C4", "label": "if", "type": "if", "loc": [36, 38], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99842:FunctionDef_L35_C0", "vector": [4, 1, 0.3426, 0.0278, 1, 0.36, 0.0, 0, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if from_end:\n lines.reverse()\n lengths.reverse()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99842:Expr_L37_C8", "label": "reverse()", "type": "expression", "loc": [37, 37], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99842:If_L36_C4", "vector": [8, 2, 0.3426, 0.0093, 2, 0.9, 0.0, 109, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "reverse", "arg_names": [], "import_names": [], "rhs_call_name": "reverse", "annotation": ""}, "snippet": " lines.reverse()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99842:Expr_L38_C8", "label": "reverse()", "type": "expression", "loc": [38, 38], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99842:If_L36_C4", "vector": [8, 2, 0.3519, 0.0093, 2, 0.9, 1.0, 109, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "reverse", "arg_names": [], "import_names": [], "rhs_call_name": "reverse", "annotation": ""}, "snippet": " lengths.reverse()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99842:Assign_L39_C4", "label": "ret =", "type": "assigned_variable", "loc": [39, 39], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99842:FunctionDef_L35_C0", "vector": [14, 1, 0.3611, 0.0093, 1, 0.36, 0.1667, 501, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "ret", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ret = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99842:Assign_L40_C4", "label": "total =", "type": "assigned_variable", "loc": [40, 40], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99842:FunctionDef_L35_C0", "vector": [14, 1, 0.3704, 0.0093, 1, 0.36, 0.3333, 878, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "total", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " total = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99842:Assign_L41_C4", "label": "limit =", "type": "assigned_variable", "loc": [41, 41], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99842:FunctionDef_L35_C0", "vector": [14, 1, 0.3796, 0.0093, 1, 0.36, 0.5, 429, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "limit", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " limit = _MAX_ERROR_LINES/2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99842:For_L42_C4", "label": "for line, length", "type": "for", "loc": [42, 47], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99842:FunctionDef_L35_C0", "vector": [6, 1, 0.412, 0.0556, 1, 0.36, 0.6667, 875, 3, 0, 0, 0, 0, 0, 4], "semantic": {"name": "line, length", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for line, length in zip(lines[:limit], lengths[:limit]):\n if total + length >= limit:\n ret.append(_cut_long_line(line, total, from_end))\n break\n total += length\n ret.append(line)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99842:If_L43_C8", "label": "if", "type": "if", "loc": [43, 45], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99842:For_L42_C4", "vector": [4, 2, 0.4074, 0.0278, 2, 0.2, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if total + length >= limit:\n ret.append(_cut_long_line(line, total, from_end))\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99842:Expr_L44_C12", "label": "append()", "type": "expression", "loc": [44, 44], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99842:If_L43_C8", "vector": [8, 3, 0.4074, 0.0093, 3, 0.39, 0.0, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " ret.append(_cut_long_line(line, total, from_end))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99842:Expr_L47_C8", "label": "append()", "type": "expression", "loc": [47, 47], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99842:For_L42_C4", "vector": [8, 2, 0.4352, 0.0093, 2, 0.2, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " ret.append(line)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99842:If_L48_C4", "label": "if", "type": "if", "loc": [48, 49], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99842:FunctionDef_L35_C0", "vector": [4, 1, 0.4491, 0.0185, 1, 0.36, 0.8333, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if from_end:\n ret.reverse()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99842:Expr_L49_C8", "label": "reverse()", "type": "expression", "loc": [49, 49], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99842:If_L48_C4", "vector": [8, 2, 0.4537, 0.0093, 2, 0.2, 0.0, 109, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "reverse", "arg_names": [], "import_names": [], "rhs_call_name": "reverse", "annotation": ""}, "snippet": " ret.reverse()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99842:Return_L50_C4", "label": "return", "type": "return", "loc": [50, 50], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99842:FunctionDef_L35_C0", "vector": [13, 1, 0.463, 0.0093, 1, 0.36, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ret"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99842:FunctionDef_L52_C0", "label": "_cut_long_line", "type": "function", "loc": [52, 60], "level": 0, "parent": null, "vector": [2, 0, 0.5185, 0.0833, 0, 0.66, 0.5, 0, 0, 3, 1, 0, 0, 0, 1], "semantic": {"name": "_cut_long_line", "arg_names": ["line", "used", "from_end"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def _cut_long_line(line, used, from_end):\n available_lines = _MAX_ERROR_LINES/2 - used\n available_chars = available_lines * _MAX_ERROR_LINE_LENGTH - 3\n if len(line) > available_chars:\n if not from_end:\n line = line[:available_chars] + '...'\n else:\n line = '...' + line[-available_chars:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99842:Assign_L53_C4", "label": "available_lines =", "type": "assigned_variable", "loc": [53, 53], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99842:FunctionDef_L52_C0", "vector": [14, 1, 0.4907, 0.0093, 1, 0.6, 0.0, 46, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "available_lines", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " available_lines = _MAX_ERROR_LINES/2 - used"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99842:Assign_L54_C4", "label": "available_chars =", "type": "assigned_variable", "loc": [54, 54], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99842:FunctionDef_L52_C0", "vector": [14, 1, 0.5, 0.0093, 1, 0.6, 0.3333, 513, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "available_chars", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " available_chars = available_lines * _MAX_ERROR_LINE_LENGTH - 3"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99842:If_L55_C4", "label": "if", "type": "if", "loc": [55, 59], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99842:FunctionDef_L52_C0", "vector": [4, 1, 0.5278, 0.0463, 1, 0.6, 0.6667, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(line) > available_chars:\n if not from_end:\n line = line[:available_chars] + '...'\n else:\n line = '...' + line[-available_chars:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99842:If_L56_C8", "label": "if", "type": "if", "loc": [56, 59], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99842:If_L55_C4", "vector": [4, 2, 0.5324, 0.037, 2, 0.3, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not from_end:\n line = line[:available_chars] + '...'\n else:\n line = '...' + line[-available_chars:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99842:Assign_L57_C12", "label": "line =", "type": "assigned_variable", "loc": [57, 57], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99842:If_L56_C8", "vector": [14, 3, 0.5278, 0.0093, 3, 0.98, 0.0, 373, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "line", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " line = line[:available_chars] + '...'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99842:Assign_L59_C12", "label": "line =", "type": "assigned_variable", "loc": [59, 59], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99842:If_L56_C8", "vector": [14, 3, 0.5463, 0.0093, 3, 0.98, 1.0, 373, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "line", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " line = '...' + line[-available_chars:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99842:Return_L60_C4", "label": "return", "type": "return", "loc": [60, 60], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99842:FunctionDef_L52_C0", "vector": [13, 1, 0.5556, 0.0093, 1, 0.6, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return line"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99842:FunctionDef_L62_C0", "label": "_count_line_lenghts", "type": "function", "loc": [62, 63], "level": 0, "parent": null, "vector": [2, 0, 0.5787, 0.0185, 0, 0.66, 0.5556, 199, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "_count_line_lenghts", "arg_names": ["lines"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def _count_line_lenghts(lines):\n return [ _count_virtual_line_length(line) for line in lines ]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99842:Return_L63_C4", "label": "return", "type": "return", "loc": [63, 63], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99842:FunctionDef_L62_C0", "vector": [13, 1, 0.5833, 0.0093, 1, 0.54, 0.0, 0, 5, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return [ _count_virtual_line_length(line) for line in lines ]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99842:FunctionDef_L65_C0", "label": "_count_virtual_line_length", "type": "function", "loc": [65, 69], "level": 0, "parent": null, "vector": [2, 0, 0.6204, 0.0463, 0, 0.66, 0.6111, 497, 0, 1, 1, 0, 0, 0, 3], "semantic": {"name": "_count_virtual_line_length", "arg_names": ["line"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def _count_virtual_line_length(line):\n length = len(line) / _MAX_ERROR_LINE_LENGTH\n if not len(line) % _MAX_ERROR_LINE_LENGTH == 0 or len(line) == 0:\n length += 1\n return length"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99842:Assign_L66_C4", "label": "length =", "type": "assigned_variable", "loc": [66, 66], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99842:FunctionDef_L65_C0", "vector": [14, 1, 0.6111, 0.0093, 1, 0.48, 0.0, 221, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "length", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " length = len(line) / _MAX_ERROR_LINE_LENGTH"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99842:If_L67_C4", "label": "if", "type": "if", "loc": [67, 68], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99842:FunctionDef_L65_C0", "vector": [4, 1, 0.625, 0.0185, 1, 0.48, 0.5, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not len(line) % _MAX_ERROR_LINE_LENGTH == 0 or len(line) == 0:\n length += 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99842:Return_L69_C4", "label": "return", "type": "return", "loc": [69, 69], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99842:FunctionDef_L65_C0", "vector": [13, 1, 0.6389, 0.0093, 1, 0.48, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return length"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99842:FunctionDef_L72_C0", "label": "format_assign_message", "type": "function", "loc": [72, 76], "level": 0, "parent": null, "vector": [2, 0, 0.6852, 0.0463, 0, 0.66, 0.6667, 898, 0, 3, 1, 0, 0, 0, 4], "semantic": {"name": "format_assign_message", "arg_names": ["variable", "value", "cut_long"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def format_assign_message(variable, value, cut_long=True):\n value = unic(value) if variable.startswith('$') else seq2str2(value)\n if cut_long and len(value) > _MAX_ASSIGN_LENGTH:\n value = value[:_MAX_ASSIGN_LENGTH] + '...'\n return '%s = %s' % (variable, value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99842:Assign_L73_C4", "label": "value =", "type": "assigned_variable", "loc": [73, 73], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99842:FunctionDef_L72_C0", "vector": [14, 1, 0.6759, 0.0093, 1, 0.58, 0.0, 441, 8, 0, 0, 0, 0, 0, 3], "semantic": {"name": "value", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " value = unic(value) if variable.startswith('$') else seq2str2(value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99842:If_L74_C4", "label": "if", "type": "if", "loc": [74, 75], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99842:FunctionDef_L72_C0", "vector": [4, 1, 0.6898, 0.0185, 1, 0.58, 0.5, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if cut_long and len(value) > _MAX_ASSIGN_LENGTH:\n value = value[:_MAX_ASSIGN_LENGTH] + '...'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99842:Assign_L75_C8", "label": "value =", "type": "assigned_variable", "loc": [75, 75], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99842:If_L74_C4", "vector": [14, 2, 0.6944, 0.0093, 2, 0.6, 0.0, 441, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "value", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " value = value[:_MAX_ASSIGN_LENGTH] + '...'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99842:Return_L76_C4", "label": "return", "type": "return", "loc": [76, 76], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99842:FunctionDef_L72_C0", "vector": [13, 1, 0.7037, 0.0093, 1, 0.58, 1.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return '%s = %s' % (variable, value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99842:FunctionDef_L79_C0", "label": "get_console_length", "type": "function", "loc": [79, 80], "level": 0, "parent": null, "vector": [2, 0, 0.7361, 0.0185, 0, 0.66, 0.7222, 71, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "get_console_length", "arg_names": ["text"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def get_console_length(text):\n return sum(get_char_width(char) for char in text)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99842:Return_L80_C4", "label": "return", "type": "return", "loc": [80, 80], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99842:FunctionDef_L79_C0", "vector": [13, 1, 0.7407, 0.0093, 1, 0.17, 0.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return sum(get_char_width(char) for char in text)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99842:FunctionDef_L83_C0", "label": "pad_console_length", "type": "function", "loc": [83, 91], "level": 0, "parent": null, "vector": [2, 0, 0.8056, 0.0833, 0, 0.66, 0.7778, 788, 0, 3, 1, 0, 0, 0, 6], "semantic": {"name": "pad_console_length", "arg_names": ["text", "width", "cut_left"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def pad_console_length(text, width, cut_left=False):\n if width < 5:\n width = 5\n diff = get_console_length(text) - width\n if diff <= 0:\n return _pad_width(text, width)\n if cut_left:\n return _pad_width('...'+_lose_width_left(text, diff+3), width)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99842:If_L84_C4", "label": "if", "type": "if", "loc": [84, 85], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99842:FunctionDef_L83_C0", "vector": [4, 1, 0.7824, 0.0185, 1, 0.49, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if width < 5:\n width = 5"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99842:Assign_L85_C8", "label": "width =", "type": "assigned_variable", "loc": [85, 85], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99842:If_L84_C4", "vector": [14, 2, 0.787, 0.0093, 2, 0.97, 0.0, 989, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "width", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " width = 5"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99842:Assign_L86_C4", "label": "diff =", "type": "assigned_variable", "loc": [86, 86], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99842:FunctionDef_L83_C0", "vector": [14, 1, 0.7963, 0.0093, 1, 0.49, 0.25, 833, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "diff", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " diff = get_console_length(text) - width"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99842:If_L87_C4", "label": "if", "type": "if", "loc": [87, 88], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99842:FunctionDef_L83_C0", "vector": [4, 1, 0.8102, 0.0185, 1, 0.49, 0.5, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if diff <= 0:\n return _pad_width(text, width)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99842:Return_L88_C8", "label": "return", "type": "return", "loc": [88, 88], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99842:If_L87_C4", "vector": [13, 2, 0.8148, 0.0093, 2, 0.0, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return _pad_width(text, width)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99842:If_L89_C4", "label": "if", "type": "if", "loc": [89, 90], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99842:FunctionDef_L83_C0", "vector": [4, 1, 0.8287, 0.0185, 1, 0.49, 0.75, 0, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if cut_left:\n return _pad_width('...'+_lose_width_left(text, diff+3), width)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99842:Return_L90_C8", "label": "return", "type": "return", "loc": [90, 90], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99842:If_L89_C4", "vector": [13, 2, 0.8333, 0.0093, 2, 0.16, 0.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return _pad_width('...'+_lose_width_left(text, diff+3), width)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99842:Return_L91_C4", "label": "return", "type": "return", "loc": [91, 91], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99842:FunctionDef_L83_C0", "vector": [13, 1, 0.8426, 0.0093, 1, 0.49, 1.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return _pad_width(_lose_width_right(text, diff+3)+'...', width)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99842:FunctionDef_L93_C0", "label": "_pad_width", "type": "function", "loc": [93, 95], "level": 0, "parent": null, "vector": [2, 0, 0.8704, 0.0278, 0, 0.66, 0.8333, 20, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "_pad_width", "arg_names": ["text", "width"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def _pad_width(text, width):\n more = width - get_console_length(text)\n return text + ' ' * more"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99842:Assign_L94_C4", "label": "more =", "type": "assigned_variable", "loc": [94, 94], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99842:FunctionDef_L93_C0", "vector": [14, 1, 0.8704, 0.0093, 1, 0.91, 0.0, 179, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "more", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " more = width - get_console_length(text)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99842:Return_L95_C4", "label": "return", "type": "return", "loc": [95, 95], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99842:FunctionDef_L93_C0", "vector": [13, 1, 0.8796, 0.0093, 1, 0.91, 1.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return text + ' ' * more"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99842:FunctionDef_L97_C0", "label": "_lose_width_right", "type": "function", "loc": [97, 98], "level": 0, "parent": null, "vector": [2, 0, 0.9028, 0.0185, 0, 0.66, 0.8889, 616, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "_lose_width_right", "arg_names": ["text", "diff"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def _lose_width_right(text, diff):\n return _lose_width(text, diff, -1, slice(None, -1))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99842:Return_L98_C4", "label": "return", "type": "return", "loc": [98, 98], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99842:FunctionDef_L97_C0", "vector": [13, 1, 0.9074, 0.0093, 1, 0.95, 0.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return _lose_width(text, diff, -1, slice(None, -1))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99842:FunctionDef_L100_C0", "label": "_lose_width_left", "type": "function", "loc": [100, 101], "level": 0, "parent": null, "vector": [2, 0, 0.9306, 0.0185, 0, 0.66, 0.9444, 903, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "_lose_width_left", "arg_names": ["text", "diff"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def _lose_width_left(text, diff):\n return _lose_width(text, diff, 0, slice(1, None))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99842:Return_L101_C4", "label": "return", "type": "return", "loc": [101, 101], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99842:FunctionDef_L100_C0", "vector": [13, 1, 0.9352, 0.0093, 1, 0.23, 0.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return _lose_width(text, diff, 0, slice(1, None))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99842:FunctionDef_L103_C0", "label": "_lose_width", "type": "function", "loc": [103, 108], "level": 0, "parent": null, "vector": [2, 0, 0.9769, 0.0556, 0, 0.66, 1.0, 47, 0, 4, 1, 0, 0, 0, 1], "semantic": {"name": "_lose_width", "arg_names": ["text", "diff", "index", "slice"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def _lose_width(text, diff, index, slice):\n lost = 0\n while lost < diff:\n lost += get_console_length(text[index])\n text = text[slice]\n return text"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99842:Assign_L104_C4", "label": "lost =", "type": "assigned_variable", "loc": [104, 104], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99842:FunctionDef_L103_C0", "vector": [14, 1, 0.963, 0.0093, 1, 0.86, 0.0, 416, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "lost", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " lost = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99842:While_L105_C4", "label": "while", "type": "while", "loc": [105, 107], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99842:FunctionDef_L103_C0", "vector": [5, 1, 0.9815, 0.0278, 1, 0.86, 0.5, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while lost < diff:\n lost += get_console_length(text[index])\n text = text[slice]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99842:Assign_L107_C8", "label": "text =", "type": "assigned_variable", "loc": [107, 107], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99842:While_L105_C4", "vector": [14, 2, 0.9907, 0.0093, 2, 0.76, 0.0, 439, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "text", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " text = text[slice]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99842:Return_L108_C4", "label": "return", "type": "return", "loc": [108, 108], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99842:FunctionDef_L103_C0", "vector": [13, 1, 1.0, 0.0093, 1, 0.86, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return text"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99842:FunctionDef_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99842:Assign_L27_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99842:FunctionDef_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99842:Assign_L28_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99842:FunctionDef_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99842:If_L29_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99842:If_L29_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99842:Return_L30_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99842:FunctionDef_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99842:Assign_L31_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99842:FunctionDef_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99842:Assign_L32_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99842:FunctionDef_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99842:Return_L33_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99842:FunctionDef_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99842:If_L36_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99842:If_L36_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99842:Expr_L37_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99842:If_L36_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99842:Expr_L38_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99842:FunctionDef_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99842:Assign_L39_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99842:FunctionDef_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99842:Assign_L40_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99842:FunctionDef_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99842:Assign_L41_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99842:FunctionDef_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99842:For_L42_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99842:For_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99842:If_L43_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99842:If_L43_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99842:Expr_L44_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99842:For_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99842:Expr_L47_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99842:FunctionDef_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99842:If_L48_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99842:If_L48_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99842:Expr_L49_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99842:FunctionDef_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99842:Return_L50_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99842:FunctionDef_L52_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99842:Assign_L53_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99842:FunctionDef_L52_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99842:Assign_L54_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99842:FunctionDef_L52_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99842:If_L55_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99842:If_L55_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99842:If_L56_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99842:If_L56_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99842:Assign_L57_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99842:If_L56_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99842:Assign_L59_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99842:FunctionDef_L52_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99842:Return_L60_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99842:FunctionDef_L62_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99842:Return_L63_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99842:FunctionDef_L65_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99842:Assign_L66_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99842:FunctionDef_L65_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99842:If_L67_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99842:FunctionDef_L65_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99842:Return_L69_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99842:FunctionDef_L72_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99842:Assign_L73_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99842:FunctionDef_L72_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99842:If_L74_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99842:If_L74_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99842:Assign_L75_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99842:FunctionDef_L72_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99842:Return_L76_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99842:FunctionDef_L79_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99842:Return_L80_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99842:FunctionDef_L83_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99842:If_L84_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99842:If_L84_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99842:Assign_L85_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99842:FunctionDef_L83_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99842:Assign_L86_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99842:FunctionDef_L83_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99842:If_L87_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99842:If_L87_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99842:Return_L88_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99842:FunctionDef_L83_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99842:If_L89_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99842:If_L89_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99842:Return_L90_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99842:FunctionDef_L83_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99842:Return_L91_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99842:FunctionDef_L93_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99842:Assign_L94_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99842:FunctionDef_L93_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99842:Return_L95_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99842:FunctionDef_L97_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99842:Return_L98_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99842:FunctionDef_L100_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99842:Return_L101_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99842:FunctionDef_L103_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99842:Assign_L104_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99842:FunctionDef_L103_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99842:While_L105_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99842:While_L105_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99842:Assign_L107_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99842:FunctionDef_L103_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99842:Return_L108_C4"}] |
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import sys
from StringIO import StringIO
try:
import xml.etree.cElementTree as ET
except ImportError:
try:
import cElementTree as ET
except ImportError:
try:
import xml.etree.ElementTree as ET
# Raises ImportError due to missing expat on IronPython by default
ET.parse(StringIO('<test/>'))
except ImportError:
try:
import elementtree.ElementTree as ET
except ImportError:
raise ImportError('No valid ElementTree XML parser module found')
def get_root(path, string=None, node=None):
# This should NOT be changed to 'if not node:'. See chapter Truth Testing
# from http://effbot.org/zone/element.htm#the-element-type
if node is not None:
return node
source = _get_source(path, string)
try:
return ET.parse(source).getroot()
finally:
if hasattr(source, 'close'):
source.close()
def _get_source(path, string):
if not path:
return StringIO(string)
# ElementTree 1.2.7 preview (first ET with IronPython support) doesn't
# handler non-ASCII chars correctly if an open file given to it.
if sys.platform == 'cli':
return path
# ET.parse doesn't close files it opens, which causes serious problems
# with Jython 2.5(.1) on Windows: http://bugs.jython.org/issue1598
return open(path, 'rb')
| ajibawa-2023/Python-Code-Large/train/row_99843 | 25 | 55 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99843:Import_L15_C0", "label": "sys import sys", "type": "import", "loc": [15, 15], "level": 0, "parent": null, "vector": [1, 0, 0.2727, 0.0182, 0, 0.66, 0.0, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sys"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99843:ImportFrom_L16_C0", "label": "from StringIO import StringIO", "type": "import", "loc": [16, 16], "level": 0, "parent": null, "vector": [1, 0, 0.2909, 0.0182, 0, 0.66, 0.25, 609, 0, 1, 0, 0, 609, 0, 0], "semantic": {"name": "StringIO", "arg_names": [], "import_names": ["StringIO"], "rhs_call_name": "", "annotation": ""}, "snippet": "from StringIO import StringIO"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99843:Try_L17_C0", "label": "try", "type": "try", "loc": [17, 31], "level": 0, "parent": null, "vector": [7, 0, 0.4364, 0.2727, 0, 0.66, 0.5, 0, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "try:\n import xml.etree.cElementTree as ET\nexcept ImportError:\n try:\n import cElementTree as ET\n except ImportError:\n try:\n import xml.etree.ElementTree as ET"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99843:Import_L18_C4", "label": "xml.etree.cElementTree import ET", "type": "import", "loc": [18, 18], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99843:Try_L17_C0", "vector": [1, 1, 0.3273, 0.0182, 1, 0.6, 0.0, 696, 0, 1, 0, 0, 696, 0, 0], "semantic": {"name": "xml.etree.cElementTree", "arg_names": [], "import_names": ["ET"], "rhs_call_name": "", "annotation": ""}, "snippet": " import xml.etree.cElementTree as ET"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99843:Try_L20_C4", "label": "try", "type": "try", "loc": [20, 31], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99843:Try_L17_C0", "vector": [7, 1, 0.4636, 0.2182, 1, 0.6, 0.0, 0, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n import cElementTree as ET\n except ImportError:\n try:\n import xml.etree.ElementTree as ET\n # Raises ImportError due to missing expat on IronPython by default\n ET.parse(StringIO('<test/>'))\n except ImportError:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99843:Import_L21_C8", "label": "cElementTree import ET", "type": "import", "loc": [21, 21], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99843:Try_L20_C4", "vector": [1, 2, 0.3818, 0.0182, 2, 0.36, 0.0, 272, 0, 1, 0, 0, 272, 0, 0], "semantic": {"name": "cElementTree", "arg_names": [], "import_names": ["ET"], "rhs_call_name": "", "annotation": ""}, "snippet": " import cElementTree as ET"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99843:Try_L23_C8", "label": "try", "type": "try", "loc": [23, 31], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99843:Try_L20_C4", "vector": [7, 2, 0.4909, 0.1636, 2, 0.36, 0.0, 0, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n import xml.etree.ElementTree as ET\n # Raises ImportError due to missing expat on IronPython by default\n ET.parse(StringIO('<test/>'))\n except ImportError:\n try:\n import elementtree.ElementTree as ET\n except ImportError:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99843:Import_L24_C12", "label": "xml.etree.ElementTree import ET", "type": "import", "loc": [24, 24], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99843:Try_L23_C8", "vector": [1, 3, 0.4364, 0.0182, 3, 0.65, 0.0, 902, 0, 1, 0, 0, 902, 0, 0], "semantic": {"name": "xml.etree.ElementTree", "arg_names": [], "import_names": ["ET"], "rhs_call_name": "", "annotation": ""}, "snippet": " import xml.etree.ElementTree as ET"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99843:Expr_L26_C12", "label": "parse()", "type": "expression", "loc": [26, 26], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99843:Try_L23_C8", "vector": [8, 3, 0.4727, 0.0182, 3, 0.65, 1.0, 678, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "parse", "arg_names": [], "import_names": [], "rhs_call_name": "parse", "annotation": ""}, "snippet": " ET.parse(StringIO('<test/>'))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99843:Try_L28_C12", "label": "try", "type": "try", "loc": [28, 31], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99843:Try_L23_C8", "vector": [7, 3, 0.5364, 0.0727, 3, 0.65, 0.0, 0, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n import elementtree.ElementTree as ET\n except ImportError:\n raise ImportError('No valid ElementTree XML parser module found')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99843:Import_L29_C16", "label": "elementtree.ElementTree import ET", "type": "import", "loc": [29, 29], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99843:Try_L28_C12", "vector": [1, 4, 0.5273, 0.0182, 4, 0.81, 0.0, 78, 0, 1, 0, 0, 78, 0, 0], "semantic": {"name": "elementtree.ElementTree", "arg_names": [], "import_names": ["ET"], "rhs_call_name": "", "annotation": ""}, "snippet": " import elementtree.ElementTree as ET"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99843:FunctionDef_L34_C0", "label": "get_root", "type": "function", "loc": [34, 44], "level": 0, "parent": null, "vector": [2, 0, 0.7091, 0.2, 0, 0.66, 0.75, 534, 0, 3, 1, 0, 0, 0, 5], "semantic": {"name": "get_root", "arg_names": ["path", "string", "node"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def get_root(path, string=None, node=None):\n # This should NOT be changed to 'if not node:'. See chapter Truth Testing\n # from http://effbot.org/zone/element.htm#the-element-type\n if node is not None:\n return node\n source = _get_source(path, string)\n try:\n return ET.parse(source).getroot()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99843:If_L37_C4", "label": "if", "type": "if", "loc": [37, 38], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99843:FunctionDef_L34_C0", "vector": [4, 1, 0.6818, 0.0364, 1, 0.27, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if node is not None:\n return node"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99843:Return_L38_C8", "label": "return", "type": "return", "loc": [38, 38], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99843:If_L37_C4", "vector": [13, 2, 0.6909, 0.0182, 2, 0.8, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return node"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99843:Assign_L39_C4", "label": "source = _get_source()", "type": "assigned_variable", "loc": [39, 39], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99843:FunctionDef_L34_C0", "vector": [14, 1, 0.7091, 0.0182, 1, 0.27, 0.5, 703, 3, 2, 0, 0, 538, 10, 1], "semantic": {"name": "source", "arg_names": [], "import_names": [], "rhs_call_name": "_get_source", "annotation": ""}, "snippet": " source = _get_source(path, string)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99843:Try_L40_C4", "label": "try", "type": "try", "loc": [40, 44], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99843:FunctionDef_L34_C0", "vector": [7, 1, 0.7636, 0.0909, 1, 0.27, 1.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n return ET.parse(source).getroot()\n finally:\n if hasattr(source, 'close'):\n source.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99843:Return_L41_C8", "label": "return", "type": "return", "loc": [41, 41], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99843:Try_L40_C4", "vector": [13, 2, 0.7455, 0.0182, 2, 0.59, 0.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ET.parse(source).getroot()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99843:If_L43_C8", "label": "if", "type": "if", "loc": [43, 44], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99843:Try_L40_C4", "vector": [4, 2, 0.7909, 0.0364, 2, 0.59, 1.0, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if hasattr(source, 'close'):\n source.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99843:Expr_L44_C12", "label": "close()", "type": "expression", "loc": [44, 44], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99843:If_L43_C8", "vector": [8, 3, 0.8, 0.0182, 3, 0.67, 0.0, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": " source.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99843:FunctionDef_L46_C0", "label": "_get_source", "type": "function", "loc": [46, 55], "level": 0, "parent": null, "vector": [2, 0, 0.9182, 0.1818, 0, 0.66, 1.0, 538, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "_get_source", "arg_names": ["path", "string"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def _get_source(path, string):\n if not path:\n return StringIO(string)\n # ElementTree 1.2.7 preview (first ET with IronPython support) doesn't\n # handler non-ASCII chars correctly if an open file given to it.\n if sys.platform == 'cli':\n return path\n # ET.parse doesn't close files it opens, which causes serious problems"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99843:If_L47_C4", "label": "if", "type": "if", "loc": [47, 48], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99843:FunctionDef_L46_C0", "vector": [4, 1, 0.8636, 0.0364, 1, 0.28, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not path:\n return StringIO(string)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99843:Return_L48_C8", "label": "return", "type": "return", "loc": [48, 48], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99843:If_L47_C4", "vector": [13, 2, 0.8727, 0.0182, 2, 0.9, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return StringIO(string)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99843:If_L51_C4", "label": "if", "type": "if", "loc": [51, 52], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99843:FunctionDef_L46_C0", "vector": [4, 1, 0.9364, 0.0364, 1, 0.28, 0.5, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if sys.platform == 'cli':\n return path"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99843:Return_L52_C8", "label": "return", "type": "return", "loc": [52, 52], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99843:If_L51_C4", "vector": [13, 2, 0.9455, 0.0182, 2, 0.05, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return path"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99843:Return_L55_C4", "label": "return", "type": "return", "loc": [55, 55], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99843:FunctionDef_L46_C0", "vector": [13, 1, 1.0, 0.0182, 1, 0.28, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return open(path, 'rb')"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99843:Try_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99843:Import_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99843:Try_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99843:Try_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99843:Try_L20_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99843:Import_L21_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99843:Try_L20_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99843:Try_L23_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99843:Try_L23_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99843:Import_L24_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99843:Try_L23_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99843:Expr_L26_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99843:Try_L23_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99843:Try_L28_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99843:Try_L28_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99843:Import_L29_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99843:FunctionDef_L34_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99843:If_L37_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99843:If_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99843:Return_L38_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99843:FunctionDef_L34_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99843:Assign_L39_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99843:FunctionDef_L34_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99843:Try_L40_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99843:Try_L40_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99843:Return_L41_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99843:Try_L40_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99843:If_L43_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99843:If_L43_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99843:Expr_L44_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99843:FunctionDef_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99843:If_L47_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99843:If_L47_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99843:Return_L48_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99843:FunctionDef_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99843:If_L51_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99843:If_L51_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99843:Return_L52_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99843:FunctionDef_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99843:Return_L55_C4"}] |
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import os
from abstractxmlwriter import AbstractXmlWriter
def XmlWriter(path):
if path == 'NONE':
return FakeXMLWriter()
if os.name == 'java':
from jyxmlwriter import XmlWriter
else:
from pyxmlwriter import XmlWriter
return XmlWriter(path)
class FakeXMLWriter(AbstractXmlWriter):
closed = False
_start = _content = _end = _close = lambda self, *args: None
| ajibawa-2023/Python-Code-Large/train/row_99845 | 12 | 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_99845:Import_L15_C0", "label": "os import os", "type": "import", "loc": [15, 15], "level": 0, "parent": null, "vector": [1, 0, 0.4688, 0.0312, 0, 0.66, 0.0, 688, 0, 1, 0, 0, 688, 0, 0], "semantic": {"name": "os", "arg_names": [], "import_names": ["os"], "rhs_call_name": "", "annotation": ""}, "snippet": "import os"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99845:ImportFrom_L17_C0", "label": "from abstractxmlwriter import AbstractXmlWriter", "type": "import", "loc": [17, 17], "level": 0, "parent": null, "vector": [1, 0, 0.5312, 0.0312, 0, 0.66, 0.3333, 993, 0, 1, 0, 0, 993, 0, 0], "semantic": {"name": "abstractxmlwriter", "arg_names": [], "import_names": ["AbstractXmlWriter"], "rhs_call_name": "", "annotation": ""}, "snippet": "from abstractxmlwriter import AbstractXmlWriter"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99845:FunctionDef_L20_C0", "label": "XmlWriter", "type": "function", "loc": [20, 27], "level": 0, "parent": null, "vector": [2, 0, 0.7344, 0.25, 0, 0.66, 0.6667, 730, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "XmlWriter", "arg_names": ["path"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def XmlWriter(path):\n if path == 'NONE':\n return FakeXMLWriter()\n if os.name == 'java':\n from jyxmlwriter import XmlWriter\n else:\n from pyxmlwriter import XmlWriter\n return XmlWriter(path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99845:If_L21_C4", "label": "if", "type": "if", "loc": [21, 22], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99845:FunctionDef_L20_C0", "vector": [4, 1, 0.6719, 0.0625, 1, 0.71, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if path == 'NONE':\n return FakeXMLWriter()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99845:Return_L22_C8", "label": "return", "type": "return", "loc": [22, 22], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99845:If_L21_C4", "vector": [13, 2, 0.6875, 0.0312, 2, 0.81, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return FakeXMLWriter()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99845:If_L23_C4", "label": "if", "type": "if", "loc": [23, 26], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99845:FunctionDef_L20_C0", "vector": [4, 1, 0.7656, 0.125, 1, 0.71, 0.5, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if os.name == 'java':\n from jyxmlwriter import XmlWriter\n else:\n from pyxmlwriter import XmlWriter"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99845:ImportFrom_L24_C8", "label": "from jyxmlwriter import XmlWriter", "type": "import", "loc": [24, 24], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99845:If_L23_C4", "vector": [1, 2, 0.75, 0.0312, 2, 0.79, 0.0, 452, 0, 1, 0, 0, 452, 0, 0], "semantic": {"name": "jyxmlwriter", "arg_names": [], "import_names": ["XmlWriter"], "rhs_call_name": "", "annotation": ""}, "snippet": " from jyxmlwriter import XmlWriter"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99845:ImportFrom_L26_C8", "label": "from pyxmlwriter import XmlWriter", "type": "import", "loc": [26, 26], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99845:If_L23_C4", "vector": [1, 2, 0.8125, 0.0312, 2, 0.79, 1.0, 823, 0, 1, 0, 0, 823, 0, 0], "semantic": {"name": "pyxmlwriter", "arg_names": [], "import_names": ["XmlWriter"], "rhs_call_name": "", "annotation": ""}, "snippet": " from pyxmlwriter import XmlWriter"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99845:Return_L27_C4", "label": "return", "type": "return", "loc": [27, 27], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99845:FunctionDef_L20_C0", "vector": [13, 1, 0.8438, 0.0312, 1, 0.71, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return XmlWriter(path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99845:ClassDef_L30_C0", "label": "FakeXMLWriter", "type": "class", "loc": [30, 32], "level": 0, "parent": null, "vector": [3, 0, 0.9688, 0.0938, 0, 0.66, 1.0, 342, 0, 0, 0, 0, 934, 0, 0], "semantic": {"name": "FakeXMLWriter", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class FakeXMLWriter(AbstractXmlWriter):\n closed = False\n _start = _content = _end = _close = lambda self, *args: None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99845:Assign_L31_C4", "label": "closed =", "type": "assigned_variable", "loc": [31, 31], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99845:ClassDef_L30_C0", "vector": [14, 1, 0.9688, 0.0312, 1, 0.71, 0.0, 883, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "closed", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " closed = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99845:Assign_L32_C4", "label": "_start =", "type": "assigned_variable", "loc": [32, 32], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99845:ClassDef_L30_C0", "vector": [14, 1, 1.0, 0.0312, 1, 0.71, 1.0, 212, 9, 0, 0, 0, 0, 0, 0], "semantic": {"name": "_start", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " _start = _content = _end = _close = lambda self, *args: None"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99845:FunctionDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99845:If_L21_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99845:If_L21_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99845:Return_L22_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99845:FunctionDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99845:If_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99845:If_L23_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99845:ImportFrom_L24_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99845:If_L23_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99845:ImportFrom_L26_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99845:FunctionDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99845:Return_L27_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99845:ClassDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99845:Assign_L31_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99845:ClassDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99845:Assign_L32_C4"}] |
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import time
from normalizing import normalize
from misc import plural_or_not
def _get_timetuple(epoch_secs=None):
if _CURRENT_TIME:
return _CURRENT_TIME
if epoch_secs is None: # can also be 0 (at least in unit tests)
epoch_secs = time.time()
secs, millis = _float_secs_to_secs_and_millis(epoch_secs)
timetuple = time.localtime(secs)[:6] # from year to secs
return timetuple + (millis,)
def _float_secs_to_secs_and_millis(secs):
isecs = int(secs)
millis = int(round((secs - isecs) * 1000))
return (isecs, millis) if millis < 1000 else (isecs+1, 0)
_CURRENT_TIME = None # Seam for mocking time-dependent tests
START_TIME = _get_timetuple()
def timestr_to_secs(timestr):
"""Parses time in format like '1h 10s' and returns time in seconds (float).
Given time must be in format '1d 2h 3m 4s 5ms' with following rules.
- Time parts having zero value can be ignored (e.g. '3m 4s' is ok)
- Format is case and space insensitive
- Instead of 'd' it is also possible to use 'day' or 'days'
- Instead of 'h' also 'hour' and 'hours' are ok
- Instead of 'm' also 'minute', 'minutes', 'min' and 'mins' are ok
- Instead of 's' also 'second', 'seconds', 'sec' and 'secs' are ok
- Instead of 'ms' also 'millisecond', 'milliseconds' and 'millis' are ok
- It is possible to give time only as a float and then it is considered
to be seconds (e.g. '123', '123.0', '123s', '2min 3s' are all equivelant)
"""
try:
secs = _timestr_to_secs(timestr)
except (ValueError, TypeError):
raise ValueError("Invalid time string '%s'" % timestr)
return round(secs, 3)
def _timestr_to_secs(timestr):
timestr = _normalize_timestr(timestr)
if timestr == '':
raise ValueError
try:
return float(timestr)
except ValueError:
pass
millis = secs = mins = hours = days = 0
if timestr[0] == '-':
sign = -1
timestr = timestr[1:]
else:
sign = 1
temp = []
for c in timestr:
if c == 'x': millis = float(''.join(temp)); temp = []
elif c == 's': secs = float(''.join(temp)); temp = []
elif c == 'm': mins = float(''.join(temp)); temp = []
elif c == 'h': hours = float(''.join(temp)); temp = []
elif c == 'p': days = float(''.join(temp)); temp = []
else: temp.append(c)
if temp:
raise ValueError
return sign * (millis/1000 + secs + mins*60 + hours*60*60 + days*60*60*24)
def _normalize_timestr(timestr):
if isinstance(timestr, (int, long, float)):
return timestr
timestr = normalize(timestr)
for item in 'milliseconds', 'millisecond', 'millis':
timestr = timestr.replace(item, 'ms')
for item in 'seconds', 'second', 'secs', 'sec':
timestr = timestr.replace(item, 's')
for item in 'minutes', 'minute', 'mins', 'min':
timestr = timestr.replace(item, 'm')
for item in 'hours', 'hour':
timestr = timestr.replace(item, 'h')
for item in 'days', 'day':
timestr = timestr.replace(item, 'd')
# 1) 'ms' -> 'x' to ease processing later
# 2) 'd' -> 'p' because float('1d') returns 1.0 in Jython (bug submitted)
return timestr.replace('ms','x').replace('d','p')
def secs_to_timestr(secs, compact=False):
"""Converts time in seconds to a string representation.
Returned string is in format like
'1 day 2 hours 3 minutes 4 seconds 5 milliseconds' with following rules.
- Time parts having zero value are not included (e.g. '3 minutes 4 seconds'
instead of '0 days 0 hours 3 minutes 4 seconds')
- Hour part has a maximun of 23 and minutes and seconds both have 59
(e.g. '1 minute 40 seconds' instead of '100 seconds')
If compact has value 'True', short suffixes are used.
(e.g. 1d 2h 3min 4s 5ms)
"""
return _SecsToTimestrHelper(secs, compact).get_value()
class _SecsToTimestrHelper:
def __init__(self, float_secs, compact):
self._compact = compact
self._ret = []
self._sign, millis, secs, mins, hours, days \
= self._secs_to_components(float_secs)
self._add_item(days, 'd', 'day')
self._add_item(hours, 'h', 'hour')
self._add_item(mins, 'min', 'minute')
self._add_item(secs, 's', 'second')
self._add_item(millis, 'ms', 'millisecond')
def get_value(self):
if len(self._ret) > 0:
return self._sign + ' '.join(self._ret)
return '0s' if self._compact else '0 seconds'
def _add_item(self, value, compact_suffix, long_suffix):
if value == 0:
return
if self._compact:
suffix = compact_suffix
else:
suffix = ' %s%s' % (long_suffix, plural_or_not(value))
self._ret.append('%d%s' % (value, suffix))
def _secs_to_components(self, float_secs):
if float_secs < 0:
sign = '- '
float_secs = abs(float_secs)
else:
sign = ''
int_secs, millis = _float_secs_to_secs_and_millis(float_secs)
secs = int_secs % 60
mins = int(int_secs / 60) % 60
hours = int(int_secs / (60*60)) % 24
days = int(int_secs / (60*60*24))
return sign, millis, secs, mins, hours, days
def format_time(timetuple_or_epochsecs, daysep='', daytimesep=' ', timesep=':',
millissep=None, gmtsep=None):
"""Returns a timestamp formatted from given time using separators.
Time can be given either as a timetuple or seconds after epoch.
Timetuple is (year, month, day, hour, min, sec[, millis]), where parts must
be integers and millis is required only when millissep is not None.
Notice that this is not 100% compatible with standard Python timetuples
which do not have millis.
Seconds after epoch can be either an integer or a float.
"""
if isinstance(timetuple_or_epochsecs, (int, long, float)):
timetuple = _get_timetuple(timetuple_or_epochsecs)
else:
timetuple = timetuple_or_epochsecs
daytimeparts = ['%02d' % t for t in timetuple[:6]]
day = daysep.join(daytimeparts[:3])
time_ = timesep.join(daytimeparts[3:6])
millis = millissep and '%s%03d' % (millissep, timetuple[6]) or ''
return day + daytimesep + time_ + millis + _diff_to_gmt(gmtsep)
def _diff_to_gmt(sep):
if not sep:
return ''
if time.altzone == 0:
sign = ''
elif time.altzone > 0:
sign = '-'
else:
sign = '+'
minutes = abs(time.altzone) / 60.0
hours, minutes = divmod(minutes, 60)
return '%sGMT%s%s%02d:%02d' % (sep, sep, sign, hours, minutes)
def get_time(format='timestamp', time_=None):
"""Return the given or current time in requested format.
If time is not given, current time is used. How time is returned is
is deternined based on the given 'format' string as follows. Note that all
checks are case insensitive.
- If 'format' contains word 'epoch' the time is returned in seconds after
the unix epoch.
- If 'format' contains any of the words 'year', 'month', 'day', 'hour',
'min' or 'sec' only selected parts are returned. The order of the returned
parts is always the one in previous sentence and order of words in
'format' is not significant. Parts are returned as zero padded strings
(e.g. May -> '05').
- Otherwise (and by default) the time is returned as a timestamp string in
format '2006-02-24 15:08:31'
"""
if time_ is None:
time_ = time.time()
format = format.lower()
# 1) Return time in seconds since epoc
if 'epoch' in format:
return int(time_)
timetuple = time.localtime(time_)
parts = []
for i, match in enumerate('year month day hour min sec'.split()):
if match in format:
parts.append('%.2d' % timetuple[i])
# 2) Return time as timestamp
if not parts:
return format_time(timetuple, daysep='-')
# Return requested parts of the time
elif len(parts) == 1:
return parts[0]
else:
return parts
def parse_time(timestr):
"""Parses the time string and returns its value as seconds since epoch.
Time can be given in four different formats:
1) Numbers are interpreted as time since epoch directly. It is possible to
use also ints and floats, not only strings containing numbers.
2) Valid timestamp ('YYYY-MM-DD hh:mm:ss' and 'YYYYMMDD hhmmss').
3) 'NOW' (case-insensitive) is the current time rounded down to the
closest second.
4) Format 'NOW - 1 day' or 'NOW + 1 hour 30 min' is the current time
plus/minus the time specified with the time string.
"""
try:
ret = int(timestr)
except ValueError:
pass
else:
if ret < 0:
raise ValueError("Epoch time must be positive (got %s)" % timestr)
return ret
try:
return timestamp_to_secs(timestr, (' ', ':', '-', '.'))
except ValueError:
pass
normtime = timestr.lower().replace(' ', '')
now = int(time.time())
if normtime == 'now':
return now
if normtime.startswith('now'):
if normtime[3] == '+':
return now + timestr_to_secs(normtime[4:])
if normtime[3] == '-':
return now - timestr_to_secs(normtime[4:])
raise ValueError("Invalid time format '%s'" % timestr)
def get_timestamp(daysep='', daytimesep=' ', timesep=':', millissep='.'):
return format_time(_get_timetuple(), daysep, daytimesep, timesep, millissep)
def timestamp_to_secs(timestamp, seps=('', ' ', ':', '.'), millis=False):
try:
secs = _timestamp_to_millis(timestamp, seps) / 1000.0
except (ValueError, OverflowError):
raise ValueError("Invalid timestamp '%s'" % timestamp)
if millis:
return round(secs, 3)
return int(round(secs))
def secs_to_timestamp(secs, seps=None, millis=False):
if not seps:
seps = ('', ' ', ':', '.' if millis else None)
ttuple = time.localtime(secs)[:6]
if millis:
millis = (secs - int(secs)) * 1000
ttuple = ttuple + (int(millis),)
return format_time(ttuple, *seps)
def get_start_timestamp(daysep='', daytimesep=' ', timesep=':', millissep=None):
return format_time(START_TIME, daysep, daytimesep, timesep, millissep)
def get_elapsed_time(start_time, end_time=None, seps=('', ' ', ':', '.')):
"""Returns the time between given timestamps in milliseconds.
If 'end_time' is not given current timestamp is got with
get_timestamp using given 'seps'.
'seps' is a tuple containing 'daysep', 'daytimesep', 'timesep' and
'millissep' used in given timestamps.
"""
if start_time == 'N/A' or end_time == 'N/A':
return 0
if not end_time:
end_time = get_timestamp(*seps)
start_millis = _timestamp_to_millis(start_time, seps)
end_millis = _timestamp_to_millis(end_time, seps)
# start/end_millis can be long but we want to return int when possible
return int(end_millis - start_millis)
def elapsed_time_to_string(elapsed_millis):
"""Converts elapsed time in millisecods to format 'hh:mm:ss.mil'"""
elapsed_millis = round(elapsed_millis)
if elapsed_millis < 0:
pre = '-'
elapsed_millis = abs(elapsed_millis)
else:
pre = ''
millis = elapsed_millis % 1000
secs = int(elapsed_millis / 1000) % 60
mins = int(elapsed_millis / 60000) % 60
hours = int(elapsed_millis / 3600000)
return '%s%02d:%02d:%02d.%03d' % (pre, hours, mins, secs, millis)
def _timestamp_to_millis(timestamp, seps):
Y, M, D, h, m, s, millis = _split_timestamp(timestamp, seps)
secs = time.mktime((Y, M, D, h, m, s, 0, 0, time.daylight))
return int(round(1000*secs + millis))
def _split_timestamp(timestamp, seps):
for sep in seps:
if sep:
timestamp = timestamp.replace(sep, '')
timestamp = timestamp.ljust(17, '0')
years = int(timestamp[:4])
mons = int(timestamp[4:6])
days = int(timestamp[6:8])
hours = int(timestamp[8:10])
mins = int(timestamp[10:12])
secs = int(timestamp[12:14])
millis = int(timestamp[14:17])
return years, mons, days, hours, mins, secs, millis
| ajibawa-2023/Python-Code-Large/train/row_99846 | 213 | 352 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Import_L15_C0", "label": "time import time", "type": "import", "loc": [15, 15], "level": 0, "parent": null, "vector": [1, 0, 0.0426, 0.0028, 0, 0.66, 0.0, 654, 0, 1, 0, 0, 654, 0, 0], "semantic": {"name": "time", "arg_names": [], "import_names": ["time"], "rhs_call_name": "", "annotation": ""}, "snippet": "import time"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:ImportFrom_L17_C0", "label": "from normalizing import normalize", "type": "import", "loc": [17, 17], "level": 0, "parent": null, "vector": [1, 0, 0.0483, 0.0028, 0, 0.66, 0.0435, 901, 0, 1, 0, 0, 901, 0, 0], "semantic": {"name": "normalizing", "arg_names": [], "import_names": ["normalize"], "rhs_call_name": "", "annotation": ""}, "snippet": "from normalizing import normalize"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:ImportFrom_L18_C0", "label": "from misc import plural_or_not", "type": "import", "loc": [18, 18], "level": 0, "parent": null, "vector": [1, 0, 0.0511, 0.0028, 0, 0.66, 0.087, 733, 0, 1, 0, 0, 733, 0, 0], "semantic": {"name": "misc", "arg_names": [], "import_names": ["plural_or_not"], "rhs_call_name": "", "annotation": ""}, "snippet": "from misc import plural_or_not"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L21_C0", "label": "_get_timetuple", "type": "function", "loc": [21, 28], "level": 0, "parent": null, "vector": [2, 0, 0.0696, 0.0227, 0, 0.66, 0.1304, 75, 0, 1, 1, 0, 0, 0, 3], "semantic": {"name": "_get_timetuple", "arg_names": ["epoch_secs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def _get_timetuple(epoch_secs=None):\n if _CURRENT_TIME:\n return _CURRENT_TIME\n if epoch_secs is None: # can also be 0 (at least in unit tests)\n epoch_secs = time.time()\n secs, millis = _float_secs_to_secs_and_millis(epoch_secs)\n timetuple = time.localtime(secs)[:6] # from year to secs\n return timetuple + (millis,)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L22_C4", "label": "if", "type": "if", "loc": [22, 23], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L21_C0", "vector": [4, 1, 0.0639, 0.0057, 1, 0.35, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if _CURRENT_TIME:\n return _CURRENT_TIME"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Return_L23_C8", "label": "return", "type": "return", "loc": [23, 23], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L22_C4", "vector": [13, 2, 0.0653, 0.0028, 2, 0.02, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return _CURRENT_TIME"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L24_C4", "label": "if", "type": "if", "loc": [24, 25], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L21_C0", "vector": [4, 1, 0.0696, 0.0057, 1, 0.35, 0.25, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if epoch_secs is None: # can also be 0 (at least in unit tests)\n epoch_secs = time.time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L25_C8", "label": "epoch_secs = time()", "type": "assigned_variable", "loc": [25, 25], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L24_C4", "vector": [14, 2, 0.071, 0.0028, 2, 0.95, 0.0, 584, 3, 0, 0, 0, 654, 10, 1], "semantic": {"name": "epoch_secs", "arg_names": [], "import_names": [], "rhs_call_name": "time", "annotation": ""}, "snippet": " epoch_secs = time.time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L26_C4", "label": "secs, millis = _float_secs_to_secs_and_millis()", "type": "assigned_variable", "loc": [26, 26], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L21_C0", "vector": [14, 1, 0.0739, 0.0028, 1, 0.35, 0.5, 643, 3, 1, 0, 0, 218, 10, 1], "semantic": {"name": "secs, millis", "arg_names": [], "import_names": [], "rhs_call_name": "_float_secs_to_secs_and_millis", "annotation": ""}, "snippet": " secs, millis = _float_secs_to_secs_and_millis(epoch_secs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L27_C4", "label": "timetuple =", "type": "assigned_variable", "loc": [27, 27], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L21_C0", "vector": [14, 1, 0.0767, 0.0028, 1, 0.35, 0.75, 908, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "timetuple", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " timetuple = time.localtime(secs)[:6] # from year to secs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Return_L28_C4", "label": "return", "type": "return", "loc": [28, 28], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L21_C0", "vector": [13, 1, 0.0795, 0.0028, 1, 0.35, 1.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return timetuple + (millis,)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L30_C0", "label": "_float_secs_to_secs_and_millis", "type": "function", "loc": [30, 33], "level": 0, "parent": null, "vector": [2, 0, 0.0895, 0.0114, 0, 0.66, 0.1739, 218, 0, 1, 1, 0, 0, 0, 3], "semantic": {"name": "_float_secs_to_secs_and_millis", "arg_names": ["secs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def _float_secs_to_secs_and_millis(secs):\n isecs = int(secs)\n millis = int(round((secs - isecs) * 1000))\n return (isecs, millis) if millis < 1000 else (isecs+1, 0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L31_C4", "label": "isecs = int()", "type": "assigned_variable", "loc": [31, 31], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L30_C0", "vector": [14, 1, 0.0881, 0.0028, 1, 0.67, 0.0, 0, 3, 1, 0, 0, 901, 10, 1], "semantic": {"name": "isecs", "arg_names": [], "import_names": [], "rhs_call_name": "int", "annotation": ""}, "snippet": " isecs = int(secs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L32_C4", "label": "millis = int()", "type": "assigned_variable", "loc": [32, 32], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L30_C0", "vector": [14, 1, 0.0909, 0.0028, 1, 0.67, 0.5, 889, 3, 1, 0, 0, 901, 10, 2], "semantic": {"name": "millis", "arg_names": [], "import_names": [], "rhs_call_name": "int", "annotation": ""}, "snippet": " millis = int(round((secs - isecs) * 1000))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Return_L33_C4", "label": "return", "type": "return", "loc": [33, 33], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L30_C0", "vector": [13, 1, 0.0938, 0.0028, 1, 0.67, 1.0, 0, 8, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return (isecs, millis) if millis < 1000 else (isecs+1, 0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L36_C0", "label": "_CURRENT_TIME =", "type": "assigned_variable", "loc": [36, 36], "level": 0, "parent": null, "vector": [14, 0, 0.1023, 0.0028, 0, 0.66, 0.2174, 491, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "_CURRENT_TIME", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "_CURRENT_TIME = None # Seam for mocking time-dependent tests"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L37_C0", "label": "START_TIME = _get_timetuple()", "type": "assigned_variable", "loc": [37, 37], "level": 0, "parent": null, "vector": [14, 0, 0.1051, 0.0028, 0, 0.66, 0.2609, 104, 3, 0, 0, 0, 75, 10, 1], "semantic": {"name": "START_TIME", "arg_names": [], "import_names": [], "rhs_call_name": "_get_timetuple", "annotation": ""}, "snippet": "START_TIME = _get_timetuple()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L40_C0", "label": "timestr_to_secs", "type": "function", "loc": [40, 58], "level": 0, "parent": null, "vector": [2, 0, 0.1392, 0.054, 0, 0.66, 0.3043, 329, 0, 1, 1, 0, 0, 0, 3], "semantic": {"name": "timestr_to_secs", "arg_names": ["timestr"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def timestr_to_secs(timestr):\n \"\"\"Parses time in format like '1h 10s' and returns time in seconds (float).\n\n Given time must be in format '1d 2h 3m 4s 5ms' with following rules.\n - Time parts having zero value can be ignored (e.g. '3m 4s' is ok)\n - Format is case and space insensitive\n - Instead of 'd' it is also possible to use 'day' or 'days'\n - Instead of 'h' also 'hour' and 'hours' are ok"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Expr_L41_C4", "label": "expression", "type": "expression", "loc": [41, 53], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L40_C0", "vector": [8, 1, 0.1335, 0.0369, 1, 0.11, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Parses time in format like '1h 10s' and returns time in seconds (float).\n\n Given time must be in format '1d 2h 3m 4s 5ms' with following rules.\n - Time parts having zero value can be ignored (e.g. '3m 4s' is ok)\n - Format is case and space insensitive\n - Instead of 'd' it is also possible to use 'day' or 'days'\n - Instead of 'h' also 'hour' and 'hours' are ok\n - Instead of 'm' also 'minute', 'minutes', 'min' and 'mins' are ok"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Try_L54_C4", "label": "try", "type": "try", "loc": [54, 57], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L40_C0", "vector": [7, 1, 0.1577, 0.0114, 1, 0.11, 0.5, 0, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n secs = _timestr_to_secs(timestr)\n except (ValueError, TypeError):\n raise ValueError(\"Invalid time string '%s'\" % timestr)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L55_C8", "label": "secs = _timestr_to_secs()", "type": "assigned_variable", "loc": [55, 55], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:Try_L54_C4", "vector": [14, 2, 0.1562, 0.0028, 2, 0.87, 0.0, 584, 3, 1, 0, 0, 770, 10, 1], "semantic": {"name": "secs", "arg_names": [], "import_names": [], "rhs_call_name": "_timestr_to_secs", "annotation": ""}, "snippet": " secs = _timestr_to_secs(timestr)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Return_L58_C4", "label": "return", "type": "return", "loc": [58, 58], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L40_C0", "vector": [13, 1, 0.1648, 0.0028, 1, 0.11, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return round(secs, 3)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L60_C0", "label": "_timestr_to_secs", "type": "function", "loc": [60, 84], "level": 0, "parent": null, "vector": [2, 0, 0.2045, 0.071, 0, 0.66, 0.3478, 770, 0, 1, 1, 0, 0, 0, 13], "semantic": {"name": "_timestr_to_secs", "arg_names": ["timestr"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def _timestr_to_secs(timestr):\n timestr = _normalize_timestr(timestr)\n if timestr == '':\n raise ValueError\n try:\n return float(timestr)\n except ValueError:\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L61_C4", "label": "timestr = _normalize_timestr()", "type": "assigned_variable", "loc": [61, 61], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L60_C0", "vector": [14, 1, 0.1733, 0.0028, 1, 0.04, 0.0, 333, 3, 1, 0, 0, 361, 10, 1], "semantic": {"name": "timestr", "arg_names": [], "import_names": [], "rhs_call_name": "_normalize_timestr", "annotation": ""}, "snippet": " timestr = _normalize_timestr(timestr)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L62_C4", "label": "if", "type": "if", "loc": [62, 63], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L60_C0", "vector": [4, 1, 0.1776, 0.0057, 1, 0.04, 0.125, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if timestr == '':\n raise ValueError"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Try_L64_C4", "label": "try", "type": "try", "loc": [64, 67], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L60_C0", "vector": [7, 1, 0.1861, 0.0114, 1, 0.04, 0.25, 0, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n return float(timestr)\n except ValueError:\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Return_L65_C8", "label": "return", "type": "return", "loc": [65, 65], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:Try_L64_C4", "vector": [13, 2, 0.1847, 0.0028, 2, 0.8, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return float(timestr)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L68_C4", "label": "millis =", "type": "assigned_variable", "loc": [68, 68], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L60_C0", "vector": [14, 1, 0.1932, 0.0028, 1, 0.04, 0.375, 889, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "millis", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " millis = secs = mins = hours = days = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L69_C4", "label": "if", "type": "if", "loc": [69, 73], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L60_C0", "vector": [4, 1, 0.2017, 0.0142, 1, 0.04, 0.5, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if timestr[0] == '-':\n sign = -1\n timestr = timestr[1:]\n else:\n sign = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L70_C8", "label": "sign =", "type": "assigned_variable", "loc": [70, 70], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L69_C4", "vector": [14, 2, 0.1989, 0.0028, 2, 0.92, 0.0, 448, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "sign", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " sign = -1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L71_C8", "label": "timestr =", "type": "assigned_variable", "loc": [71, 71], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L69_C4", "vector": [14, 2, 0.2017, 0.0028, 2, 0.92, 0.5, 333, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "timestr", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " timestr = timestr[1:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L73_C8", "label": "sign =", "type": "assigned_variable", "loc": [73, 73], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L69_C4", "vector": [14, 2, 0.2074, 0.0028, 2, 0.92, 1.0, 448, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "sign", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " sign = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L74_C4", "label": "temp =", "type": "assigned_variable", "loc": [74, 74], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L60_C0", "vector": [14, 1, 0.2102, 0.0028, 1, 0.04, 0.625, 915, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "temp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " temp = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:For_L75_C4", "label": "for c", "type": "for", "loc": [75, 81], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L60_C0", "vector": [6, 1, 0.2216, 0.0199, 1, 0.04, 0.75, 411, 2, 0, 0, 0, 0, 0, 11], "semantic": {"name": "c", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for c in timestr:\n if c == 'x': millis = float(''.join(temp)); temp = []\n elif c == 's': secs = float(''.join(temp)); temp = []\n elif c == 'm': mins = float(''.join(temp)); temp = []\n elif c == 'h': hours = float(''.join(temp)); temp = []\n elif c == 'p': days = float(''.join(temp)); temp = []\n else: temp.append(c)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L76_C8", "label": "if", "type": "if", "loc": [76, 81], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:For_L75_C4", "vector": [4, 2, 0.223, 0.017, 2, 0.17, 0.0, 0, 0, 0, 0, 0, 0, 0, 11], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if c == 'x': millis = float(''.join(temp)); temp = []\n elif c == 's': secs = float(''.join(temp)); temp = []\n elif c == 'm': mins = float(''.join(temp)); temp = []\n elif c == 'h': hours = float(''.join(temp)); temp = []\n elif c == 'p': days = float(''.join(temp)); temp = []\n else: temp.append(c)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L76_C23", "label": "millis = float()", "type": "assigned_variable", "loc": [76, 76], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L76_C8", "vector": [14, 3, 0.2159, 0.0028, 3, 0.03, 0.0, 889, 3, 1, 0, 0, 639, 10, 2], "semantic": {"name": "millis", "arg_names": [], "import_names": [], "rhs_call_name": "float", "annotation": ""}, "snippet": " if c == 'x': millis = float(''.join(temp)); temp = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L76_C54", "label": "temp =", "type": "assigned_variable", "loc": [76, 76], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L76_C8", "vector": [14, 3, 0.2159, 0.0028, 3, 0.03, 0.5, 915, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "temp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if c == 'x': millis = float(''.join(temp)); temp = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L77_C8", "label": "if", "type": "if", "loc": [77, 81], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L76_C8", "vector": [4, 3, 0.2244, 0.0142, 3, 0.03, 1.0, 0, 0, 0, 0, 0, 0, 0, 9], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif c == 's': secs = float(''.join(temp)); temp = []\n elif c == 'm': mins = float(''.join(temp)); temp = []\n elif c == 'h': hours = float(''.join(temp)); temp = []\n elif c == 'p': days = float(''.join(temp)); temp = []\n else: temp.append(c)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L77_C23", "label": "secs = float()", "type": "assigned_variable", "loc": [77, 77], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L77_C8", "vector": [14, 4, 0.2188, 0.0028, 4, 0.41, 0.0, 584, 3, 1, 0, 0, 639, 10, 2], "semantic": {"name": "secs", "arg_names": [], "import_names": [], "rhs_call_name": "float", "annotation": ""}, "snippet": " elif c == 's': secs = float(''.join(temp)); temp = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L77_C54", "label": "temp =", "type": "assigned_variable", "loc": [77, 77], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L77_C8", "vector": [14, 4, 0.2188, 0.0028, 4, 0.41, 0.5, 915, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "temp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif c == 's': secs = float(''.join(temp)); temp = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L78_C8", "label": "if", "type": "if", "loc": [78, 81], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L77_C8", "vector": [4, 4, 0.2259, 0.0114, 4, 0.41, 1.0, 0, 0, 0, 0, 0, 0, 0, 7], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif c == 'm': mins = float(''.join(temp)); temp = []\n elif c == 'h': hours = float(''.join(temp)); temp = []\n elif c == 'p': days = float(''.join(temp)); temp = []\n else: temp.append(c)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L78_C23", "label": "mins = float()", "type": "assigned_variable", "loc": [78, 78], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L78_C8", "vector": [14, 5, 0.2216, 0.0028, 5, 0.03, 0.0, 606, 3, 1, 0, 0, 639, 10, 2], "semantic": {"name": "mins", "arg_names": [], "import_names": [], "rhs_call_name": "float", "annotation": ""}, "snippet": " elif c == 'm': mins = float(''.join(temp)); temp = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L78_C54", "label": "temp =", "type": "assigned_variable", "loc": [78, 78], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L78_C8", "vector": [14, 5, 0.2216, 0.0028, 5, 0.03, 0.5, 915, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "temp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif c == 'm': mins = float(''.join(temp)); temp = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L79_C8", "label": "if", "type": "if", "loc": [79, 81], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L78_C8", "vector": [4, 5, 0.2273, 0.0085, 5, 0.03, 1.0, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif c == 'h': hours = float(''.join(temp)); temp = []\n elif c == 'p': days = float(''.join(temp)); temp = []\n else: temp.append(c)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L79_C23", "label": "hours = float()", "type": "assigned_variable", "loc": [79, 79], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L79_C8", "vector": [14, 6, 0.2244, 0.0028, 6, 0.06, 0.0, 855, 3, 1, 0, 0, 639, 10, 2], "semantic": {"name": "hours", "arg_names": [], "import_names": [], "rhs_call_name": "float", "annotation": ""}, "snippet": " elif c == 'h': hours = float(''.join(temp)); temp = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L79_C54", "label": "temp =", "type": "assigned_variable", "loc": [79, 79], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L79_C8", "vector": [14, 6, 0.2244, 0.0028, 6, 0.06, 0.5, 915, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "temp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif c == 'h': hours = float(''.join(temp)); temp = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L80_C8", "label": "if", "type": "if", "loc": [80, 81], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L79_C8", "vector": [4, 6, 0.2287, 0.0057, 6, 0.06, 1.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif c == 'p': days = float(''.join(temp)); temp = []\n else: temp.append(c)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L80_C23", "label": "days = float()", "type": "assigned_variable", "loc": [80, 80], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L80_C8", "vector": [14, 7, 0.2273, 0.0028, 7, 0.18, 0.0, 939, 3, 1, 0, 0, 639, 10, 2], "semantic": {"name": "days", "arg_names": [], "import_names": [], "rhs_call_name": "float", "annotation": ""}, "snippet": " elif c == 'p': days = float(''.join(temp)); temp = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L80_C54", "label": "temp =", "type": "assigned_variable", "loc": [80, 80], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L80_C8", "vector": [14, 7, 0.2273, 0.0028, 7, 0.18, 0.5, 915, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "temp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif c == 'p': days = float(''.join(temp)); temp = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Expr_L81_C14", "label": "append()", "type": "expression", "loc": [81, 81], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L80_C8", "vector": [8, 7, 0.2301, 0.0028, 7, 0.18, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " else: temp.append(c)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L82_C4", "label": "if", "type": "if", "loc": [82, 83], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L60_C0", "vector": [4, 1, 0.2344, 0.0057, 1, 0.04, 0.875, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if temp:\n raise ValueError"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Return_L84_C4", "label": "return", "type": "return", "loc": [84, 84], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L60_C0", "vector": [13, 1, 0.2386, 0.0028, 1, 0.04, 1.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return sign * (millis/1000 + secs + mins*60 + hours*60*60 + days*60*60*24)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L86_C0", "label": "_normalize_timestr", "type": "function", "loc": [86, 102], "level": 0, "parent": null, "vector": [2, 0, 0.267, 0.0483, 0, 0.66, 0.3913, 361, 0, 1, 1, 0, 0, 0, 9], "semantic": {"name": "_normalize_timestr", "arg_names": ["timestr"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def _normalize_timestr(timestr):\n if isinstance(timestr, (int, long, float)):\n return timestr\n timestr = normalize(timestr)\n for item in 'milliseconds', 'millisecond', 'millis':\n timestr = timestr.replace(item, 'ms')\n for item in 'seconds', 'second', 'secs', 'sec':\n timestr = timestr.replace(item, 's')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L87_C4", "label": "if", "type": "if", "loc": [87, 88], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L86_C0", "vector": [4, 1, 0.2486, 0.0057, 1, 0.48, 0.0, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if isinstance(timestr, (int, long, float)):\n return timestr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Return_L88_C8", "label": "return", "type": "return", "loc": [88, 88], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L87_C4", "vector": [13, 2, 0.25, 0.0028, 2, 0.28, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return timestr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L89_C4", "label": "timestr = normalize()", "type": "assigned_variable", "loc": [89, 89], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L86_C0", "vector": [14, 1, 0.2528, 0.0028, 1, 0.48, 0.1429, 333, 3, 1, 0, 0, 257, 10, 1], "semantic": {"name": "timestr", "arg_names": [], "import_names": [], "rhs_call_name": "normalize", "annotation": ""}, "snippet": " timestr = normalize(timestr)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:For_L90_C4", "label": "for item", "type": "for", "loc": [90, 91], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L86_C0", "vector": [6, 1, 0.2571, 0.0057, 1, 0.48, 0.2857, 434, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "item", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for item in 'milliseconds', 'millisecond', 'millis':\n timestr = timestr.replace(item, 'ms')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L91_C8", "label": "timestr = replace()", "type": "assigned_variable", "loc": [91, 91], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:For_L90_C4", "vector": [14, 2, 0.2585, 0.0028, 2, 0.64, 0.0, 333, 3, 2, 0, 0, 293, 10, 1], "semantic": {"name": "timestr", "arg_names": [], "import_names": [], "rhs_call_name": "replace", "annotation": ""}, "snippet": " timestr = timestr.replace(item, 'ms')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:For_L92_C4", "label": "for item", "type": "for", "loc": [92, 93], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L86_C0", "vector": [6, 1, 0.2628, 0.0057, 1, 0.48, 0.4286, 434, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "item", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for item in 'seconds', 'second', 'secs', 'sec':\n timestr = timestr.replace(item, 's')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L93_C8", "label": "timestr = replace()", "type": "assigned_variable", "loc": [93, 93], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:For_L92_C4", "vector": [14, 2, 0.2642, 0.0028, 2, 0.36, 0.0, 333, 3, 2, 0, 0, 293, 10, 1], "semantic": {"name": "timestr", "arg_names": [], "import_names": [], "rhs_call_name": "replace", "annotation": ""}, "snippet": " timestr = timestr.replace(item, 's')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:For_L94_C4", "label": "for item", "type": "for", "loc": [94, 95], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L86_C0", "vector": [6, 1, 0.2685, 0.0057, 1, 0.48, 0.5714, 434, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "item", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for item in 'minutes', 'minute', 'mins', 'min':\n timestr = timestr.replace(item, 'm')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L95_C8", "label": "timestr = replace()", "type": "assigned_variable", "loc": [95, 95], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:For_L94_C4", "vector": [14, 2, 0.2699, 0.0028, 2, 0.27, 0.0, 333, 3, 2, 0, 0, 293, 10, 1], "semantic": {"name": "timestr", "arg_names": [], "import_names": [], "rhs_call_name": "replace", "annotation": ""}, "snippet": " timestr = timestr.replace(item, 'm')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:For_L96_C4", "label": "for item", "type": "for", "loc": [96, 97], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L86_C0", "vector": [6, 1, 0.2741, 0.0057, 1, 0.48, 0.7143, 434, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "item", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for item in 'hours', 'hour':\n timestr = timestr.replace(item, 'h')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L97_C8", "label": "timestr = replace()", "type": "assigned_variable", "loc": [97, 97], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:For_L96_C4", "vector": [14, 2, 0.2756, 0.0028, 2, 0.05, 0.0, 333, 3, 2, 0, 0, 293, 10, 1], "semantic": {"name": "timestr", "arg_names": [], "import_names": [], "rhs_call_name": "replace", "annotation": ""}, "snippet": " timestr = timestr.replace(item, 'h')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:For_L98_C4", "label": "for item", "type": "for", "loc": [98, 99], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L86_C0", "vector": [6, 1, 0.2798, 0.0057, 1, 0.48, 0.8571, 434, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "item", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for item in 'days', 'day':\n timestr = timestr.replace(item, 'd')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L99_C8", "label": "timestr = replace()", "type": "assigned_variable", "loc": [99, 99], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:For_L98_C4", "vector": [14, 2, 0.2812, 0.0028, 2, 0.33, 0.0, 333, 3, 2, 0, 0, 293, 10, 1], "semantic": {"name": "timestr", "arg_names": [], "import_names": [], "rhs_call_name": "replace", "annotation": ""}, "snippet": " timestr = timestr.replace(item, 'd')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Return_L102_C4", "label": "return", "type": "return", "loc": [102, 102], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L86_C0", "vector": [13, 1, 0.2898, 0.0028, 1, 0.48, 1.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return timestr.replace('ms','x').replace('d','p')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L105_C0", "label": "secs_to_timestr", "type": "function", "loc": [105, 118], "level": 0, "parent": null, "vector": [2, 0, 0.3168, 0.0398, 0, 0.66, 0.4348, 57, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "secs_to_timestr", "arg_names": ["secs", "compact"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def secs_to_timestr(secs, compact=False):\n \"\"\"Converts time in seconds to a string representation.\n\n Returned string is in format like\n '1 day 2 hours 3 minutes 4 seconds 5 milliseconds' with following rules.\n - Time parts having zero value are not included (e.g. '3 minutes 4 seconds'\n instead of '0 days 0 hours 3 minutes 4 seconds')\n - Hour part has a maximun of 23 and minutes and seconds both have 59"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Expr_L106_C4", "label": "expression", "type": "expression", "loc": [106, 117], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L105_C0", "vector": [8, 1, 0.3168, 0.0341, 1, 0.55, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Converts time in seconds to a string representation.\n\n Returned string is in format like\n '1 day 2 hours 3 minutes 4 seconds 5 milliseconds' with following rules.\n - Time parts having zero value are not included (e.g. '3 minutes 4 seconds'\n instead of '0 days 0 hours 3 minutes 4 seconds')\n - Hour part has a maximun of 23 and minutes and seconds both have 59\n (e.g. '1 minute 40 seconds' instead of '100 seconds')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Return_L118_C4", "label": "return", "type": "return", "loc": [118, 118], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L105_C0", "vector": [13, 1, 0.3352, 0.0028, 1, 0.55, 1.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return _SecsToTimestrHelper(secs, compact).get_value()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:ClassDef_L120_C0", "label": "_SecsToTimestrHelper", "type": "class", "loc": [120, 158], "level": 0, "parent": null, "vector": [3, 0, 0.3949, 0.1108, 0, 0.66, 0.4783, 203, 0, 4, 0, 0, 0, 0, 15], "semantic": {"name": "_SecsToTimestrHelper", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class _SecsToTimestrHelper:\n\n def __init__(self, float_secs, compact):\n self._compact = compact\n self._ret = []\n self._sign, millis, secs, mins, hours, days \\\n = self._secs_to_components(float_secs)\n self._add_item(days, 'd', 'day')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L122_C4", "label": "__init__", "type": "function", "loc": [122, 131], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:ClassDef_L120_C0", "vector": [2, 1, 0.3594, 0.0284, 1, 0.64, 0.0, 555, 0, 3, 0, 0, 0, 0, 6], "semantic": {"name": "__init__", "arg_names": ["self", "float_secs", "compact"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, float_secs, compact):\n self._compact = compact\n self._ret = []\n self._sign, millis, secs, mins, hours, days \\\n = self._secs_to_components(float_secs)\n self._add_item(days, 'd', 'day')\n self._add_item(hours, 'h', 'hour')\n self._add_item(mins, 'min', 'minute')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L123_C8", "label": "self._compact =", "type": "assigned_variable", "loc": [123, 123], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L122_C4", "vector": [14, 2, 0.3494, 0.0028, 2, 0.84, 0.0, 384, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._compact", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._compact = compact"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L124_C8", "label": "self._ret =", "type": "assigned_variable", "loc": [124, 124], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L122_C4", "vector": [14, 2, 0.3523, 0.0028, 2, 0.84, 0.1429, 519, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self._ret", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._ret = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L125_C8", "label": "millis, secs, mins, hours, days = _secs_to_components()", "type": "assigned_variable", "loc": [125, 126], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L122_C4", "vector": [14, 2, 0.3565, 0.0057, 2, 0.84, 0.2857, 351, 3, 1, 0, 0, 298, 10, 1], "semantic": {"name": "millis, secs, mins, hours, days", "arg_names": [], "import_names": [], "rhs_call_name": "_secs_to_components", "annotation": ""}, "snippet": " self._sign, millis, secs, mins, hours, days \\\n = self._secs_to_components(float_secs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Expr_L127_C8", "label": "_add_item()", "type": "expression", "loc": [127, 127], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L122_C4", "vector": [8, 2, 0.3608, 0.0028, 2, 0.84, 0.4286, 895, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "_add_item", "arg_names": [], "import_names": [], "rhs_call_name": "_add_item", "annotation": ""}, "snippet": " self._add_item(days, 'd', 'day')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Expr_L128_C8", "label": "_add_item()", "type": "expression", "loc": [128, 128], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L122_C4", "vector": [8, 2, 0.3636, 0.0028, 2, 0.84, 0.5714, 895, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "_add_item", "arg_names": [], "import_names": [], "rhs_call_name": "_add_item", "annotation": ""}, "snippet": " self._add_item(hours, 'h', 'hour')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Expr_L129_C8", "label": "_add_item()", "type": "expression", "loc": [129, 129], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L122_C4", "vector": [8, 2, 0.3665, 0.0028, 2, 0.84, 0.7143, 895, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "_add_item", "arg_names": [], "import_names": [], "rhs_call_name": "_add_item", "annotation": ""}, "snippet": " self._add_item(mins, 'min', 'minute')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Expr_L130_C8", "label": "_add_item()", "type": "expression", "loc": [130, 130], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L122_C4", "vector": [8, 2, 0.3693, 0.0028, 2, 0.84, 0.8571, 895, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "_add_item", "arg_names": [], "import_names": [], "rhs_call_name": "_add_item", "annotation": ""}, "snippet": " self._add_item(secs, 's', 'second')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Expr_L131_C8", "label": "_add_item()", "type": "expression", "loc": [131, 131], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L122_C4", "vector": [8, 2, 0.3722, 0.0028, 2, 0.84, 1.0, 895, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "_add_item", "arg_names": [], "import_names": [], "rhs_call_name": "_add_item", "annotation": ""}, "snippet": " self._add_item(millis, 'ms', 'millisecond')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L133_C4", "label": "get_value", "type": "function", "loc": [133, 136], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:ClassDef_L120_C0", "vector": [2, 1, 0.3821, 0.0114, 1, 0.64, 0.3333, 873, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "get_value", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_value(self):\n if len(self._ret) > 0:\n return self._sign + ' '.join(self._ret)\n return '0s' if self._compact else '0 seconds'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L134_C8", "label": "if", "type": "if", "loc": [134, 135], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L133_C4", "vector": [4, 2, 0.3821, 0.0057, 2, 0.19, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(self._ret) > 0:\n return self._sign + ' '.join(self._ret)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Return_L135_C12", "label": "return", "type": "return", "loc": [135, 135], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L134_C8", "vector": [13, 3, 0.3835, 0.0028, 3, 0.68, 0.0, 0, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._sign + ' '.join(self._ret)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Return_L136_C8", "label": "return", "type": "return", "loc": [136, 136], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L133_C4", "vector": [13, 2, 0.3864, 0.0028, 2, 0.19, 1.0, 0, 8, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return '0s' if self._compact else '0 seconds'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L138_C4", "label": "_add_item", "type": "function", "loc": [138, 145], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:ClassDef_L120_C0", "vector": [2, 1, 0.402, 0.0227, 1, 0.64, 0.6667, 895, 0, 4, 0, 0, 0, 0, 2], "semantic": {"name": "_add_item", "arg_names": ["self", "value", "compact_suffix", "long_suffix"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _add_item(self, value, compact_suffix, long_suffix):\n if value == 0:\n return\n if self._compact:\n suffix = compact_suffix\n else:\n suffix = ' %s%s' % (long_suffix, plural_or_not(value))\n self._ret.append('%d%s' % (value, suffix))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L139_C8", "label": "if", "type": "if", "loc": [139, 140], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L138_C4", "vector": [4, 2, 0.3963, 0.0057, 2, 0.84, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if value == 0:\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Return_L140_C12", "label": "return", "type": "return", "loc": [140, 140], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L139_C8", "vector": [13, 3, 0.3977, 0.0028, 3, 0.99, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L141_C8", "label": "if", "type": "if", "loc": [141, 144], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L138_C4", "vector": [4, 2, 0.4048, 0.0114, 2, 0.84, 0.5, 0, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self._compact:\n suffix = compact_suffix\n else:\n suffix = ' %s%s' % (long_suffix, plural_or_not(value))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L142_C12", "label": "suffix =", "type": "assigned_variable", "loc": [142, 142], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L141_C8", "vector": [14, 3, 0.4034, 0.0028, 3, 0.18, 0.0, 578, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "suffix", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " suffix = compact_suffix"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L144_C12", "label": "suffix =", "type": "assigned_variable", "loc": [144, 144], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L141_C8", "vector": [14, 3, 0.4091, 0.0028, 3, 0.18, 1.0, 578, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "suffix", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " suffix = ' %s%s' % (long_suffix, plural_or_not(value))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Expr_L145_C8", "label": "append()", "type": "expression", "loc": [145, 145], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L138_C4", "vector": [8, 2, 0.4119, 0.0028, 2, 0.84, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self._ret.append('%d%s' % (value, suffix))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L147_C4", "label": "_secs_to_components", "type": "function", "loc": [147, 158], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:ClassDef_L120_C0", "vector": [2, 1, 0.4332, 0.0341, 1, 0.64, 1.0, 298, 0, 2, 1, 0, 0, 0, 5], "semantic": {"name": "_secs_to_components", "arg_names": ["self", "float_secs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _secs_to_components(self, float_secs):\n if float_secs < 0:\n sign = '- '\n float_secs = abs(float_secs)\n else:\n sign = ''\n int_secs, millis = _float_secs_to_secs_and_millis(float_secs)\n secs = int_secs % 60"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L148_C8", "label": "if", "type": "if", "loc": [148, 152], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L147_C4", "vector": [4, 2, 0.4261, 0.0142, 2, 0.32, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if float_secs < 0:\n sign = '- '\n float_secs = abs(float_secs)\n else:\n sign = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L149_C12", "label": "sign =", "type": "assigned_variable", "loc": [149, 149], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L148_C8", "vector": [14, 3, 0.4233, 0.0028, 3, 0.22, 0.0, 448, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "sign", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " sign = '- '"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L150_C12", "label": "float_secs = abs()", "type": "assigned_variable", "loc": [150, 150], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L148_C8", "vector": [14, 3, 0.4261, 0.0028, 3, 0.22, 0.5, 944, 3, 1, 0, 0, 799, 10, 1], "semantic": {"name": "float_secs", "arg_names": [], "import_names": [], "rhs_call_name": "abs", "annotation": ""}, "snippet": " float_secs = abs(float_secs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L152_C12", "label": "sign =", "type": "assigned_variable", "loc": [152, 152], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L148_C8", "vector": [14, 3, 0.4318, 0.0028, 3, 0.22, 1.0, 448, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "sign", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " sign = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L153_C8", "label": "int_secs, millis = _float_secs_to_secs_and_millis()", "type": "assigned_variable", "loc": [153, 153], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L147_C4", "vector": [14, 2, 0.4347, 0.0028, 2, 0.32, 0.1667, 338, 3, 1, 0, 0, 218, 10, 1], "semantic": {"name": "int_secs, millis", "arg_names": [], "import_names": [], "rhs_call_name": "_float_secs_to_secs_and_millis", "annotation": ""}, "snippet": " int_secs, millis = _float_secs_to_secs_and_millis(float_secs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L154_C8", "label": "secs =", "type": "assigned_variable", "loc": [154, 154], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L147_C4", "vector": [14, 2, 0.4375, 0.0028, 2, 0.32, 0.3333, 584, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "secs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " secs = int_secs % 60"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L155_C8", "label": "mins =", "type": "assigned_variable", "loc": [155, 155], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L147_C4", "vector": [14, 2, 0.4403, 0.0028, 2, 0.32, 0.5, 606, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "mins", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mins = int(int_secs / 60) % 60"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L156_C8", "label": "hours =", "type": "assigned_variable", "loc": [156, 156], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L147_C4", "vector": [14, 2, 0.4432, 0.0028, 2, 0.32, 0.6667, 855, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "hours", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " hours = int(int_secs / (60*60)) % 24"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L157_C8", "label": "days = int()", "type": "assigned_variable", "loc": [157, 157], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L147_C4", "vector": [14, 2, 0.446, 0.0028, 2, 0.32, 0.8333, 939, 3, 1, 0, 0, 901, 10, 1], "semantic": {"name": "days", "arg_names": [], "import_names": [], "rhs_call_name": "int", "annotation": ""}, "snippet": " days = int(int_secs / (60*60*24))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Return_L158_C8", "label": "return", "type": "return", "loc": [158, 158], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L147_C4", "vector": [13, 2, 0.4489, 0.0028, 2, 0.32, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return sign, millis, secs, mins, hours, days"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L161_C0", "label": "format_time", "type": "function", "loc": [161, 182], "level": 0, "parent": null, "vector": [2, 0, 0.4872, 0.0625, 0, 0.66, 0.5217, 294, 0, 6, 1, 0, 0, 0, 5], "semantic": {"name": "format_time", "arg_names": ["timetuple_or_epochsecs", "daysep", "daytimesep", "timesep", "millissep", "gmtsep"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def format_time(timetuple_or_epochsecs, daysep='', daytimesep=' ', timesep=':',\n millissep=None, gmtsep=None):\n \"\"\"Returns a timestamp formatted from given time using separators.\n\n Time can be given either as a timetuple or seconds after epoch.\n\n Timetuple is (year, month, day, hour, min, sec[, millis]), where parts must\n be integers and millis is required only when millissep is not None."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Expr_L163_C4", "label": "expression", "type": "expression", "loc": [163, 173], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L161_C0", "vector": [8, 1, 0.4773, 0.0312, 1, 0.27, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Returns a timestamp formatted from given time using separators.\n\n Time can be given either as a timetuple or seconds after epoch.\n\n Timetuple is (year, month, day, hour, min, sec[, millis]), where parts must\n be integers and millis is required only when millissep is not None.\n Notice that this is not 100% compatible with standard Python timetuples\n which do not have millis."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L174_C4", "label": "if", "type": "if", "loc": [174, 177], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L161_C0", "vector": [4, 1, 0.4986, 0.0114, 1, 0.27, 0.1667, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if isinstance(timetuple_or_epochsecs, (int, long, float)):\n timetuple = _get_timetuple(timetuple_or_epochsecs)\n else:\n timetuple = timetuple_or_epochsecs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L175_C8", "label": "timetuple = _get_timetuple()", "type": "assigned_variable", "loc": [175, 175], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L174_C4", "vector": [14, 2, 0.4972, 0.0028, 2, 0.33, 0.0, 908, 3, 1, 0, 0, 75, 10, 1], "semantic": {"name": "timetuple", "arg_names": [], "import_names": [], "rhs_call_name": "_get_timetuple", "annotation": ""}, "snippet": " timetuple = _get_timetuple(timetuple_or_epochsecs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L177_C8", "label": "timetuple =", "type": "assigned_variable", "loc": [177, 177], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L174_C4", "vector": [14, 2, 0.5028, 0.0028, 2, 0.33, 1.0, 908, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "timetuple", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " timetuple = timetuple_or_epochsecs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L178_C4", "label": "daytimeparts =", "type": "assigned_variable", "loc": [178, 178], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L161_C0", "vector": [14, 1, 0.5057, 0.0028, 1, 0.27, 0.3333, 624, 5, 0, 0, 0, 0, 0, 0], "semantic": {"name": "daytimeparts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " daytimeparts = ['%02d' % t for t in timetuple[:6]]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L179_C4", "label": "day = join()", "type": "assigned_variable", "loc": [179, 179], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L161_C0", "vector": [14, 1, 0.5085, 0.0028, 1, 0.27, 0.5, 878, 3, 1, 0, 0, 933, 10, 1], "semantic": {"name": "day", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": " day = daysep.join(daytimeparts[:3])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L180_C4", "label": "time_ = join()", "type": "assigned_variable", "loc": [180, 180], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L161_C0", "vector": [14, 1, 0.5114, 0.0028, 1, 0.27, 0.6667, 169, 3, 1, 0, 0, 933, 10, 1], "semantic": {"name": "time_", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": " time_ = timesep.join(daytimeparts[3:6])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L181_C4", "label": "millis =", "type": "assigned_variable", "loc": [181, 181], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L161_C0", "vector": [14, 1, 0.5142, 0.0028, 1, 0.27, 0.8333, 889, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "millis", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " millis = millissep and '%s%03d' % (millissep, timetuple[6]) or ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Return_L182_C4", "label": "return", "type": "return", "loc": [182, 182], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L161_C0", "vector": [13, 1, 0.517, 0.0028, 1, 0.27, 1.0, 0, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return day + daytimesep + time_ + millis + _diff_to_gmt(gmtsep)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L184_C0", "label": "_diff_to_gmt", "type": "function", "loc": [184, 195], "level": 0, "parent": null, "vector": [2, 0, 0.5384, 0.0341, 0, 0.66, 0.5652, 953, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "_diff_to_gmt", "arg_names": ["sep"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def _diff_to_gmt(sep):\n if not sep:\n return ''\n if time.altzone == 0:\n sign = ''\n elif time.altzone > 0:\n sign = '-'\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L185_C4", "label": "if", "type": "if", "loc": [185, 186], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L184_C0", "vector": [4, 1, 0.527, 0.0057, 1, 0.21, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not sep:\n return ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Return_L186_C8", "label": "return", "type": "return", "loc": [186, 186], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L185_C4", "vector": [13, 2, 0.5284, 0.0028, 2, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L187_C4", "label": "if", "type": "if", "loc": [187, 192], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L184_C0", "vector": [4, 1, 0.5384, 0.017, 1, 0.21, 0.25, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if time.altzone == 0:\n sign = ''\n elif time.altzone > 0:\n sign = '-'\n else:\n sign = '+'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L188_C8", "label": "sign =", "type": "assigned_variable", "loc": [188, 188], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L187_C4", "vector": [14, 2, 0.5341, 0.0028, 2, 0.9, 0.0, 448, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "sign", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " sign = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L189_C4", "label": "if", "type": "if", "loc": [189, 192], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L187_C4", "vector": [4, 2, 0.5412, 0.0114, 2, 0.9, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif time.altzone > 0:\n sign = '-'\n else:\n sign = '+'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L190_C8", "label": "sign =", "type": "assigned_variable", "loc": [190, 190], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L189_C4", "vector": [14, 3, 0.5398, 0.0028, 3, 0.14, 0.0, 448, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "sign", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " sign = '-'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L192_C8", "label": "sign =", "type": "assigned_variable", "loc": [192, 192], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L189_C4", "vector": [14, 3, 0.5455, 0.0028, 3, 0.14, 1.0, 448, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "sign", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " sign = '+'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L193_C4", "label": "minutes =", "type": "assigned_variable", "loc": [193, 193], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L184_C0", "vector": [14, 1, 0.5483, 0.0028, 1, 0.21, 0.5, 234, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "minutes", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " minutes = abs(time.altzone) / 60.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L194_C4", "label": "hours, minutes = divmod()", "type": "assigned_variable", "loc": [194, 194], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L184_C0", "vector": [14, 1, 0.5511, 0.0028, 1, 0.21, 0.75, 441, 3, 2, 0, 0, 120, 10, 1], "semantic": {"name": "hours, minutes", "arg_names": [], "import_names": [], "rhs_call_name": "divmod", "annotation": ""}, "snippet": " hours, minutes = divmod(minutes, 60)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Return_L195_C4", "label": "return", "type": "return", "loc": [195, 195], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L184_C0", "vector": [13, 1, 0.554, 0.0028, 1, 0.21, 1.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return '%sGMT%s%s%02d:%02d' % (sep, sep, sign, hours, minutes)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L198_C0", "label": "get_time", "type": "function", "loc": [198, 233], "level": 0, "parent": null, "vector": [2, 0, 0.6122, 0.1023, 0, 0.66, 0.6087, 164, 0, 2, 1, 0, 0, 0, 9], "semantic": {"name": "get_time", "arg_names": ["format", "time_"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def get_time(format='timestamp', time_=None):\n \"\"\"Return the given or current time in requested format.\n\n If time is not given, current time is used. How time is returned is\n is deternined based on the given 'format' string as follows. Note that all\n checks are case insensitive.\n\n - If 'format' contains word 'epoch' the time is returned in seconds after"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Expr_L199_C4", "label": "expression", "type": "expression", "loc": [199, 214], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L198_C0", "vector": [8, 1, 0.5866, 0.0455, 1, 0.38, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Return the given or current time in requested format.\n\n If time is not given, current time is used. How time is returned is\n is deternined based on the given 'format' string as follows. Note that all\n checks are case insensitive.\n\n - If 'format' contains word 'epoch' the time is returned in seconds after\n the unix epoch."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L215_C4", "label": "if", "type": "if", "loc": [215, 216], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L198_C0", "vector": [4, 1, 0.6122, 0.0057, 1, 0.38, 0.1429, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if time_ is None:\n time_ = time.time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L216_C8", "label": "time_ = time()", "type": "assigned_variable", "loc": [216, 216], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L215_C4", "vector": [14, 2, 0.6136, 0.0028, 2, 0.06, 0.0, 169, 3, 0, 0, 0, 654, 10, 1], "semantic": {"name": "time_", "arg_names": [], "import_names": [], "rhs_call_name": "time", "annotation": ""}, "snippet": " time_ = time.time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L217_C4", "label": "format = lower()", "type": "assigned_variable", "loc": [217, 217], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L198_C0", "vector": [14, 1, 0.6165, 0.0028, 1, 0.38, 0.2857, 293, 3, 0, 0, 0, 432, 10, 1], "semantic": {"name": "format", "arg_names": [], "import_names": [], "rhs_call_name": "lower", "annotation": ""}, "snippet": " format = format.lower()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L219_C4", "label": "if", "type": "if", "loc": [219, 220], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L198_C0", "vector": [4, 1, 0.6236, 0.0057, 1, 0.38, 0.4286, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if 'epoch' in format:\n return int(time_)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Return_L220_C8", "label": "return", "type": "return", "loc": [220, 220], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L219_C4", "vector": [13, 2, 0.625, 0.0028, 2, 0.53, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return int(time_)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L221_C4", "label": "timetuple = localtime()", "type": "assigned_variable", "loc": [221, 221], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L198_C0", "vector": [14, 1, 0.6278, 0.0028, 1, 0.38, 0.5714, 908, 3, 1, 0, 0, 227, 10, 1], "semantic": {"name": "timetuple", "arg_names": [], "import_names": [], "rhs_call_name": "localtime", "annotation": ""}, "snippet": " timetuple = time.localtime(time_)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L222_C4", "label": "parts =", "type": "assigned_variable", "loc": [222, 222], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L198_C0", "vector": [14, 1, 0.6307, 0.0028, 1, 0.38, 0.7143, 13, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "parts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " parts = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:For_L223_C4", "label": "for i, match", "type": "for", "loc": [223, 225], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L198_C0", "vector": [6, 1, 0.6364, 0.0085, 1, 0.38, 0.8571, 772, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "i, match", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i, match in enumerate('year month day hour min sec'.split()):\n if match in format:\n parts.append('%.2d' % timetuple[i])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L224_C8", "label": "if", "type": "if", "loc": [224, 225], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:For_L223_C4", "vector": [4, 2, 0.6378, 0.0057, 2, 0.26, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if match in format:\n parts.append('%.2d' % timetuple[i])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Expr_L225_C12", "label": "append()", "type": "expression", "loc": [225, 225], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L224_C8", "vector": [8, 3, 0.6392, 0.0028, 3, 0.68, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " parts.append('%.2d' % timetuple[i])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L227_C4", "label": "if", "type": "if", "loc": [227, 233], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L198_C0", "vector": [4, 1, 0.6534, 0.0199, 1, 0.38, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not parts:\n return format_time(timetuple, daysep='-')\n # Return requested parts of the time\n elif len(parts) == 1:\n return parts[0]\n else:\n return parts"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Return_L228_C8", "label": "return", "type": "return", "loc": [228, 228], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L227_C4", "vector": [13, 2, 0.6477, 0.0028, 2, 0.68, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return format_time(timetuple, daysep='-')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L230_C4", "label": "if", "type": "if", "loc": [230, 233], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L227_C4", "vector": [4, 2, 0.6577, 0.0114, 2, 0.68, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif len(parts) == 1:\n return parts[0]\n else:\n return parts"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Return_L231_C8", "label": "return", "type": "return", "loc": [231, 231], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L230_C4", "vector": [13, 3, 0.6562, 0.0028, 3, 0.56, 0.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return parts[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Return_L233_C8", "label": "return", "type": "return", "loc": [233, 233], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L230_C4", "vector": [13, 3, 0.6619, 0.0028, 3, 0.56, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return parts"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L236_C0", "label": "parse_time", "type": "function", "loc": [236, 270], "level": 0, "parent": null, "vector": [2, 0, 0.7188, 0.0994, 0, 0.66, 0.6522, 78, 0, 1, 1, 0, 0, 0, 11], "semantic": {"name": "parse_time", "arg_names": ["timestr"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def parse_time(timestr):\n \"\"\"Parses the time string and returns its value as seconds since epoch.\n\n Time can be given in four different formats:\n\n 1) Numbers are interpreted as time since epoch directly. It is possible to\n use also ints and floats, not only strings containing numbers.\n 2) Valid timestamp ('YYYY-MM-DD hh:mm:ss' and 'YYYYMMDD hhmmss')."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Expr_L237_C4", "label": "expression", "type": "expression", "loc": [237, 248], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L236_C0", "vector": [8, 1, 0.6889, 0.0341, 1, 0.81, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Parses the time string and returns its value as seconds since epoch.\n\n Time can be given in four different formats:\n\n 1) Numbers are interpreted as time since epoch directly. It is possible to\n use also ints and floats, not only strings containing numbers.\n 2) Valid timestamp ('YYYY-MM-DD hh:mm:ss' and 'YYYYMMDD hhmmss').\n 3) 'NOW' (case-insensitive) is the current time rounded down to the"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Try_L249_C4", "label": "try", "type": "try", "loc": [249, 256], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L236_C0", "vector": [7, 1, 0.7173, 0.0227, 1, 0.81, 0.1667, 0, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n ret = int(timestr)\n except ValueError:\n pass\n else:\n if ret < 0:\n raise ValueError(\"Epoch time must be positive (got %s)\" % timestr)\n return ret"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L250_C8", "label": "ret = int()", "type": "assigned_variable", "loc": [250, 250], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:Try_L249_C4", "vector": [14, 2, 0.7102, 0.0028, 2, 0.88, 0.0, 501, 3, 1, 0, 0, 901, 10, 1], "semantic": {"name": "ret", "arg_names": [], "import_names": [], "rhs_call_name": "int", "annotation": ""}, "snippet": " ret = int(timestr)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L254_C8", "label": "if", "type": "if", "loc": [254, 255], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:Try_L249_C4", "vector": [4, 2, 0.723, 0.0057, 2, 0.88, 0.5, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if ret < 0:\n raise ValueError(\"Epoch time must be positive (got %s)\" % timestr)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Return_L256_C8", "label": "return", "type": "return", "loc": [256, 256], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:Try_L249_C4", "vector": [13, 2, 0.7273, 0.0028, 2, 0.88, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ret"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Try_L257_C4", "label": "try", "type": "try", "loc": [257, 260], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L236_C0", "vector": [7, 1, 0.7344, 0.0114, 1, 0.81, 0.3333, 0, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n return timestamp_to_secs(timestr, (' ', ':', '-', '.'))\n except ValueError:\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Return_L258_C8", "label": "return", "type": "return", "loc": [258, 258], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:Try_L257_C4", "vector": [13, 2, 0.733, 0.0028, 2, 0.49, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return timestamp_to_secs(timestr, (' ', ':', '-', '.'))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L261_C4", "label": "normtime = replace()", "type": "assigned_variable", "loc": [261, 261], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L236_C0", "vector": [14, 1, 0.7415, 0.0028, 1, 0.81, 0.5, 490, 3, 2, 0, 0, 293, 10, 2], "semantic": {"name": "normtime", "arg_names": [], "import_names": [], "rhs_call_name": "replace", "annotation": ""}, "snippet": " normtime = timestr.lower().replace(' ', '')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L262_C4", "label": "now = int()", "type": "assigned_variable", "loc": [262, 262], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L236_C0", "vector": [14, 1, 0.7443, 0.0028, 1, 0.81, 0.6667, 894, 3, 1, 0, 0, 901, 10, 2], "semantic": {"name": "now", "arg_names": [], "import_names": [], "rhs_call_name": "int", "annotation": ""}, "snippet": " now = int(time.time())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L263_C4", "label": "if", "type": "if", "loc": [263, 264], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L236_C0", "vector": [4, 1, 0.7486, 0.0057, 1, 0.81, 0.8333, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if normtime == 'now':\n return now"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Return_L264_C8", "label": "return", "type": "return", "loc": [264, 264], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L263_C4", "vector": [13, 2, 0.75, 0.0028, 2, 0.03, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return now"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L265_C4", "label": "if", "type": "if", "loc": [265, 269], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L236_C0", "vector": [4, 1, 0.7585, 0.0142, 1, 0.81, 1.0, 0, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if normtime.startswith('now'):\n if normtime[3] == '+':\n return now + timestr_to_secs(normtime[4:])\n if normtime[3] == '-':\n return now - timestr_to_secs(normtime[4:])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L266_C8", "label": "if", "type": "if", "loc": [266, 267], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L265_C4", "vector": [4, 2, 0.7571, 0.0057, 2, 0.28, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if normtime[3] == '+':\n return now + timestr_to_secs(normtime[4:])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Return_L267_C12", "label": "return", "type": "return", "loc": [267, 267], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L266_C8", "vector": [13, 3, 0.7585, 0.0028, 3, 0.92, 0.0, 0, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return now + timestr_to_secs(normtime[4:])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L268_C8", "label": "if", "type": "if", "loc": [268, 269], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L265_C4", "vector": [4, 2, 0.7628, 0.0057, 2, 0.28, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if normtime[3] == '-':\n return now - timestr_to_secs(normtime[4:])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Return_L269_C12", "label": "return", "type": "return", "loc": [269, 269], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L268_C8", "vector": [13, 3, 0.7642, 0.0028, 3, 0.99, 0.0, 0, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return now - timestr_to_secs(normtime[4:])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L273_C0", "label": "get_timestamp", "type": "function", "loc": [273, 274], "level": 0, "parent": null, "vector": [2, 0, 0.777, 0.0057, 0, 0.66, 0.6957, 398, 0, 4, 1, 0, 0, 0, 2], "semantic": {"name": "get_timestamp", "arg_names": ["daysep", "daytimesep", "timesep", "millissep"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def get_timestamp(daysep='', daytimesep=' ', timesep=':', millissep='.'):\n return format_time(_get_timetuple(), daysep, daytimesep, timesep, millissep)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Return_L274_C4", "label": "return", "type": "return", "loc": [274, 274], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L273_C0", "vector": [13, 1, 0.7784, 0.0028, 1, 0.74, 0.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return format_time(_get_timetuple(), daysep, daytimesep, timesep, millissep)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L277_C0", "label": "timestamp_to_secs", "type": "function", "loc": [277, 284], "level": 0, "parent": null, "vector": [2, 0, 0.7969, 0.0227, 0, 0.66, 0.7391, 618, 0, 3, 1, 0, 0, 0, 5], "semantic": {"name": "timestamp_to_secs", "arg_names": ["timestamp", "seps", "millis"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def timestamp_to_secs(timestamp, seps=('', ' ', ':', '.'), millis=False):\n try:\n secs = _timestamp_to_millis(timestamp, seps) / 1000.0\n except (ValueError, OverflowError):\n raise ValueError(\"Invalid timestamp '%s'\" % timestamp)\n if millis:\n return round(secs, 3)\n return int(round(secs))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Try_L278_C4", "label": "try", "type": "try", "loc": [278, 281], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L277_C0", "vector": [7, 1, 0.794, 0.0114, 1, 0.66, 0.0, 0, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n secs = _timestamp_to_millis(timestamp, seps) / 1000.0\n except (ValueError, OverflowError):\n raise ValueError(\"Invalid timestamp '%s'\" % timestamp)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L279_C8", "label": "secs =", "type": "assigned_variable", "loc": [279, 279], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:Try_L278_C4", "vector": [14, 2, 0.7926, 0.0028, 2, 0.87, 0.0, 584, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "secs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " secs = _timestamp_to_millis(timestamp, seps) / 1000.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L282_C4", "label": "if", "type": "if", "loc": [282, 283], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L277_C0", "vector": [4, 1, 0.8026, 0.0057, 1, 0.66, 0.5, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if millis:\n return round(secs, 3)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Return_L283_C8", "label": "return", "type": "return", "loc": [283, 283], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L282_C4", "vector": [13, 2, 0.804, 0.0028, 2, 0.51, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return round(secs, 3)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Return_L284_C4", "label": "return", "type": "return", "loc": [284, 284], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L277_C0", "vector": [13, 1, 0.8068, 0.0028, 1, 0.66, 1.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return int(round(secs))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L287_C0", "label": "secs_to_timestamp", "type": "function", "loc": [287, 294], "level": 0, "parent": null, "vector": [2, 0, 0.8253, 0.0227, 0, 0.66, 0.7826, 272, 0, 3, 1, 0, 0, 0, 4], "semantic": {"name": "secs_to_timestamp", "arg_names": ["secs", "seps", "millis"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def secs_to_timestamp(secs, seps=None, millis=False):\n if not seps:\n seps = ('', ' ', ':', '.' if millis else None)\n ttuple = time.localtime(secs)[:6]\n if millis:\n millis = (secs - int(secs)) * 1000\n ttuple = ttuple + (int(millis),)\n return format_time(ttuple, *seps)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L288_C4", "label": "if", "type": "if", "loc": [288, 289], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L287_C0", "vector": [4, 1, 0.8196, 0.0057, 1, 0.67, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not seps:\n seps = ('', ' ', ':', '.' if millis else None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L289_C8", "label": "seps =", "type": "assigned_variable", "loc": [289, 289], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L288_C4", "vector": [14, 2, 0.821, 0.0028, 2, 0.06, 0.0, 488, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "seps", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " seps = ('', ' ', ':', '.' if millis else None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L290_C4", "label": "ttuple =", "type": "assigned_variable", "loc": [290, 290], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L287_C0", "vector": [14, 1, 0.8239, 0.0028, 1, 0.67, 0.3333, 987, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "ttuple", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ttuple = time.localtime(secs)[:6]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L291_C4", "label": "if", "type": "if", "loc": [291, 293], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L287_C0", "vector": [4, 1, 0.8295, 0.0085, 1, 0.67, 0.6667, 0, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if millis:\n millis = (secs - int(secs)) * 1000\n ttuple = ttuple + (int(millis),)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L292_C8", "label": "millis =", "type": "assigned_variable", "loc": [292, 292], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L291_C4", "vector": [14, 2, 0.8295, 0.0028, 2, 0.68, 0.0, 889, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "millis", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " millis = (secs - int(secs)) * 1000"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L293_C8", "label": "ttuple =", "type": "assigned_variable", "loc": [293, 293], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L291_C4", "vector": [14, 2, 0.8324, 0.0028, 2, 0.68, 1.0, 987, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "ttuple", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ttuple = ttuple + (int(millis),)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Return_L294_C4", "label": "return", "type": "return", "loc": [294, 294], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L287_C0", "vector": [13, 1, 0.8352, 0.0028, 1, 0.67, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return format_time(ttuple, *seps)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L297_C0", "label": "get_start_timestamp", "type": "function", "loc": [297, 298], "level": 0, "parent": null, "vector": [2, 0, 0.8452, 0.0057, 0, 0.66, 0.8261, 0, 0, 4, 1, 0, 0, 0, 1], "semantic": {"name": "get_start_timestamp", "arg_names": ["daysep", "daytimesep", "timesep", "millissep"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def get_start_timestamp(daysep='', daytimesep=' ', timesep=':', millissep=None):\n return format_time(START_TIME, daysep, daytimesep, timesep, millissep)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Return_L298_C4", "label": "return", "type": "return", "loc": [298, 298], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L297_C0", "vector": [13, 1, 0.8466, 0.0028, 1, 0.82, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return format_time(START_TIME, daysep, daytimesep, timesep, millissep)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L301_C0", "label": "get_elapsed_time", "type": "function", "loc": [301, 317], "level": 0, "parent": null, "vector": [2, 0, 0.8778, 0.0483, 0, 0.66, 0.8696, 17, 0, 3, 1, 0, 0, 0, 4], "semantic": {"name": "get_elapsed_time", "arg_names": ["start_time", "end_time", "seps"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def get_elapsed_time(start_time, end_time=None, seps=('', ' ', ':', '.')):\n \"\"\"Returns the time between given timestamps in milliseconds.\n\n If 'end_time' is not given current timestamp is got with\n get_timestamp using given 'seps'.\n\n 'seps' is a tuple containing 'daysep', 'daytimesep', 'timesep' and\n 'millissep' used in given timestamps."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Expr_L302_C4", "label": "expression", "type": "expression", "loc": [302, 309], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L301_C0", "vector": [8, 1, 0.8679, 0.0227, 1, 0.03, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Returns the time between given timestamps in milliseconds.\n\n If 'end_time' is not given current timestamp is got with\n get_timestamp using given 'seps'.\n\n 'seps' is a tuple containing 'daysep', 'daytimesep', 'timesep' and\n 'millissep' used in given timestamps.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L310_C4", "label": "if", "type": "if", "loc": [310, 311], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L301_C0", "vector": [4, 1, 0.8821, 0.0057, 1, 0.03, 0.2, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if start_time == 'N/A' or end_time == 'N/A':\n return 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Return_L311_C8", "label": "return", "type": "return", "loc": [311, 311], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L310_C4", "vector": [13, 2, 0.8835, 0.0028, 2, 0.38, 0.0, 0, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L312_C4", "label": "if", "type": "if", "loc": [312, 313], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L301_C0", "vector": [4, 1, 0.8878, 0.0057, 1, 0.03, 0.4, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not end_time:\n end_time = get_timestamp(*seps)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L313_C8", "label": "end_time = get_timestamp()", "type": "assigned_variable", "loc": [313, 313], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L312_C4", "vector": [14, 2, 0.8892, 0.0028, 2, 0.42, 0.0, 483, 3, 1, 0, 0, 398, 10, 1], "semantic": {"name": "end_time", "arg_names": [], "import_names": [], "rhs_call_name": "get_timestamp", "annotation": ""}, "snippet": " end_time = get_timestamp(*seps)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L314_C4", "label": "start_millis = _timestamp_to_millis()", "type": "assigned_variable", "loc": [314, 314], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L301_C0", "vector": [14, 1, 0.892, 0.0028, 1, 0.03, 0.6, 209, 3, 2, 0, 0, 348, 10, 1], "semantic": {"name": "start_millis", "arg_names": [], "import_names": [], "rhs_call_name": "_timestamp_to_millis", "annotation": ""}, "snippet": " start_millis = _timestamp_to_millis(start_time, seps)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L315_C4", "label": "end_millis = _timestamp_to_millis()", "type": "assigned_variable", "loc": [315, 315], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L301_C0", "vector": [14, 1, 0.8949, 0.0028, 1, 0.03, 0.8, 317, 3, 2, 0, 0, 348, 10, 1], "semantic": {"name": "end_millis", "arg_names": [], "import_names": [], "rhs_call_name": "_timestamp_to_millis", "annotation": ""}, "snippet": " end_millis = _timestamp_to_millis(end_time, seps)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Return_L317_C4", "label": "return", "type": "return", "loc": [317, 317], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L301_C0", "vector": [13, 1, 0.9006, 0.0028, 1, 0.03, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return int(end_millis - start_millis)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L320_C0", "label": "elapsed_time_to_string", "type": "function", "loc": [320, 332], "level": 0, "parent": null, "vector": [2, 0, 0.9261, 0.0369, 0, 0.66, 0.913, 346, 0, 1, 1, 0, 0, 0, 5], "semantic": {"name": "elapsed_time_to_string", "arg_names": ["elapsed_millis"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def elapsed_time_to_string(elapsed_millis):\n \"\"\"Converts elapsed time in millisecods to format 'hh:mm:ss.mil'\"\"\"\n elapsed_millis = round(elapsed_millis)\n if elapsed_millis < 0:\n pre = '-'\n elapsed_millis = abs(elapsed_millis)\n else:\n pre = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Expr_L321_C4", "label": "expression", "type": "expression", "loc": [321, 321], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L320_C0", "vector": [8, 1, 0.9119, 0.0028, 1, 0.13, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Converts elapsed time in millisecods to format 'hh:mm:ss.mil'\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L322_C4", "label": "elapsed_millis = round()", "type": "assigned_variable", "loc": [322, 322], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L320_C0", "vector": [14, 1, 0.9148, 0.0028, 1, 0.13, 0.1429, 693, 3, 1, 0, 0, 19, 10, 1], "semantic": {"name": "elapsed_millis", "arg_names": [], "import_names": [], "rhs_call_name": "round", "annotation": ""}, "snippet": " elapsed_millis = round(elapsed_millis)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L323_C4", "label": "if", "type": "if", "loc": [323, 327], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L320_C0", "vector": [4, 1, 0.9233, 0.0142, 1, 0.13, 0.2857, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if elapsed_millis < 0:\n pre = '-'\n elapsed_millis = abs(elapsed_millis)\n else:\n pre = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L324_C8", "label": "pre =", "type": "assigned_variable", "loc": [324, 324], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L323_C4", "vector": [14, 2, 0.9205, 0.0028, 2, 0.59, 0.0, 793, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "pre", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pre = '-'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L325_C8", "label": "elapsed_millis = abs()", "type": "assigned_variable", "loc": [325, 325], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L323_C4", "vector": [14, 2, 0.9233, 0.0028, 2, 0.59, 0.5, 693, 3, 1, 0, 0, 799, 10, 1], "semantic": {"name": "elapsed_millis", "arg_names": [], "import_names": [], "rhs_call_name": "abs", "annotation": ""}, "snippet": " elapsed_millis = abs(elapsed_millis)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L327_C8", "label": "pre =", "type": "assigned_variable", "loc": [327, 327], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L323_C4", "vector": [14, 2, 0.929, 0.0028, 2, 0.59, 1.0, 793, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "pre", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pre = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L328_C4", "label": "millis =", "type": "assigned_variable", "loc": [328, 328], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L320_C0", "vector": [14, 1, 0.9318, 0.0028, 1, 0.13, 0.4286, 889, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "millis", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " millis = elapsed_millis % 1000"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L329_C4", "label": "secs =", "type": "assigned_variable", "loc": [329, 329], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L320_C0", "vector": [14, 1, 0.9347, 0.0028, 1, 0.13, 0.5714, 584, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "secs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " secs = int(elapsed_millis / 1000) % 60"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L330_C4", "label": "mins =", "type": "assigned_variable", "loc": [330, 330], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L320_C0", "vector": [14, 1, 0.9375, 0.0028, 1, 0.13, 0.7143, 606, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "mins", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mins = int(elapsed_millis / 60000) % 60"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L331_C4", "label": "hours = int()", "type": "assigned_variable", "loc": [331, 331], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L320_C0", "vector": [14, 1, 0.9403, 0.0028, 1, 0.13, 0.8571, 855, 3, 1, 0, 0, 901, 10, 1], "semantic": {"name": "hours", "arg_names": [], "import_names": [], "rhs_call_name": "int", "annotation": ""}, "snippet": " hours = int(elapsed_millis / 3600000)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Return_L332_C4", "label": "return", "type": "return", "loc": [332, 332], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L320_C0", "vector": [13, 1, 0.9432, 0.0028, 1, 0.13, 1.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return '%s%02d:%02d:%02d.%03d' % (pre, hours, mins, secs, millis)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L335_C0", "label": "_timestamp_to_millis", "type": "function", "loc": [335, 338], "level": 0, "parent": null, "vector": [2, 0, 0.956, 0.0114, 0, 0.66, 0.9565, 348, 0, 2, 1, 0, 0, 0, 4], "semantic": {"name": "_timestamp_to_millis", "arg_names": ["timestamp", "seps"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def _timestamp_to_millis(timestamp, seps):\n Y, M, D, h, m, s, millis = _split_timestamp(timestamp, seps)\n secs = time.mktime((Y, M, D, h, m, s, 0, 0, time.daylight))\n return int(round(1000*secs + millis))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L336_C4", "label": "Y, M, D, h, m, s, millis = _split_timestamp()", "type": "assigned_variable", "loc": [336, 336], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L335_C0", "vector": [14, 1, 0.9545, 0.0028, 1, 0.16, 0.0, 481, 3, 2, 0, 0, 110, 10, 1], "semantic": {"name": "Y, M, D, h, m, s, millis", "arg_names": [], "import_names": [], "rhs_call_name": "_split_timestamp", "annotation": ""}, "snippet": " Y, M, D, h, m, s, millis = _split_timestamp(timestamp, seps)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L337_C4", "label": "secs = mktime()", "type": "assigned_variable", "loc": [337, 337], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L335_C0", "vector": [14, 1, 0.9574, 0.0028, 1, 0.16, 0.5, 584, 3, 1, 0, 0, 349, 10, 1], "semantic": {"name": "secs", "arg_names": [], "import_names": [], "rhs_call_name": "mktime", "annotation": ""}, "snippet": " secs = time.mktime((Y, M, D, h, m, s, 0, 0, time.daylight))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Return_L338_C4", "label": "return", "type": "return", "loc": [338, 338], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L335_C0", "vector": [13, 1, 0.9602, 0.0028, 1, 0.16, 1.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return int(round(1000*secs + millis))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L340_C0", "label": "_split_timestamp", "type": "function", "loc": [340, 352], "level": 0, "parent": null, "vector": [2, 0, 0.983, 0.0369, 0, 0.66, 1.0, 110, 0, 2, 1, 0, 0, 0, 9], "semantic": {"name": "_split_timestamp", "arg_names": ["timestamp", "seps"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def _split_timestamp(timestamp, seps):\n for sep in seps:\n if sep:\n timestamp = timestamp.replace(sep, '')\n timestamp = timestamp.ljust(17, '0')\n years = int(timestamp[:4])\n mons = int(timestamp[4:6])\n days = int(timestamp[6:8])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:For_L341_C4", "label": "for sep", "type": "for", "loc": [341, 343], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L340_C0", "vector": [6, 1, 0.9716, 0.0085, 1, 0.74, 0.0, 820, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "sep", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for sep in seps:\n if sep:\n timestamp = timestamp.replace(sep, '')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L342_C8", "label": "if", "type": "if", "loc": [342, 343], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:For_L341_C4", "vector": [4, 2, 0.973, 0.0057, 2, 0.77, 0.0, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if sep:\n timestamp = timestamp.replace(sep, '')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L343_C12", "label": "timestamp = replace()", "type": "assigned_variable", "loc": [343, 343], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L342_C8", "vector": [14, 3, 0.9744, 0.0028, 3, 0.87, 0.0, 834, 3, 2, 0, 0, 293, 10, 1], "semantic": {"name": "timestamp", "arg_names": [], "import_names": [], "rhs_call_name": "replace", "annotation": ""}, "snippet": " timestamp = timestamp.replace(sep, '')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L344_C4", "label": "timestamp = ljust()", "type": "assigned_variable", "loc": [344, 344], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L340_C0", "vector": [14, 1, 0.9773, 0.0028, 1, 0.74, 0.1111, 834, 3, 2, 0, 0, 629, 10, 1], "semantic": {"name": "timestamp", "arg_names": [], "import_names": [], "rhs_call_name": "ljust", "annotation": ""}, "snippet": " timestamp = timestamp.ljust(17, '0')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L345_C4", "label": "years = int()", "type": "assigned_variable", "loc": [345, 345], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L340_C0", "vector": [14, 1, 0.9801, 0.0028, 1, 0.74, 0.2222, 301, 3, 1, 0, 0, 901, 10, 1], "semantic": {"name": "years", "arg_names": [], "import_names": [], "rhs_call_name": "int", "annotation": ""}, "snippet": " years = int(timestamp[:4])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L346_C4", "label": "mons = int()", "type": "assigned_variable", "loc": [346, 346], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L340_C0", "vector": [14, 1, 0.983, 0.0028, 1, 0.74, 0.3333, 591, 3, 1, 0, 0, 901, 10, 1], "semantic": {"name": "mons", "arg_names": [], "import_names": [], "rhs_call_name": "int", "annotation": ""}, "snippet": " mons = int(timestamp[4:6])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L347_C4", "label": "days = int()", "type": "assigned_variable", "loc": [347, 347], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L340_C0", "vector": [14, 1, 0.9858, 0.0028, 1, 0.74, 0.4444, 939, 3, 1, 0, 0, 901, 10, 1], "semantic": {"name": "days", "arg_names": [], "import_names": [], "rhs_call_name": "int", "annotation": ""}, "snippet": " days = int(timestamp[6:8])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L348_C4", "label": "hours = int()", "type": "assigned_variable", "loc": [348, 348], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L340_C0", "vector": [14, 1, 0.9886, 0.0028, 1, 0.74, 0.5556, 855, 3, 1, 0, 0, 901, 10, 1], "semantic": {"name": "hours", "arg_names": [], "import_names": [], "rhs_call_name": "int", "annotation": ""}, "snippet": " hours = int(timestamp[8:10])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L349_C4", "label": "mins = int()", "type": "assigned_variable", "loc": [349, 349], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L340_C0", "vector": [14, 1, 0.9915, 0.0028, 1, 0.74, 0.6667, 606, 3, 1, 0, 0, 901, 10, 1], "semantic": {"name": "mins", "arg_names": [], "import_names": [], "rhs_call_name": "int", "annotation": ""}, "snippet": " mins = int(timestamp[10:12])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L350_C4", "label": "secs = int()", "type": "assigned_variable", "loc": [350, 350], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L340_C0", "vector": [14, 1, 0.9943, 0.0028, 1, 0.74, 0.7778, 584, 3, 1, 0, 0, 901, 10, 1], "semantic": {"name": "secs", "arg_names": [], "import_names": [], "rhs_call_name": "int", "annotation": ""}, "snippet": " secs = int(timestamp[12:14])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L351_C4", "label": "millis = int()", "type": "assigned_variable", "loc": [351, 351], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L340_C0", "vector": [14, 1, 0.9972, 0.0028, 1, 0.74, 0.8889, 889, 3, 1, 0, 0, 901, 10, 1], "semantic": {"name": "millis", "arg_names": [], "import_names": [], "rhs_call_name": "int", "annotation": ""}, "snippet": " millis = int(timestamp[14:17])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99846:Return_L352_C4", "label": "return", "type": "return", "loc": [352, 352], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L340_C0", "vector": [13, 1, 1.0, 0.0028, 1, 0.74, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return years, mons, days, hours, mins, secs, millis"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L22_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Return_L23_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L24_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L25_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L26_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L27_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Return_L28_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L31_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L32_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Return_L33_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L40_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Expr_L41_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L40_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Try_L54_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:Try_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L55_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L40_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Return_L58_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L60_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L61_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L60_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L62_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L60_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Try_L64_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:Try_L64_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Return_L65_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L60_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L68_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L60_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L69_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L69_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L70_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L69_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L71_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L69_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L73_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L60_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L74_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L60_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:For_L75_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:For_L75_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L76_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L76_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L76_C23"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L76_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L76_C54"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L76_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L77_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L77_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L77_C23"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L77_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L77_C54"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L77_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L78_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L78_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L78_C23"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L78_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L78_C54"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L78_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L79_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L79_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L79_C23"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L79_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L79_C54"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L79_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L80_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L80_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L80_C23"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L80_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L80_C54"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L80_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Expr_L81_C14"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L60_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L82_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L60_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Return_L84_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L86_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L87_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L87_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Return_L88_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L86_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L89_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L86_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:For_L90_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:For_L90_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L91_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L86_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:For_L92_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:For_L92_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L93_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L86_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:For_L94_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:For_L94_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L95_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L86_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:For_L96_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:For_L96_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L97_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L86_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:For_L98_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:For_L98_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L99_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L86_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Return_L102_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L105_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Expr_L106_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L105_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Return_L118_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:ClassDef_L120_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L122_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L122_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L123_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L122_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L124_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L122_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L125_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L122_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Expr_L127_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L122_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Expr_L128_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L122_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Expr_L129_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L122_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Expr_L130_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L122_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Expr_L131_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:ClassDef_L120_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L133_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L133_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L134_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L134_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Return_L135_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L133_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Return_L136_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:ClassDef_L120_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L138_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L138_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L139_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L139_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Return_L140_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L138_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L141_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L141_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L142_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L141_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L144_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L138_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Expr_L145_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:ClassDef_L120_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L147_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L147_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L148_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L148_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L149_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L148_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L150_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L148_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L152_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L147_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L153_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L147_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L154_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L147_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L155_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L147_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L156_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L147_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L157_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L147_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Return_L158_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L161_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Expr_L163_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L161_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L174_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L174_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L175_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L174_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L177_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L161_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L178_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L161_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L179_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L161_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L180_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L161_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L181_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L161_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Return_L182_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L184_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L185_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L185_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Return_L186_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L184_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L187_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L187_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L188_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L187_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L189_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L189_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L190_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L189_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L192_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L184_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L193_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L184_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L194_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L184_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Return_L195_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L198_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Expr_L199_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L198_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L215_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L215_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L216_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L198_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L217_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L198_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L219_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L219_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Return_L220_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L198_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L221_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L198_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L222_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L198_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:For_L223_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:For_L223_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L224_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L224_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Expr_L225_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L198_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L227_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L227_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Return_L228_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L227_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L230_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L230_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Return_L231_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L230_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Return_L233_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L236_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Expr_L237_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L236_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Try_L249_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:Try_L249_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L250_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:Try_L249_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L254_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:Try_L249_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Return_L256_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L236_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Try_L257_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:Try_L257_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Return_L258_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L236_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L261_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L236_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L262_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L236_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L263_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L263_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Return_L264_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L236_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L265_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L265_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L266_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L266_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Return_L267_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L265_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L268_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L268_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Return_L269_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L273_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Return_L274_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L277_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Try_L278_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:Try_L278_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L279_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L277_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L282_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L282_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Return_L283_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L277_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Return_L284_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L287_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L288_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L288_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L289_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L287_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L290_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L287_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L291_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L291_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L292_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L291_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L293_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L287_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Return_L294_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L297_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Return_L298_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L301_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Expr_L302_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L301_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L310_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L310_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Return_L311_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L301_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L312_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L312_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L313_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L301_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L314_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L301_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L315_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L301_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Return_L317_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L320_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Expr_L321_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L320_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L322_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L320_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L323_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L323_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L324_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L323_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L325_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L323_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L327_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L320_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L328_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L320_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L329_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L320_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L330_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L320_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L331_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L320_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Return_L332_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L335_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L336_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L335_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L337_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L335_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Return_L338_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L340_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:For_L341_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:For_L341_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L342_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:If_L342_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L343_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L340_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L344_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L340_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L345_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L340_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L346_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L340_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L347_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L340_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L348_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L340_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L349_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L340_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L350_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L340_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Assign_L351_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99846:FunctionDef_L340_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99846:Return_L352_C4"}] |
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import os.path
from robot.variables import Variables
from robot.errors import DataError, FrameworkError
from robot import utils
PRE = '<!-- '
POST = ' -->'
class Namespace(Variables):
def __init__(self, **kwargs):
Variables.__init__(self, ['$'])
for key, value in kwargs.items():
self['${%s}' % key] = value
class Template:
def __init__(self, path=None, template=None, functions=None):
if path is None and template is None:
raise FrameworkError("Either 'path' or 'template' must be given")
if template is None:
tfile = open(path)
template = tfile.read()
tfile.close()
self.parent_dir = os.path.dirname(utils.abspath(path))
else:
self.parent_dir = None
self._template = template
self._functions = functions or utils.NormalizedDict()
# True means handlers for more than single line
self._handlers = { 'INCLUDE': (self._handle_include, False),
'IMPORT': (self._handle_import, False),
'CALL': (self._handle_call, False),
'IF': (self._handle_if, True),
'FOR': (self._handle_for, True),
'FUNCTION': (self._handle_function, True) }
def generate(self, namespace, output=None):
self._namespace = namespace
return self._process(self._template, output)
def _process(self, template, output=None):
result = Result(output)
lines = template.splitlines()
while lines:
line = lines.pop(0)
try:
result.add(self._process_line(line.strip(), lines))
except ValueError:
result.add(self._handle_variables(line))
return result.get_result()
def _process_line(self, line, lines):
if not line.startswith(PRE) and line.endswith(POST):
raise ValueError
name, expression = line[len(PRE):-len(POST)].split(' ', 1)
try:
handler, multiline = self._handlers[name]
except KeyError:
raise ValueError
if multiline:
block_lines = self._get_multi_line_block(name, lines)
return handler(expression, block_lines)
return handler(expression)
def _get_multi_line_block(self, name, lines):
"""Returns string containing lines before END matching given name.
Removes the returned lines from given 'lines'.
"""
block_lines = []
endline = '%sEND %s%s' % (PRE, name, POST)
while True:
try:
line = lines.pop(0)
except IndexError:
raise DataError('Invalid template: No END for %s' % name)
if line.strip() == endline:
break
block_lines.append(line)
return block_lines
def _handle_variables(self, template):
return self._namespace.replace_string(template)
def _handle_include(self, path):
included_file = open(self._get_full_path(path))
include = included_file.read()
included_file.close()
return self._handle_variables(include)
def _handle_import(self, path):
imported_file = open(self._get_full_path(path))
self._process(imported_file.read())
imported_file.close()
return None
def _handle_for(self, expression, block_lines):
block = '\n'.join(block_lines)
result = []
var_name, _, value_list = expression.split(' ', 2)
namespace = self._namespace.copy()
for value in namespace.replace_scalar(value_list):
namespace[var_name] = value
temp = Template(template=block, functions=self._functions)
ret = temp.generate(namespace)
if ret:
result.append(ret)
if not result:
return None
return '\n'.join(result)
def _handle_if(self, expression, block_lines):
expression = self._handle_variables(expression)
if_block, else_block = self._get_if_and_else_blocks(block_lines)
result = eval(expression) and if_block or else_block
if not result:
return None
return self._process('\n'.join(result))
def _get_if_and_else_blocks(self, block_lines):
else_line = PRE + 'ELSE' + POST
if_block = []
else_block = []
block = if_block
for line in block_lines:
if line.strip() == else_line:
block = else_block
else:
block.append(line)
return if_block, else_block
def _handle_call(self, expression):
func_tokens = expression.split()
name = func_tokens[0]
args = func_tokens[1:]
namespace = self._namespace.copy()
try:
func_args, func_body = self._functions[name]
except KeyError:
raise DataError("Non-existing function '%s', available: %s"
% (name, self._functions.keys()))
for key, value in zip(func_args, args):
namespace[key] = namespace.replace_string(value)
temp = Template(template=func_body, functions=self._functions)
return temp.generate(namespace)
def _handle_function(self, signature, block_lines):
signature_tokens = signature.split()
name = signature_tokens[0]
args = signature_tokens[1:]
self._functions[name] = (args, '\n'.join(block_lines))
def _get_full_path(self, path):
if self.parent_dir is None:
raise FrameworkError('Parent directory is None. Probably template '
'was string and other files was referred. '
'That is not supported.')
abs_path = os.path.join(self.parent_dir, path)
if os.path.exists(abs_path):
return abs_path
else:
raise DataError("File '%s' does not exist." % abs_path)
class Result:
def __init__(self, output=None):
self._output = output
self._result = []
def add(self, text):
if text is not None:
if self._output is None:
self._result.append(text)
else:
self._output.write(text.encode('UTF-8') + '\n')
def get_result(self):
if not self._result:
return None
return '\n'.join(self._result)
| ajibawa-2023/Python-Code-Large/train/row_99847 | 131 | 201 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99847:Import_L16_C0", "label": "os.path import os.path", "type": "import", "loc": [16, 16], "level": 0, "parent": null, "vector": [1, 0, 0.0796, 0.005, 0, 0.66, 0.0, 79, 0, 1, 0, 0, 79, 0, 0], "semantic": {"name": "os.path", "arg_names": [], "import_names": ["os.path"], "rhs_call_name": "", "annotation": ""}, "snippet": "import os.path"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99847:ImportFrom_L18_C0", "label": "from robot.variables import Variables", "type": "import", "loc": [18, 18], "level": 0, "parent": null, "vector": [1, 0, 0.0896, 0.005, 0, 0.66, 0.125, 595, 0, 1, 0, 0, 595, 0, 0], "semantic": {"name": "robot.variables", "arg_names": [], "import_names": ["Variables"], "rhs_call_name": "", "annotation": ""}, "snippet": "from robot.variables import Variables"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99847:ImportFrom_L19_C0", "label": "from robot.errors import DataError, FrameworkError", "type": "import", "loc": [19, 19], "level": 0, "parent": null, "vector": [1, 0, 0.0945, 0.005, 0, 0.66, 0.25, 299, 0, 2, 0, 0, 299, 0, 0], "semantic": {"name": "robot.errors", "arg_names": [], "import_names": ["DataError", "FrameworkError"], "rhs_call_name": "", "annotation": ""}, "snippet": "from robot.errors import DataError, FrameworkError"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99847:ImportFrom_L20_C0", "label": "from robot import utils", "type": "import", "loc": [20, 20], "level": 0, "parent": null, "vector": [1, 0, 0.0995, 0.005, 0, 0.66, 0.375, 735, 0, 1, 0, 0, 735, 0, 0], "semantic": {"name": "robot", "arg_names": [], "import_names": ["utils"], "rhs_call_name": "", "annotation": ""}, "snippet": "from robot import utils"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99847:Assign_L23_C0", "label": "PRE =", "type": "assigned_variable", "loc": [23, 23], "level": 0, "parent": null, "vector": [14, 0, 0.1144, 0.005, 0, 0.66, 0.5, 623, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "PRE", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "PRE = '<!-- '"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99847:Assign_L24_C0", "label": "POST =", "type": "assigned_variable", "loc": [24, 24], "level": 0, "parent": null, "vector": [14, 0, 0.1194, 0.005, 0, 0.66, 0.625, 41, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "POST", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "POST = ' -->'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99847:ClassDef_L27_C0", "label": "Namespace", "type": "class", "loc": [27, 32], "level": 0, "parent": null, "vector": [3, 0, 0.1468, 0.0299, 0, 0.66, 0.75, 283, 0, 1, 0, 0, 821, 0, 2], "semantic": {"name": "Namespace", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Namespace(Variables):\n\n def __init__(self, **kwargs):\n Variables.__init__(self, ['$'])\n for key, value in kwargs.items():\n self['${%s}' % key] = value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L29_C4", "label": "__init__", "type": "function", "loc": [29, 32], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99847:ClassDef_L27_C0", "vector": [2, 1, 0.1517, 0.0199, 1, 0.47, 0.0, 555, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": ["self", "kwargs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, **kwargs):\n Variables.__init__(self, ['$'])\n for key, value in kwargs.items():\n self['${%s}' % key] = value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99847:Expr_L30_C8", "label": "__init__()", "type": "expression", "loc": [30, 30], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L29_C4", "vector": [8, 2, 0.1493, 0.005, 2, 0.57, 0.0, 555, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " Variables.__init__(self, ['$'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99847:For_L31_C8", "label": "for key, value", "type": "for", "loc": [31, 32], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L29_C4", "vector": [6, 2, 0.1567, 0.01, 2, 0.57, 1.0, 839, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "key, value", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for key, value in kwargs.items():\n self['${%s}' % key] = value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99847:Assign_L32_C12", "label": "assign", "type": "assigned_variable", "loc": [32, 32], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99847:For_L31_C8", "vector": [14, 3, 0.1592, 0.005, 3, 0.02, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self['${%s}' % key] = value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99847:ClassDef_L35_C0", "label": "Template", "type": "class", "loc": [35, 182], "level": 0, "parent": null, "vector": [3, 0, 0.5398, 0.7363, 0, 0.66, 0.875, 137, 0, 14, 0, 0, 0, 0, 69], "semantic": {"name": "Template", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Template:\n\n def __init__(self, path=None, template=None, functions=None):\n if path is None and template is None:\n raise FrameworkError(\"Either 'path' or 'template' must be given\")\n if template is None:\n tfile = open(path)\n template = tfile.read()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L37_C4", "label": "__init__", "type": "function", "loc": [37, 55], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99847:ClassDef_L35_C0", "vector": [2, 1, 0.2289, 0.0945, 1, 0.54, 0.0, 555, 0, 4, 0, 0, 0, 0, 7], "semantic": {"name": "__init__", "arg_names": ["self", "path", "template", "functions"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, path=None, template=None, functions=None):\n if path is None and template is None:\n raise FrameworkError(\"Either 'path' or 'template' must be given\")\n if template is None:\n tfile = open(path)\n template = tfile.read()\n tfile.close()\n self.parent_dir = os.path.dirname(utils.abspath(path))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99847:If_L38_C8", "label": "if", "type": "if", "loc": [38, 39], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L37_C4", "vector": [4, 2, 0.1915, 0.01, 2, 0.93, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if path is None and template is None:\n raise FrameworkError(\"Either 'path' or 'template' must be given\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99847:If_L40_C8", "label": "if", "type": "if", "loc": [40, 46], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L37_C4", "vector": [4, 2, 0.2139, 0.0348, 2, 0.93, 0.25, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if template is None:\n tfile = open(path)\n template = tfile.read()\n tfile.close()\n self.parent_dir = os.path.dirname(utils.abspath(path))\n else:\n self.parent_dir = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99847:Assign_L41_C12", "label": "tfile = open()", "type": "assigned_variable", "loc": [41, 41], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99847:If_L40_C8", "vector": [14, 3, 0.204, 0.005, 3, 0.45, 0.0, 647, 3, 1, 0, 0, 693, 10, 1], "semantic": {"name": "tfile", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": " tfile = open(path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99847:Assign_L42_C12", "label": "template = read()", "type": "assigned_variable", "loc": [42, 42], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99847:If_L40_C8", "vector": [14, 3, 0.209, 0.005, 3, 0.45, 0.25, 549, 3, 0, 0, 0, 453, 10, 1], "semantic": {"name": "template", "arg_names": [], "import_names": [], "rhs_call_name": "read", "annotation": ""}, "snippet": " template = tfile.read()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99847:Expr_L43_C12", "label": "close()", "type": "expression", "loc": [43, 43], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99847:If_L40_C8", "vector": [8, 3, 0.2139, 0.005, 3, 0.45, 0.5, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": " tfile.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99847:Assign_L44_C12", "label": "self.parent_dir = dirname()", "type": "assigned_variable", "loc": [44, 44], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99847:If_L40_C8", "vector": [14, 3, 0.2189, 0.005, 3, 0.45, 0.75, 665, 3, 1, 0, 0, 959, 10, 2], "semantic": {"name": "self.parent_dir", "arg_names": [], "import_names": [], "rhs_call_name": "dirname", "annotation": ""}, "snippet": " self.parent_dir = os.path.dirname(utils.abspath(path))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99847:Assign_L46_C12", "label": "self.parent_dir =", "type": "assigned_variable", "loc": [46, 46], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99847:If_L40_C8", "vector": [14, 3, 0.2289, 0.005, 3, 0.45, 1.0, 665, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.parent_dir", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.parent_dir = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99847:Assign_L47_C8", "label": "self._template =", "type": "assigned_variable", "loc": [47, 47], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L37_C4", "vector": [14, 2, 0.2338, 0.005, 2, 0.93, 0.5, 461, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._template", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._template = template"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99847:Assign_L48_C8", "label": "self._functions =", "type": "assigned_variable", "loc": [48, 48], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L37_C4", "vector": [14, 2, 0.2388, 0.005, 2, 0.93, 0.75, 507, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self._functions", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._functions = functions or utils.NormalizedDict()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99847:Assign_L50_C8", "label": "self._handlers =", "type": "assigned_variable", "loc": [50, 55], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L37_C4", "vector": [14, 2, 0.2612, 0.0299, 2, 0.93, 1.0, 893, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "self._handlers", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._handlers = { 'INCLUDE': (self._handle_include, False),\n 'IMPORT': (self._handle_import, False),\n 'CALL': (self._handle_call, False),\n 'IF': (self._handle_if, True),\n 'FOR': (self._handle_for, True),\n 'FUNCTION': (self._handle_function, True) }"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L57_C4", "label": "generate", "type": "function", "loc": [57, 59], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99847:ClassDef_L35_C0", "vector": [2, 1, 0.2886, 0.0149, 1, 0.54, 0.0769, 410, 0, 3, 1, 0, 0, 0, 1], "semantic": {"name": "generate", "arg_names": ["self", "namespace", "output"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def generate(self, namespace, output=None):\n self._namespace = namespace\n return self._process(self._template, output)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99847:Assign_L58_C8", "label": "self._namespace =", "type": "assigned_variable", "loc": [58, 58], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L57_C4", "vector": [14, 2, 0.2886, 0.005, 2, 0.8, 0.0, 308, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._namespace", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._namespace = namespace"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99847:Return_L59_C8", "label": "return", "type": "return", "loc": [59, 59], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L57_C4", "vector": [13, 2, 0.2935, 0.005, 2, 0.8, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._process(self._template, output)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L61_C4", "label": "_process", "type": "function", "loc": [61, 70], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99847:ClassDef_L35_C0", "vector": [2, 1, 0.3259, 0.0498, 1, 0.54, 0.1538, 99, 0, 3, 1, 0, 0, 0, 9], "semantic": {"name": "_process", "arg_names": ["self", "template", "output"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _process(self, template, output=None):\n result = Result(output)\n lines = template.splitlines()\n while lines:\n line = lines.pop(0)\n try:\n result.add(self._process_line(line.strip(), lines))\n except ValueError:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99847:Assign_L62_C8", "label": "result = Result()", "type": "assigned_variable", "loc": [62, 62], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L61_C4", "vector": [14, 2, 0.3085, 0.005, 2, 0.34, 0.0, 51, 3, 1, 0, 0, 611, 10, 1], "semantic": {"name": "result", "arg_names": [], "import_names": [], "rhs_call_name": "Result", "annotation": ""}, "snippet": " result = Result(output)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99847:Assign_L63_C8", "label": "lines = splitlines()", "type": "assigned_variable", "loc": [63, 63], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L61_C4", "vector": [14, 2, 0.3134, 0.005, 2, 0.34, 0.3333, 73, 3, 0, 0, 0, 296, 10, 1], "semantic": {"name": "lines", "arg_names": [], "import_names": [], "rhs_call_name": "splitlines", "annotation": ""}, "snippet": " lines = template.splitlines()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99847:While_L64_C8", "label": "while", "type": "while", "loc": [64, 69], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L61_C4", "vector": [5, 2, 0.3308, 0.0299, 2, 0.34, 0.6667, 0, 2, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while lines:\n line = lines.pop(0)\n try:\n result.add(self._process_line(line.strip(), lines))\n except ValueError:\n result.add(self._handle_variables(line))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99847:Assign_L65_C12", "label": "line = pop()", "type": "assigned_variable", "loc": [65, 65], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99847:While_L64_C8", "vector": [14, 3, 0.3234, 0.005, 3, 0.31, 0.0, 373, 3, 1, 0, 0, 969, 10, 1], "semantic": {"name": "line", "arg_names": [], "import_names": [], "rhs_call_name": "pop", "annotation": ""}, "snippet": " line = lines.pop(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99847:Try_L66_C12", "label": "try", "type": "try", "loc": [66, 69], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99847:While_L64_C8", "vector": [7, 3, 0.3358, 0.0199, 3, 0.31, 1.0, 0, 0, 1, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n result.add(self._process_line(line.strip(), lines))\n except ValueError:\n result.add(self._handle_variables(line))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99847:Expr_L67_C16", "label": "add()", "type": "expression", "loc": [67, 67], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99847:Try_L66_C12", "vector": [8, 4, 0.3333, 0.005, 4, 0.66, 0.0, 241, 3, 1, 0, 0, 0, 0, 3], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " result.add(self._process_line(line.strip(), lines))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99847:Expr_L69_C16", "label": "add()", "type": "expression", "loc": [69, 69], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99847:Try_L66_C12", "vector": [8, 4, 0.3433, 0.005, 4, 0.66, 0.0, 241, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " result.add(self._handle_variables(line))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99847:Return_L70_C8", "label": "return", "type": "return", "loc": [70, 70], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L61_C4", "vector": [13, 2, 0.3483, 0.005, 2, 0.34, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return result.get_result()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L72_C4", "label": "_process_line", "type": "function", "loc": [72, 83], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99847:ClassDef_L35_C0", "vector": [2, 1, 0.3856, 0.0597, 1, 0.54, 0.2308, 144, 0, 3, 1, 0, 0, 0, 8], "semantic": {"name": "_process_line", "arg_names": ["self", "line", "lines"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _process_line(self, line, lines):\n if not line.startswith(PRE) and line.endswith(POST):\n raise ValueError\n name, expression = line[len(PRE):-len(POST)].split(' ', 1)\n try:\n handler, multiline = self._handlers[name]\n except KeyError:\n raise ValueError"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99847:If_L73_C8", "label": "if", "type": "if", "loc": [73, 74], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L72_C4", "vector": [4, 2, 0.3657, 0.01, 2, 0.24, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not line.startswith(PRE) and line.endswith(POST):\n raise ValueError"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99847:Assign_L75_C8", "label": "name, expression = split()", "type": "assigned_variable", "loc": [75, 75], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L72_C4", "vector": [14, 2, 0.3731, 0.005, 2, 0.24, 0.25, 25, 3, 2, 0, 0, 908, 10, 3], "semantic": {"name": "name, expression", "arg_names": [], "import_names": [], "rhs_call_name": "split", "annotation": ""}, "snippet": " name, expression = line[len(PRE):-len(POST)].split(' ', 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99847:Try_L76_C8", "label": "try", "type": "try", "loc": [76, 79], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L72_C4", "vector": [7, 2, 0.3856, 0.0199, 2, 0.24, 0.5, 0, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n handler, multiline = self._handlers[name]\n except KeyError:\n raise ValueError"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99847:Assign_L77_C12", "label": "handler, multiline =", "type": "assigned_variable", "loc": [77, 77], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99847:Try_L76_C8", "vector": [14, 3, 0.3831, 0.005, 3, 0.86, 0.0, 569, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "handler, multiline", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " handler, multiline = self._handlers[name]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99847:If_L80_C8", "label": "if", "type": "if", "loc": [80, 82], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L72_C4", "vector": [4, 2, 0.403, 0.0149, 2, 0.24, 0.75, 0, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if multiline:\n block_lines = self._get_multi_line_block(name, lines)\n return handler(expression, block_lines)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99847:Assign_L81_C12", "label": "block_lines = _get_multi_line_block()", "type": "assigned_variable", "loc": [81, 81], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99847:If_L80_C8", "vector": [14, 3, 0.403, 0.005, 3, 0.1, 0.0, 954, 3, 2, 0, 0, 927, 10, 1], "semantic": {"name": "block_lines", "arg_names": [], "import_names": [], "rhs_call_name": "_get_multi_line_block", "annotation": ""}, "snippet": " block_lines = self._get_multi_line_block(name, lines)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99847:Return_L82_C12", "label": "return", "type": "return", "loc": [82, 82], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99847:If_L80_C8", "vector": [13, 3, 0.408, 0.005, 3, 0.1, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return handler(expression, block_lines)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99847:Return_L83_C8", "label": "return", "type": "return", "loc": [83, 83], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L72_C4", "vector": [13, 2, 0.4129, 0.005, 2, 0.24, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return handler(expression)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L85_C4", "label": "_get_multi_line_block", "type": "function", "loc": [85, 100], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99847:ClassDef_L35_C0", "vector": [2, 1, 0.4602, 0.0796, 1, 0.54, 0.3077, 927, 0, 3, 1, 0, 0, 0, 4], "semantic": {"name": "_get_multi_line_block", "arg_names": ["self", "name", "lines"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _get_multi_line_block(self, name, lines):\n \"\"\"Returns string containing lines before END matching given name.\n\n Removes the returned lines from given 'lines'.\n \"\"\"\n block_lines = []\n endline = '%sEND %s%s' % (PRE, name, POST)\n while True:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99847:Expr_L86_C8", "label": "expression", "type": "expression", "loc": [86, 89], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L85_C4", "vector": [8, 2, 0.4353, 0.0199, 2, 0.8, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Returns string containing lines before END matching given name.\n\n Removes the returned lines from given 'lines'.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99847:Assign_L90_C8", "label": "block_lines =", "type": "assigned_variable", "loc": [90, 90], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L85_C4", "vector": [14, 2, 0.4478, 0.005, 2, 0.8, 0.25, 954, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "block_lines", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " block_lines = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99847:Assign_L91_C8", "label": "endline =", "type": "assigned_variable", "loc": [91, 91], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L85_C4", "vector": [14, 2, 0.4527, 0.005, 2, 0.8, 0.5, 264, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "endline", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " endline = '%sEND %s%s' % (PRE, name, POST)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99847:While_L92_C8", "label": "while", "type": "while", "loc": [92, 99], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L85_C4", "vector": [5, 2, 0.4751, 0.0398, 2, 0.8, 0.75, 0, 1, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while True:\n try:\n line = lines.pop(0)\n except IndexError:\n raise DataError('Invalid template: No END for %s' % name)\n if line.strip() == endline:\n break\n block_lines.append(line)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99847:Try_L93_C12", "label": "try", "type": "try", "loc": [93, 96], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99847:While_L92_C8", "vector": [7, 3, 0.4701, 0.0199, 3, 0.64, 0.0, 0, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n line = lines.pop(0)\n except IndexError:\n raise DataError('Invalid template: No END for %s' % name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99847:Assign_L94_C16", "label": "line = pop()", "type": "assigned_variable", "loc": [94, 94], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99847:Try_L93_C12", "vector": [14, 4, 0.4677, 0.005, 4, 0.61, 0.0, 373, 3, 1, 0, 0, 969, 10, 1], "semantic": {"name": "line", "arg_names": [], "import_names": [], "rhs_call_name": "pop", "annotation": ""}, "snippet": " line = lines.pop(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99847:If_L97_C12", "label": "if", "type": "if", "loc": [97, 98], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99847:While_L92_C8", "vector": [4, 3, 0.4851, 0.01, 3, 0.64, 0.5, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if line.strip() == endline:\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99847:Expr_L99_C12", "label": "append()", "type": "expression", "loc": [99, 99], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99847:While_L92_C8", "vector": [8, 3, 0.4925, 0.005, 3, 0.64, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " block_lines.append(line)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99847:Return_L100_C8", "label": "return", "type": "return", "loc": [100, 100], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L85_C4", "vector": [13, 2, 0.4975, 0.005, 2, 0.8, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return block_lines"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L102_C4", "label": "_handle_variables", "type": "function", "loc": [102, 103], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99847:ClassDef_L35_C0", "vector": [2, 1, 0.51, 0.01, 1, 0.54, 0.3846, 105, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "_handle_variables", "arg_names": ["self", "template"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _handle_variables(self, template):\n return self._namespace.replace_string(template)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99847:Return_L103_C8", "label": "return", "type": "return", "loc": [103, 103], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L102_C4", "vector": [13, 2, 0.5124, 0.005, 2, 0.82, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._namespace.replace_string(template)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L105_C4", "label": "_handle_include", "type": "function", "loc": [105, 109], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99847:ClassDef_L35_C0", "vector": [2, 1, 0.5323, 0.0249, 1, 0.54, 0.4615, 756, 0, 2, 1, 0, 0, 0, 5], "semantic": {"name": "_handle_include", "arg_names": ["self", "path"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _handle_include(self, path):\n included_file = open(self._get_full_path(path))\n include = included_file.read()\n included_file.close()\n return self._handle_variables(include)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99847:Assign_L106_C8", "label": "included_file = open()", "type": "assigned_variable", "loc": [106, 106], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L105_C4", "vector": [14, 2, 0.5274, 0.005, 2, 0.99, 0.0, 994, 3, 1, 0, 0, 693, 10, 2], "semantic": {"name": "included_file", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": " included_file = open(self._get_full_path(path))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99847:Assign_L107_C8", "label": "include = read()", "type": "assigned_variable", "loc": [107, 107], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L105_C4", "vector": [14, 2, 0.5323, 0.005, 2, 0.99, 0.3333, 142, 3, 0, 0, 0, 453, 10, 1], "semantic": {"name": "include", "arg_names": [], "import_names": [], "rhs_call_name": "read", "annotation": ""}, "snippet": " include = included_file.read()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99847:Expr_L108_C8", "label": "close()", "type": "expression", "loc": [108, 108], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L105_C4", "vector": [8, 2, 0.5373, 0.005, 2, 0.99, 0.6667, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": " included_file.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99847:Return_L109_C8", "label": "return", "type": "return", "loc": [109, 109], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L105_C4", "vector": [13, 2, 0.5423, 0.005, 2, 0.99, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._handle_variables(include)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L111_C4", "label": "_handle_import", "type": "function", "loc": [111, 115], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99847:ClassDef_L35_C0", "vector": [2, 1, 0.5622, 0.0249, 1, 0.54, 0.5385, 882, 0, 2, 1, 0, 0, 0, 5], "semantic": {"name": "_handle_import", "arg_names": ["self", "path"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _handle_import(self, path):\n imported_file = open(self._get_full_path(path))\n self._process(imported_file.read())\n imported_file.close()\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99847:Assign_L112_C8", "label": "imported_file = open()", "type": "assigned_variable", "loc": [112, 112], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L111_C4", "vector": [14, 2, 0.5572, 0.005, 2, 0.22, 0.0, 133, 3, 1, 0, 0, 693, 10, 2], "semantic": {"name": "imported_file", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": " imported_file = open(self._get_full_path(path))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99847:Expr_L113_C8", "label": "_process()", "type": "expression", "loc": [113, 113], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L111_C4", "vector": [8, 2, 0.5622, 0.005, 2, 0.22, 0.3333, 99, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "_process", "arg_names": [], "import_names": [], "rhs_call_name": "_process", "annotation": ""}, "snippet": " self._process(imported_file.read())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99847:Expr_L114_C8", "label": "close()", "type": "expression", "loc": [114, 114], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L111_C4", "vector": [8, 2, 0.5672, 0.005, 2, 0.22, 0.6667, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": " imported_file.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99847:Return_L115_C8", "label": "return", "type": "return", "loc": [115, 115], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L111_C4", "vector": [13, 2, 0.5721, 0.005, 2, 0.22, 1.0, 0, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L117_C4", "label": "_handle_for", "type": "function", "loc": [117, 130], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99847:ClassDef_L35_C0", "vector": [2, 1, 0.6144, 0.0697, 1, 0.54, 0.6154, 237, 0, 3, 1, 0, 0, 0, 8], "semantic": {"name": "_handle_for", "arg_names": ["self", "expression", "block_lines"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _handle_for(self, expression, block_lines):\n block = '\\n'.join(block_lines)\n result = []\n var_name, _, value_list = expression.split(' ', 2)\n namespace = self._namespace.copy()\n for value in namespace.replace_scalar(value_list):\n namespace[var_name] = value\n temp = Template(template=block, functions=self._functions)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99847:Assign_L118_C8", "label": "block = join()", "type": "assigned_variable", "loc": [118, 118], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L117_C4", "vector": [14, 2, 0.5871, 0.005, 2, 0.84, 0.0, 506, 3, 1, 0, 0, 933, 10, 1], "semantic": {"name": "block", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": " block = '\\n'.join(block_lines)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99847:Assign_L119_C8", "label": "result =", "type": "assigned_variable", "loc": [119, 119], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L117_C4", "vector": [14, 2, 0.592, 0.005, 2, 0.84, 0.1667, 51, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "result", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " result = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99847:Assign_L120_C8", "label": "var_name, _, value_list = split()", "type": "assigned_variable", "loc": [120, 120], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L117_C4", "vector": [14, 2, 0.597, 0.005, 2, 0.84, 0.3333, 792, 3, 2, 0, 0, 908, 10, 1], "semantic": {"name": "var_name, _, value_list", "arg_names": [], "import_names": [], "rhs_call_name": "split", "annotation": ""}, "snippet": " var_name, _, value_list = expression.split(' ', 2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99847:Assign_L121_C8", "label": "namespace = copy()", "type": "assigned_variable", "loc": [121, 121], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L117_C4", "vector": [14, 2, 0.602, 0.005, 2, 0.84, 0.5, 127, 3, 0, 0, 0, 739, 10, 1], "semantic": {"name": "namespace", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " namespace = self._namespace.copy()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99847:For_L122_C8", "label": "for value", "type": "for", "loc": [122, 127], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L117_C4", "vector": [6, 2, 0.6194, 0.0299, 2, 0.84, 0.6667, 441, 3, 0, 0, 0, 0, 0, 4], "semantic": {"name": "value", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for value in namespace.replace_scalar(value_list):\n namespace[var_name] = value\n temp = Template(template=block, functions=self._functions)\n ret = temp.generate(namespace)\n if ret:\n result.append(ret)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99847:Assign_L123_C12", "label": "assign", "type": "assigned_variable", "loc": [123, 123], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99847:For_L122_C8", "vector": [14, 3, 0.6119, 0.005, 3, 0.18, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " namespace[var_name] = value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99847:Assign_L124_C12", "label": "temp = Template()", "type": "assigned_variable", "loc": [124, 124], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99847:For_L122_C8", "vector": [14, 3, 0.6169, 0.005, 3, 0.18, 0.3333, 915, 3, 2, 0, 0, 137, 10, 1], "semantic": {"name": "temp", "arg_names": [], "import_names": [], "rhs_call_name": "Template", "annotation": ""}, "snippet": " temp = Template(template=block, functions=self._functions)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99847:Assign_L125_C12", "label": "ret = generate()", "type": "assigned_variable", "loc": [125, 125], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99847:For_L122_C8", "vector": [14, 3, 0.6219, 0.005, 3, 0.18, 0.6667, 501, 3, 1, 0, 0, 410, 10, 1], "semantic": {"name": "ret", "arg_names": [], "import_names": [], "rhs_call_name": "generate", "annotation": ""}, "snippet": " ret = temp.generate(namespace)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99847:If_L126_C12", "label": "if", "type": "if", "loc": [126, 127], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99847:For_L122_C8", "vector": [4, 3, 0.6294, 0.01, 3, 0.18, 1.0, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if ret:\n result.append(ret)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99847:Expr_L127_C16", "label": "append()", "type": "expression", "loc": [127, 127], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99847:If_L126_C12", "vector": [8, 4, 0.6318, 0.005, 4, 0.51, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " result.append(ret)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99847:If_L128_C8", "label": "if", "type": "if", "loc": [128, 129], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L117_C4", "vector": [4, 2, 0.6393, 0.01, 2, 0.84, 0.8333, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not result:\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99847:Return_L129_C12", "label": "return", "type": "return", "loc": [129, 129], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99847:If_L128_C8", "vector": [13, 3, 0.6418, 0.005, 3, 0.34, 0.0, 0, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99847:Return_L130_C8", "label": "return", "type": "return", "loc": [130, 130], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L117_C4", "vector": [13, 2, 0.6468, 0.005, 2, 0.84, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return '\\n'.join(result)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L132_C4", "label": "_handle_if", "type": "function", "loc": [132, 138], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99847:ClassDef_L35_C0", "vector": [2, 1, 0.6716, 0.0348, 1, 0.54, 0.6923, 699, 0, 3, 1, 0, 0, 0, 5], "semantic": {"name": "_handle_if", "arg_names": ["self", "expression", "block_lines"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _handle_if(self, expression, block_lines):\n expression = self._handle_variables(expression)\n if_block, else_block = self._get_if_and_else_blocks(block_lines)\n result = eval(expression) and if_block or else_block\n if not result:\n return None\n return self._process('\\n'.join(result))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99847:Assign_L133_C8", "label": "expression = _handle_variables()", "type": "assigned_variable", "loc": [133, 133], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L132_C4", "vector": [14, 2, 0.6617, 0.005, 2, 0.77, 0.0, 657, 3, 1, 0, 0, 105, 10, 1], "semantic": {"name": "expression", "arg_names": [], "import_names": [], "rhs_call_name": "_handle_variables", "annotation": ""}, "snippet": " expression = self._handle_variables(expression)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99847:Assign_L134_C8", "label": "if_block, else_block = _get_if_and_else_blocks()", "type": "assigned_variable", "loc": [134, 134], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L132_C4", "vector": [14, 2, 0.6667, 0.005, 2, 0.77, 0.25, 9, 3, 1, 0, 0, 462, 10, 1], "semantic": {"name": "if_block, else_block", "arg_names": [], "import_names": [], "rhs_call_name": "_get_if_and_else_blocks", "annotation": ""}, "snippet": " if_block, else_block = self._get_if_and_else_blocks(block_lines)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99847:Assign_L135_C8", "label": "result =", "type": "assigned_variable", "loc": [135, 135], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L132_C4", "vector": [14, 2, 0.6716, 0.005, 2, 0.77, 0.5, 51, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "result", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " result = eval(expression) and if_block or else_block"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99847:If_L136_C8", "label": "if", "type": "if", "loc": [136, 137], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L132_C4", "vector": [4, 2, 0.6791, 0.01, 2, 0.77, 0.75, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not result:\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99847:Return_L137_C12", "label": "return", "type": "return", "loc": [137, 137], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99847:If_L136_C8", "vector": [13, 3, 0.6816, 0.005, 3, 0.52, 0.0, 0, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99847:Return_L138_C8", "label": "return", "type": "return", "loc": [138, 138], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L132_C4", "vector": [13, 2, 0.6866, 0.005, 2, 0.77, 1.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._process('\\n'.join(result))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L140_C4", "label": "_get_if_and_else_blocks", "type": "function", "loc": [140, 150], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99847:ClassDef_L35_C0", "vector": [2, 1, 0.7214, 0.0547, 1, 0.54, 0.7692, 462, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "_get_if_and_else_blocks", "arg_names": ["self", "block_lines"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _get_if_and_else_blocks(self, block_lines):\n else_line = PRE + 'ELSE' + POST\n if_block = []\n else_block = []\n block = if_block\n for line in block_lines:\n if line.strip() == else_line:\n block = else_block"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99847:Assign_L141_C8", "label": "else_line =", "type": "assigned_variable", "loc": [141, 141], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L140_C4", "vector": [14, 2, 0.7015, 0.005, 2, 0.14, 0.0, 615, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "else_line", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " else_line = PRE + 'ELSE' + POST"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99847:Assign_L142_C8", "label": "if_block =", "type": "assigned_variable", "loc": [142, 142], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L140_C4", "vector": [14, 2, 0.7065, 0.005, 2, 0.14, 0.2, 94, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "if_block", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if_block = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99847:Assign_L143_C8", "label": "else_block =", "type": "assigned_variable", "loc": [143, 143], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L140_C4", "vector": [14, 2, 0.7114, 0.005, 2, 0.14, 0.4, 498, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "else_block", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " else_block = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99847:Assign_L144_C8", "label": "block =", "type": "assigned_variable", "loc": [144, 144], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L140_C4", "vector": [14, 2, 0.7164, 0.005, 2, 0.14, 0.6, 506, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "block", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " block = if_block"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99847:For_L145_C8", "label": "for line", "type": "for", "loc": [145, 149], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L140_C4", "vector": [6, 2, 0.7313, 0.0249, 2, 0.14, 0.8, 373, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "line", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for line in block_lines:\n if line.strip() == else_line:\n block = else_block\n else:\n block.append(line)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99847:If_L146_C12", "label": "if", "type": "if", "loc": [146, 149], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99847:For_L145_C8", "vector": [4, 3, 0.7338, 0.0199, 3, 0.78, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if line.strip() == else_line:\n block = else_block\n else:\n block.append(line)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99847:Assign_L147_C16", "label": "block =", "type": "assigned_variable", "loc": [147, 147], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99847:If_L146_C12", "vector": [14, 4, 0.7313, 0.005, 4, 0.91, 0.0, 506, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "block", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " block = else_block"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99847:Expr_L149_C16", "label": "append()", "type": "expression", "loc": [149, 149], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99847:If_L146_C12", "vector": [8, 4, 0.7413, 0.005, 4, 0.91, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " block.append(line)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99847:Return_L150_C8", "label": "return", "type": "return", "loc": [150, 150], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L140_C4", "vector": [13, 2, 0.7463, 0.005, 2, 0.14, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return if_block, else_block"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L152_C4", "label": "_handle_call", "type": "function", "loc": [152, 165], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99847:ClassDef_L35_C0", "vector": [2, 1, 0.7886, 0.0697, 1, 0.54, 0.8462, 318, 0, 2, 1, 0, 0, 0, 8], "semantic": {"name": "_handle_call", "arg_names": ["self", "expression"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _handle_call(self, expression):\n func_tokens = expression.split()\n name = func_tokens[0]\n args = func_tokens[1:]\n namespace = self._namespace.copy()\n try:\n func_args, func_body = self._functions[name]\n except KeyError:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99847:Assign_L153_C8", "label": "func_tokens = split()", "type": "assigned_variable", "loc": [153, 153], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L152_C4", "vector": [14, 2, 0.7612, 0.005, 2, 0.61, 0.0, 819, 3, 0, 0, 0, 908, 10, 1], "semantic": {"name": "func_tokens", "arg_names": [], "import_names": [], "rhs_call_name": "split", "annotation": ""}, "snippet": " func_tokens = expression.split()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99847:Assign_L154_C8", "label": "name =", "type": "assigned_variable", "loc": [154, 154], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L152_C4", "vector": [14, 2, 0.7662, 0.005, 2, 0.61, 0.1429, 57, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " name = func_tokens[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99847:Assign_L155_C8", "label": "args =", "type": "assigned_variable", "loc": [155, 155], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L152_C4", "vector": [14, 2, 0.7711, 0.005, 2, 0.61, 0.2857, 805, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "args", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " args = func_tokens[1:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99847:Assign_L156_C8", "label": "namespace = copy()", "type": "assigned_variable", "loc": [156, 156], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L152_C4", "vector": [14, 2, 0.7761, 0.005, 2, 0.61, 0.4286, 127, 3, 0, 0, 0, 739, 10, 1], "semantic": {"name": "namespace", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " namespace = self._namespace.copy()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99847:Try_L157_C8", "label": "try", "type": "try", "loc": [157, 161], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L152_C4", "vector": [7, 2, 0.791, 0.0249, 2, 0.61, 0.5714, 0, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n func_args, func_body = self._functions[name]\n except KeyError:\n raise DataError(\"Non-existing function '%s', available: %s\"\n % (name, self._functions.keys()))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99847:Assign_L158_C12", "label": "func_args, func_body =", "type": "assigned_variable", "loc": [158, 158], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99847:Try_L157_C8", "vector": [14, 3, 0.7861, 0.005, 3, 0.23, 0.0, 818, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "func_args, func_body", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " func_args, func_body = self._functions[name]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99847:For_L162_C8", "label": "for key, value", "type": "for", "loc": [162, 163], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L152_C4", "vector": [6, 2, 0.8085, 0.01, 2, 0.61, 0.7143, 839, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "key, value", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for key, value in zip(func_args, args):\n namespace[key] = namespace.replace_string(value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99847:Assign_L163_C12", "label": " = replace_string()", "type": "assigned_variable", "loc": [163, 163], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99847:For_L162_C8", "vector": [14, 3, 0.8109, 0.005, 3, 0.98, 0.0, 0, 3, 1, 0, 0, 720, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "replace_string", "annotation": ""}, "snippet": " namespace[key] = namespace.replace_string(value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99847:Assign_L164_C8", "label": "temp = Template()", "type": "assigned_variable", "loc": [164, 164], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L152_C4", "vector": [14, 2, 0.8159, 0.005, 2, 0.61, 0.8571, 915, 3, 2, 0, 0, 137, 10, 1], "semantic": {"name": "temp", "arg_names": [], "import_names": [], "rhs_call_name": "Template", "annotation": ""}, "snippet": " temp = Template(template=func_body, functions=self._functions)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99847:Return_L165_C8", "label": "return", "type": "return", "loc": [165, 165], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L152_C4", "vector": [13, 2, 0.8209, 0.005, 2, 0.61, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return temp.generate(namespace)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L167_C4", "label": "_handle_function", "type": "function", "loc": [167, 171], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99847:ClassDef_L35_C0", "vector": [2, 1, 0.8408, 0.0249, 1, 0.54, 0.9231, 492, 0, 3, 0, 0, 0, 0, 2], "semantic": {"name": "_handle_function", "arg_names": ["self", "signature", "block_lines"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _handle_function(self, signature, block_lines):\n signature_tokens = signature.split()\n name = signature_tokens[0]\n args = signature_tokens[1:]\n self._functions[name] = (args, '\\n'.join(block_lines))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99847:Assign_L168_C8", "label": "signature_tokens = split()", "type": "assigned_variable", "loc": [168, 168], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L167_C4", "vector": [14, 2, 0.8358, 0.005, 2, 0.53, 0.0, 576, 3, 0, 0, 0, 908, 10, 1], "semantic": {"name": "signature_tokens", "arg_names": [], "import_names": [], "rhs_call_name": "split", "annotation": ""}, "snippet": " signature_tokens = signature.split()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99847:Assign_L169_C8", "label": "name =", "type": "assigned_variable", "loc": [169, 169], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L167_C4", "vector": [14, 2, 0.8408, 0.005, 2, 0.53, 0.3333, 57, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " name = signature_tokens[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99847:Assign_L170_C8", "label": "args =", "type": "assigned_variable", "loc": [170, 170], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L167_C4", "vector": [14, 2, 0.8458, 0.005, 2, 0.53, 0.6667, 805, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "args", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " args = signature_tokens[1:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99847:Assign_L171_C8", "label": "assign", "type": "assigned_variable", "loc": [171, 171], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L167_C4", "vector": [14, 2, 0.8507, 0.005, 2, 0.53, 1.0, 0, 0, 0, 0, 0, 0, 8, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._functions[name] = (args, '\\n'.join(block_lines))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L173_C4", "label": "_get_full_path", "type": "function", "loc": [173, 182], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99847:ClassDef_L35_C0", "vector": [2, 1, 0.8831, 0.0498, 1, 0.54, 1.0, 665, 0, 2, 1, 0, 0, 0, 4], "semantic": {"name": "_get_full_path", "arg_names": ["self", "path"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _get_full_path(self, path):\n if self.parent_dir is None:\n raise FrameworkError('Parent directory is None. Probably template '\n 'was string and other files was referred. '\n 'That is not supported.')\n abs_path = os.path.join(self.parent_dir, path)\n if os.path.exists(abs_path):\n return abs_path"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99847:If_L174_C8", "label": "if", "type": "if", "loc": [174, 177], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L173_C4", "vector": [4, 2, 0.8731, 0.0199, 2, 0.51, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.parent_dir is None:\n raise FrameworkError('Parent directory is None. Probably template '\n 'was string and other files was referred. '\n 'That is not supported.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99847:Assign_L178_C8", "label": "abs_path = join()", "type": "assigned_variable", "loc": [178, 178], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L173_C4", "vector": [14, 2, 0.8856, 0.005, 2, 0.51, 0.5, 253, 3, 2, 0, 0, 933, 10, 1], "semantic": {"name": "abs_path", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": " abs_path = os.path.join(self.parent_dir, path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99847:If_L179_C8", "label": "if", "type": "if", "loc": [179, 182], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L173_C4", "vector": [4, 2, 0.898, 0.0199, 2, 0.51, 1.0, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if os.path.exists(abs_path):\n return abs_path\n else:\n raise DataError(\"File '%s' does not exist.\" % abs_path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99847:Return_L180_C12", "label": "return", "type": "return", "loc": [180, 180], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99847:If_L179_C8", "vector": [13, 3, 0.8955, 0.005, 3, 0.63, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return abs_path"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99847:ClassDef_L185_C0", "label": "Result", "type": "class", "loc": [185, 201], "level": 0, "parent": null, "vector": [3, 0, 0.9602, 0.0846, 0, 0.66, 1.0, 611, 0, 3, 0, 0, 0, 0, 4], "semantic": {"name": "Result", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Result:\n\n def __init__(self, output=None):\n self._output = output\n self._result = []\n\n def add(self, text):\n if text is not None:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L187_C4", "label": "__init__", "type": "function", "loc": [187, 189], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99847:ClassDef_L185_C0", "vector": [2, 1, 0.9353, 0.0149, 1, 0.3, 0.0, 555, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "output"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, output=None):\n self._output = output\n self._result = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99847:Assign_L188_C8", "label": "self._output =", "type": "assigned_variable", "loc": [188, 188], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L187_C4", "vector": [14, 2, 0.9353, 0.005, 2, 0.64, 0.0, 867, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._output", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._output = output"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99847:Assign_L189_C8", "label": "self._result =", "type": "assigned_variable", "loc": [189, 189], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L187_C4", "vector": [14, 2, 0.9403, 0.005, 2, 0.64, 1.0, 48, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self._result", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._result = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L191_C4", "label": "add", "type": "function", "loc": [191, 196], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99847:ClassDef_L185_C0", "vector": [2, 1, 0.9627, 0.0299, 1, 0.3, 0.5, 241, 0, 2, 0, 0, 0, 0, 3], "semantic": {"name": "add", "arg_names": ["self", "text"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def add(self, text):\n if text is not None:\n if self._output is None:\n self._result.append(text)\n else:\n self._output.write(text.encode('UTF-8') + '\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99847:If_L192_C8", "label": "if", "type": "if", "loc": [192, 196], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L191_C4", "vector": [4, 2, 0.9652, 0.0249, 2, 0.55, 0.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if text is not None:\n if self._output is None:\n self._result.append(text)\n else:\n self._output.write(text.encode('UTF-8') + '\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99847:If_L193_C12", "label": "if", "type": "if", "loc": [193, 196], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99847:If_L192_C8", "vector": [4, 3, 0.9677, 0.0199, 3, 0.69, 0.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self._output is None:\n self._result.append(text)\n else:\n self._output.write(text.encode('UTF-8') + '\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99847:Expr_L194_C16", "label": "append()", "type": "expression", "loc": [194, 194], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99847:If_L193_C12", "vector": [8, 4, 0.9652, 0.005, 4, 0.32, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self._result.append(text)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99847:Expr_L196_C16", "label": "write()", "type": "expression", "loc": [196, 196], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99847:If_L193_C12", "vector": [8, 4, 0.9751, 0.005, 4, 0.32, 1.0, 837, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " self._output.write(text.encode('UTF-8') + '\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L198_C4", "label": "get_result", "type": "function", "loc": [198, 201], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99847:ClassDef_L185_C0", "vector": [2, 1, 0.9925, 0.0199, 1, 0.3, 1.0, 569, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "get_result", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_result(self):\n if not self._result:\n return None\n return '\\n'.join(self._result)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99847:If_L199_C8", "label": "if", "type": "if", "loc": [199, 200], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L198_C4", "vector": [4, 2, 0.9925, 0.01, 2, 0.33, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not self._result:\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99847:Return_L200_C12", "label": "return", "type": "return", "loc": [200, 200], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99847:If_L199_C8", "vector": [13, 3, 0.995, 0.005, 3, 0.81, 0.0, 0, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99847:Return_L201_C8", "label": "return", "type": "return", "loc": [201, 201], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L198_C4", "vector": [13, 2, 1.0, 0.005, 2, 0.33, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return '\\n'.join(self._result)"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99847:ClassDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L29_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L29_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99847:Expr_L30_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L29_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99847:For_L31_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99847:For_L31_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99847:Assign_L32_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99847:ClassDef_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L37_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99847:If_L38_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99847:If_L40_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99847:If_L40_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99847:Assign_L41_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99847:If_L40_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99847:Assign_L42_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99847:If_L40_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99847:Expr_L43_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99847:If_L40_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99847:Assign_L44_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99847:If_L40_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99847:Assign_L46_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99847:Assign_L47_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99847:Assign_L48_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99847:Assign_L50_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99847:ClassDef_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L57_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L57_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99847:Assign_L58_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L57_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99847:Return_L59_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99847:ClassDef_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L61_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L61_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99847:Assign_L62_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L61_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99847:Assign_L63_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L61_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99847:While_L64_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99847:While_L64_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99847:Assign_L65_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99847:While_L64_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99847:Try_L66_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99847:Try_L66_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99847:Expr_L67_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99847:Try_L66_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99847:Expr_L69_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L61_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99847:Return_L70_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99847:ClassDef_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L72_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L72_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99847:If_L73_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L72_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99847:Assign_L75_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L72_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99847:Try_L76_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99847:Try_L76_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99847:Assign_L77_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L72_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99847:If_L80_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99847:If_L80_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99847:Assign_L81_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99847:If_L80_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99847:Return_L82_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L72_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99847:Return_L83_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99847:ClassDef_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L85_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L85_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99847:Expr_L86_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L85_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99847:Assign_L90_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L85_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99847:Assign_L91_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L85_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99847:While_L92_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99847:While_L92_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99847:Try_L93_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99847:Try_L93_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99847:Assign_L94_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99847:While_L92_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99847:If_L97_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99847:While_L92_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99847:Expr_L99_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L85_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99847:Return_L100_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99847:ClassDef_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L102_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L102_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99847:Return_L103_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99847:ClassDef_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L105_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L105_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99847:Assign_L106_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L105_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99847:Assign_L107_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L105_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99847:Expr_L108_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L105_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99847:Return_L109_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99847:ClassDef_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L111_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L111_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99847:Assign_L112_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L111_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99847:Expr_L113_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L111_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99847:Expr_L114_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L111_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99847:Return_L115_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99847:ClassDef_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L117_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L117_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99847:Assign_L118_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L117_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99847:Assign_L119_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L117_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99847:Assign_L120_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L117_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99847:Assign_L121_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L117_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99847:For_L122_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99847:For_L122_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99847:Assign_L123_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99847:For_L122_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99847:Assign_L124_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99847:For_L122_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99847:Assign_L125_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99847:For_L122_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99847:If_L126_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99847:If_L126_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99847:Expr_L127_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L117_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99847:If_L128_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99847:If_L128_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99847:Return_L129_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L117_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99847:Return_L130_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99847:ClassDef_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L132_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L132_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99847:Assign_L133_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L132_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99847:Assign_L134_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L132_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99847:Assign_L135_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L132_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99847:If_L136_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99847:If_L136_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99847:Return_L137_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L132_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99847:Return_L138_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99847:ClassDef_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L140_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L140_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99847:Assign_L141_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L140_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99847:Assign_L142_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L140_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99847:Assign_L143_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L140_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99847:Assign_L144_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L140_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99847:For_L145_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99847:For_L145_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99847:If_L146_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99847:If_L146_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99847:Assign_L147_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99847:If_L146_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99847:Expr_L149_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L140_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99847:Return_L150_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99847:ClassDef_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L152_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L152_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99847:Assign_L153_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L152_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99847:Assign_L154_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L152_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99847:Assign_L155_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L152_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99847:Assign_L156_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L152_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99847:Try_L157_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99847:Try_L157_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99847:Assign_L158_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L152_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99847:For_L162_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99847:For_L162_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99847:Assign_L163_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L152_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99847:Assign_L164_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L152_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99847:Return_L165_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99847:ClassDef_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L167_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L167_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99847:Assign_L168_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L167_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99847:Assign_L169_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L167_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99847:Assign_L170_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L167_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99847:Assign_L171_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99847:ClassDef_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L173_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L173_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99847:If_L174_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L173_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99847:Assign_L178_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L173_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99847:If_L179_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99847:If_L179_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99847:Return_L180_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99847:ClassDef_L185_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L187_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L187_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99847:Assign_L188_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L187_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99847:Assign_L189_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99847:ClassDef_L185_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L191_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L191_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99847:If_L192_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99847:If_L192_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99847:If_L193_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99847:If_L193_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99847:Expr_L194_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99847:If_L193_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99847:Expr_L196_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99847:ClassDef_L185_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L198_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L198_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99847:If_L199_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99847:If_L199_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99847:Return_L200_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99847:FunctionDef_L198_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99847:Return_L201_C8"}] |
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import re
_ESCAPE_RE = re.compile(r'(\\+)([^\\]{0,2})') # escapes and nextchars
_SEQS_TO_BE_ESCAPED = ('\\', '${', '@{', '%{', '&{', '*{' , '=')
def escape(item):
if not isinstance(item, basestring):
return item
for seq in _SEQS_TO_BE_ESCAPED:
item = item.replace(seq, '\\' + seq)
return item
def unescape(item):
if not isinstance(item, basestring):
return item
result = []
unprocessed = item
while True:
res = _ESCAPE_RE.search(unprocessed)
# If no escapes found append string to result and exit loop
if res is None:
result.append(unprocessed)
break
# Split string to pre match, escapes, nextchars and unprocessed parts
# (e.g. '<pre><esc><nc><unproc>') where nextchars contains 0-2 chars
# and unprocessed may contain more escapes. Pre match part contains
# no escapes can is appended directly to result.
result.append(unprocessed[:res.start()])
escapes = res.group(1)
nextchars = res.group(2)
unprocessed = unprocessed[res.end():]
# Append every second escape char to result
result.append('\\' * (len(escapes) / 2))
# Handle '\n', '\r' and '\t'. Note that both '\n' and '\n ' are
# converted to '\n'
if len(escapes) % 2 == 0 or len(nextchars) == 0 \
or nextchars[0] not in ['n','r','t']:
result.append(nextchars)
elif nextchars[0] == 'n':
if len(nextchars) == 1 or nextchars[1] == ' ':
result.append('\n')
else:
result.append('\n' + nextchars[1])
elif nextchars[0] == 'r':
result.append('\r' + nextchars[1:])
else:
result.append('\t' + nextchars[1:])
return ''.join(result)
| ajibawa-2023/Python-Code-Large/train/row_99848 | 33 | 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_99848:Import_L15_C0", "label": "re import re", "type": "import", "loc": [15, 15], "level": 0, "parent": null, "vector": [1, 0, 0.2308, 0.0154, 0, 0.66, 0.0, 540, 0, 1, 0, 0, 540, 0, 0], "semantic": {"name": "re", "arg_names": [], "import_names": ["re"], "rhs_call_name": "", "annotation": ""}, "snippet": "import re"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99848:Assign_L18_C0", "label": "_ESCAPE_RE = compile()", "type": "assigned_variable", "loc": [18, 18], "level": 0, "parent": null, "vector": [14, 0, 0.2769, 0.0154, 0, 0.66, 0.25, 44, 3, 1, 0, 0, 821, 10, 1], "semantic": {"name": "_ESCAPE_RE", "arg_names": [], "import_names": [], "rhs_call_name": "compile", "annotation": ""}, "snippet": "_ESCAPE_RE = re.compile(r'(\\\\+)([^\\\\]{0,2})') # escapes and nextchars"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99848:Assign_L19_C0", "label": "_SEQS_TO_BE_ESCAPED =", "type": "assigned_variable", "loc": [19, 19], "level": 0, "parent": null, "vector": [14, 0, 0.2923, 0.0154, 0, 0.66, 0.5, 974, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "_SEQS_TO_BE_ESCAPED", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "_SEQS_TO_BE_ESCAPED = ('\\\\', '${', '@{', '%{', '&{', '*{' , '=')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99848:FunctionDef_L22_C0", "label": "escape", "type": "function", "loc": [22, 27], "level": 0, "parent": null, "vector": [2, 0, 0.3769, 0.0923, 0, 0.66, 0.75, 494, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "escape", "arg_names": ["item"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def escape(item):\n if not isinstance(item, basestring):\n return item\n for seq in _SEQS_TO_BE_ESCAPED:\n item = item.replace(seq, '\\\\' + seq)\n return item"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99848:If_L23_C4", "label": "if", "type": "if", "loc": [23, 24], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99848:FunctionDef_L22_C0", "vector": [4, 1, 0.3615, 0.0308, 1, 0.67, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not isinstance(item, basestring):\n return item"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99848:Return_L24_C8", "label": "return", "type": "return", "loc": [24, 24], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99848:If_L23_C4", "vector": [13, 2, 0.3692, 0.0154, 2, 0.54, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return item"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99848:For_L25_C4", "label": "for seq", "type": "for", "loc": [25, 26], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99848:FunctionDef_L22_C0", "vector": [6, 1, 0.3923, 0.0308, 1, 0.67, 0.5, 609, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "seq", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for seq in _SEQS_TO_BE_ESCAPED:\n item = item.replace(seq, '\\\\' + seq)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99848:Assign_L26_C8", "label": "item = replace()", "type": "assigned_variable", "loc": [26, 26], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99848:For_L25_C4", "vector": [14, 2, 0.4, 0.0154, 2, 0.88, 0.0, 434, 3, 2, 0, 0, 293, 10, 1], "semantic": {"name": "item", "arg_names": [], "import_names": [], "rhs_call_name": "replace", "annotation": ""}, "snippet": " item = item.replace(seq, '\\\\' + seq)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99848:Return_L27_C4", "label": "return", "type": "return", "loc": [27, 27], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99848:FunctionDef_L22_C0", "vector": [13, 1, 0.4154, 0.0154, 1, 0.67, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return item"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99848:FunctionDef_L30_C0", "label": "unescape", "type": "function", "loc": [30, 65], "level": 0, "parent": null, "vector": [2, 0, 0.7308, 0.5538, 0, 0.66, 1.0, 32, 0, 1, 1, 0, 0, 0, 19], "semantic": {"name": "unescape", "arg_names": ["item"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def unescape(item):\n if not isinstance(item, basestring):\n return item\n result = []\n unprocessed = item\n while True:\n res = _ESCAPE_RE.search(unprocessed)\n # If no escapes found append string to result and exit loop"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99848:If_L31_C4", "label": "if", "type": "if", "loc": [31, 32], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99848:FunctionDef_L30_C0", "vector": [4, 1, 0.4846, 0.0308, 1, 0.61, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not isinstance(item, basestring):\n return item"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99848:Return_L32_C8", "label": "return", "type": "return", "loc": [32, 32], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99848:If_L31_C4", "vector": [13, 2, 0.4923, 0.0154, 2, 0.55, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return item"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99848:Assign_L33_C4", "label": "result =", "type": "assigned_variable", "loc": [33, 33], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99848:FunctionDef_L30_C0", "vector": [14, 1, 0.5077, 0.0154, 1, 0.61, 0.25, 51, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "result", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " result = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99848:Assign_L34_C4", "label": "unprocessed =", "type": "assigned_variable", "loc": [34, 34], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99848:FunctionDef_L30_C0", "vector": [14, 1, 0.5231, 0.0154, 1, 0.61, 0.5, 711, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "unprocessed", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " unprocessed = item"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99848:While_L35_C4", "label": "while", "type": "while", "loc": [35, 64], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99848:FunctionDef_L30_C0", "vector": [5, 1, 0.7615, 0.4615, 1, 0.61, 0.75, 0, 1, 0, 0, 0, 0, 0, 17], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while True:\n res = _ESCAPE_RE.search(unprocessed)\n # If no escapes found append string to result and exit loop\n if res is None:\n result.append(unprocessed)\n break\n # Split string to pre match, escapes, nextchars and unprocessed parts\n # (e.g. '<pre><esc><nc><unproc>') where nextchars contains 0-2 chars"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99848:Assign_L36_C8", "label": "res = search()", "type": "assigned_variable", "loc": [36, 36], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99848:While_L35_C4", "vector": [14, 2, 0.5538, 0.0154, 2, 0.73, 0.0, 413, 3, 1, 0, 0, 163, 10, 1], "semantic": {"name": "res", "arg_names": [], "import_names": [], "rhs_call_name": "search", "annotation": ""}, "snippet": " res = _ESCAPE_RE.search(unprocessed)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99848:If_L38_C8", "label": "if", "type": "if", "loc": [38, 40], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99848:While_L35_C4", "vector": [4, 2, 0.6, 0.0462, 2, 0.73, 0.1429, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if res is None:\n result.append(unprocessed)\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99848:Expr_L39_C12", "label": "append()", "type": "expression", "loc": [39, 39], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99848:If_L38_C8", "vector": [8, 3, 0.6, 0.0154, 3, 0.13, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " result.append(unprocessed)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99848:Expr_L45_C8", "label": "append()", "type": "expression", "loc": [45, 45], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99848:While_L35_C4", "vector": [8, 2, 0.6923, 0.0154, 2, 0.73, 0.2857, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " result.append(unprocessed[:res.start()])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99848:Assign_L46_C8", "label": "escapes = group()", "type": "assigned_variable", "loc": [46, 46], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99848:While_L35_C4", "vector": [14, 2, 0.7077, 0.0154, 2, 0.73, 0.4286, 449, 3, 1, 0, 0, 43, 10, 1], "semantic": {"name": "escapes", "arg_names": [], "import_names": [], "rhs_call_name": "group", "annotation": ""}, "snippet": " escapes = res.group(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99848:Assign_L47_C8", "label": "nextchars = group()", "type": "assigned_variable", "loc": [47, 47], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99848:While_L35_C4", "vector": [14, 2, 0.7231, 0.0154, 2, 0.73, 0.5714, 607, 3, 1, 0, 0, 43, 10, 1], "semantic": {"name": "nextchars", "arg_names": [], "import_names": [], "rhs_call_name": "group", "annotation": ""}, "snippet": " nextchars = res.group(2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99848:Assign_L48_C8", "label": "unprocessed =", "type": "assigned_variable", "loc": [48, 48], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99848:While_L35_C4", "vector": [14, 2, 0.7385, 0.0154, 2, 0.73, 0.7143, 711, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "unprocessed", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " unprocessed = unprocessed[res.end():]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99848:Expr_L50_C8", "label": "append()", "type": "expression", "loc": [50, 50], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99848:While_L35_C4", "vector": [8, 2, 0.7692, 0.0154, 2, 0.73, 0.8571, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " result.append('\\\\' * (len(escapes) / 2))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99848:If_L53_C8", "label": "if", "type": "if", "loc": [53, 64], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99848:While_L35_C4", "vector": [4, 2, 0.9, 0.1846, 2, 0.73, 1.0, 0, 0, 0, 0, 0, 0, 0, 8], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(escapes) % 2 == 0 or len(nextchars) == 0 \\\n or nextchars[0] not in ['n','r','t']:\n result.append(nextchars)\n elif nextchars[0] == 'n':\n if len(nextchars) == 1 or nextchars[1] == ' ':\n result.append('\\n')\n else:\n result.append('\\n' + nextchars[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99848:Expr_L55_C12", "label": "append()", "type": "expression", "loc": [55, 55], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99848:If_L53_C8", "vector": [8, 3, 0.8462, 0.0154, 3, 0.38, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " result.append(nextchars)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99848:If_L56_C8", "label": "if", "type": "if", "loc": [56, 64], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99848:If_L53_C8", "vector": [4, 3, 0.9231, 0.1385, 3, 0.38, 1.0, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif nextchars[0] == 'n':\n if len(nextchars) == 1 or nextchars[1] == ' ':\n result.append('\\n')\n else:\n result.append('\\n' + nextchars[1])\n elif nextchars[0] == 'r':\n result.append('\\r' + nextchars[1:])\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99848:If_L57_C12", "label": "if", "type": "if", "loc": [57, 60], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99848:If_L56_C8", "vector": [4, 4, 0.9, 0.0615, 4, 0.99, 0.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(nextchars) == 1 or nextchars[1] == ' ':\n result.append('\\n')\n else:\n result.append('\\n' + nextchars[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99848:Expr_L58_C16", "label": "append()", "type": "expression", "loc": [58, 58], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99848:If_L57_C12", "vector": [8, 5, 0.8923, 0.0154, 5, 0.18, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " result.append('\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99848:Expr_L60_C16", "label": "append()", "type": "expression", "loc": [60, 60], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99848:If_L57_C12", "vector": [8, 5, 0.9231, 0.0154, 5, 0.18, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " result.append('\\n' + nextchars[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99848:If_L61_C8", "label": "if", "type": "if", "loc": [61, 64], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99848:If_L56_C8", "vector": [4, 4, 0.9615, 0.0615, 4, 0.99, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif nextchars[0] == 'r':\n result.append('\\r' + nextchars[1:])\n else:\n result.append('\\t' + nextchars[1:])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99848:Expr_L62_C12", "label": "append()", "type": "expression", "loc": [62, 62], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99848:If_L61_C8", "vector": [8, 5, 0.9538, 0.0154, 5, 0.09, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " result.append('\\r' + nextchars[1:])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99848:Expr_L64_C12", "label": "append()", "type": "expression", "loc": [64, 64], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99848:If_L61_C8", "vector": [8, 5, 0.9846, 0.0154, 5, 0.09, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " result.append('\\t' + nextchars[1:])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99848:Return_L65_C4", "label": "return", "type": "return", "loc": [65, 65], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99848:FunctionDef_L30_C0", "vector": [13, 1, 1.0, 0.0154, 1, 0.61, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ''.join(result)"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99848:FunctionDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99848:If_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99848:If_L23_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99848:Return_L24_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99848:FunctionDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99848:For_L25_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99848:For_L25_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99848:Assign_L26_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99848:FunctionDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99848:Return_L27_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99848:FunctionDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99848:If_L31_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99848:If_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99848:Return_L32_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99848:FunctionDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99848:Assign_L33_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99848:FunctionDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99848:Assign_L34_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99848:FunctionDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99848:While_L35_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99848:While_L35_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99848:Assign_L36_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99848:While_L35_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99848:If_L38_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99848:If_L38_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99848:Expr_L39_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99848:While_L35_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99848:Expr_L45_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99848:While_L35_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99848:Assign_L46_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99848:While_L35_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99848:Assign_L47_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99848:While_L35_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99848:Assign_L48_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99848:While_L35_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99848:Expr_L50_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99848:While_L35_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99848:If_L53_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99848:If_L53_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99848:Expr_L55_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99848:If_L53_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99848:If_L56_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99848:If_L56_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99848:If_L57_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99848:If_L57_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99848:Expr_L58_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99848:If_L57_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99848:Expr_L60_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99848:If_L56_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99848:If_L61_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99848:If_L61_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99848:Expr_L62_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99848:If_L61_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99848:Expr_L64_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99848:FunctionDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99848:Return_L65_C4"}] |
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import etreewrapper
class DomWrapper(object):
def __init__(self, path=None, string=None, node=None):
"""Initialize by giving 'path' to an xml file or xml as a 'string'.
Alternative initialization by giving dom 'node' ment to be used only
internally. 'path' may actually also be an already opened file object
(or anything accepted by ElementTree.parse).
"""
node = etreewrapper.get_root(path, string, node)
self.source = path
self.name = node.tag
self.attrs = dict(node.items())
self.text = node.text or ''
self.children = [DomWrapper(path, node=child) for child in list(node)]
def get_nodes(self, path):
"""Returns a list of descendants matching given 'path'.
Path must be a string in format 'child_name/grandchild_name/etc'. No
slash is allowed at the beginning or end of the path string. Returns an
empty list if no matching descendants found and raises AttributeError
if path is invalid.
"""
if not isinstance(path, basestring) \
or path == '' or path[0] == '/' or path[-1] == '/':
raise AttributeError("Invalid path '%s'" % path)
matches = []
for child in self.children:
matches += child._get_matching_elements(path.split('/'))
return matches
def _get_matching_elements(self, tokens):
if self.name != tokens[0]:
return []
elif len(tokens) == 1:
return [self]
else:
matches = []
for child in self.children:
matches += child._get_matching_elements(tokens[1:])
return matches
def get_node(self, path):
"""Similar as get_nodes but checks that exactly one node is found.
Node is returned as is (i.e. not in a list) and AttributeError risen if
no match or more than one match found.
"""
nodes = self.get_nodes(path)
if len(nodes) == 0:
raise AttributeError("No nodes matching path '%s' found" % path)
if len(nodes) > 1:
raise AttributeError("Multiple nodes matching path '%s' found" % path)
return nodes[0]
def get_attr(self, name, default=None):
"""Helper for getting node's attributes.
Otherwise equivalent to 'node.attrs.get(name, default)' but raises
an AttributeError if no value found and no default given.
"""
ret = self.attrs.get(name, default)
if ret is None:
raise AttributeError("No attribute '%s' found" % name)
return ret
def __getattr__(self, name):
"""Syntactic sugar for get_nodes (e.g. dom.elem[0].subelem).
Differs from get_nodes so that if not matching nodes are found an
AttributeError is risen instead of returning an empty list.
"""
nodes = self.get_nodes(name)
if not nodes:
raise AttributeError("No nodes matching path '%s' found" % name)
return nodes
def __getitem__(self, name):
"""Syntactic sugar for get_node (e.g. dom['elem/subelem'])"""
try:
return self.get_node(name)
except AttributeError:
raise IndexError("No node '%s' found" % name)
def __repr__(self):
"""Return node name. Mainly for debugging purposes."""
return self.name
| ajibawa-2023/Python-Code-Large/train/row_99849 | 47 | 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_99849:Import_L15_C0", "label": "etreewrapper import etreewrapper", "type": "import", "loc": [15, 15], "level": 0, "parent": null, "vector": [1, 0, 0.1429, 0.0095, 0, 0.66, 0.0, 651, 0, 1, 0, 0, 651, 0, 0], "semantic": {"name": "etreewrapper", "arg_names": [], "import_names": ["etreewrapper"], "rhs_call_name": "", "annotation": ""}, "snippet": "import etreewrapper"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99849:ClassDef_L18_C0", "label": "DomWrapper", "type": "class", "loc": [18, 105], "level": 0, "parent": null, "vector": [3, 0, 0.5857, 0.8381, 0, 0.66, 1.0, 409, 0, 8, 0, 0, 186, 0, 22], "semantic": {"name": "DomWrapper", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class DomWrapper(object):\n\n def __init__(self, path=None, string=None, node=None):\n \"\"\"Initialize by giving 'path' to an xml file or xml as a 'string'.\n\n Alternative initialization by giving dom 'node' ment to be used only\n internally. 'path' may actually also be an already opened file object\n (or anything accepted by ElementTree.parse)."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99849:FunctionDef_L20_C4", "label": "__init__", "type": "function", "loc": [20, 32], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99849:ClassDef_L18_C0", "vector": [2, 1, 0.2476, 0.1238, 1, 0.84, 0.0, 555, 0, 4, 0, 0, 0, 0, 5], "semantic": {"name": "__init__", "arg_names": ["self", "path", "string", "node"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, path=None, string=None, node=None):\n \"\"\"Initialize by giving 'path' to an xml file or xml as a 'string'.\n\n Alternative initialization by giving dom 'node' ment to be used only\n internally. 'path' may actually also be an already opened file object\n (or anything accepted by ElementTree.parse).\n \"\"\"\n node = etreewrapper.get_root(path, string, node)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99849:Expr_L21_C8", "label": "expression", "type": "expression", "loc": [21, 26], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99849:FunctionDef_L20_C4", "vector": [8, 2, 0.2238, 0.0571, 2, 0.21, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Initialize by giving 'path' to an xml file or xml as a 'string'.\n\n Alternative initialization by giving dom 'node' ment to be used only\n internally. 'path' may actually also be an already opened file object\n (or anything accepted by ElementTree.parse).\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99849:Assign_L27_C8", "label": "node = get_root()", "type": "assigned_variable", "loc": [27, 27], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99849:FunctionDef_L20_C4", "vector": [14, 2, 0.2571, 0.0095, 2, 0.21, 0.1667, 772, 3, 3, 0, 0, 534, 10, 1], "semantic": {"name": "node", "arg_names": [], "import_names": [], "rhs_call_name": "get_root", "annotation": ""}, "snippet": " node = etreewrapper.get_root(path, string, node)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99849:Assign_L28_C8", "label": "self.source =", "type": "assigned_variable", "loc": [28, 28], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99849:FunctionDef_L20_C4", "vector": [14, 2, 0.2667, 0.0095, 2, 0.21, 0.3333, 848, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.source", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.source = path"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99849:Assign_L29_C8", "label": "self.name =", "type": "assigned_variable", "loc": [29, 29], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99849:FunctionDef_L20_C4", "vector": [14, 2, 0.2762, 0.0095, 2, 0.21, 0.5, 689, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.name = node.tag"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99849:Assign_L30_C8", "label": "self.attrs = dict()", "type": "assigned_variable", "loc": [30, 30], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99849:FunctionDef_L20_C4", "vector": [14, 2, 0.2857, 0.0095, 2, 0.21, 0.6667, 793, 3, 1, 0, 0, 827, 10, 2], "semantic": {"name": "self.attrs", "arg_names": [], "import_names": [], "rhs_call_name": "dict", "annotation": ""}, "snippet": " self.attrs = dict(node.items())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99849:Assign_L31_C8", "label": "self.text =", "type": "assigned_variable", "loc": [31, 31], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99849:FunctionDef_L20_C4", "vector": [14, 2, 0.2952, 0.0095, 2, 0.21, 0.8333, 320, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.text", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.text = node.text or ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99849:Assign_L32_C8", "label": "self.children =", "type": "assigned_variable", "loc": [32, 32], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99849:FunctionDef_L20_C4", "vector": [14, 2, 0.3048, 0.0095, 2, 0.21, 1.0, 278, 5, 0, 0, 0, 0, 0, 2], "semantic": {"name": "self.children", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.children = [DomWrapper(path, node=child) for child in list(node)]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99849:FunctionDef_L34_C4", "label": "get_nodes", "type": "function", "loc": [34, 48], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99849:ClassDef_L18_C0", "vector": [2, 1, 0.3905, 0.1429, 1, 0.84, 0.1429, 129, 0, 2, 1, 0, 0, 0, 4], "semantic": {"name": "get_nodes", "arg_names": ["self", "path"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_nodes(self, path):\n \"\"\"Returns a list of descendants matching given 'path'.\n\n Path must be a string in format 'child_name/grandchild_name/etc'. No\n slash is allowed at the beginning or end of the path string. Returns an\n empty list if no matching descendants found and raises AttributeError\n if path is invalid.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99849:Expr_L35_C8", "label": "expression", "type": "expression", "loc": [35, 41], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99849:FunctionDef_L34_C4", "vector": [8, 2, 0.3619, 0.0667, 2, 0.82, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Returns a list of descendants matching given 'path'.\n\n Path must be a string in format 'child_name/grandchild_name/etc'. No\n slash is allowed at the beginning or end of the path string. Returns an\n empty list if no matching descendants found and raises AttributeError\n if path is invalid.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99849:If_L42_C8", "label": "if", "type": "if", "loc": [42, 44], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99849:FunctionDef_L34_C4", "vector": [4, 2, 0.4095, 0.0286, 2, 0.82, 0.25, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not isinstance(path, basestring) \\\n or path == '' or path[0] == '/' or path[-1] == '/':\n raise AttributeError(\"Invalid path '%s'\" % path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99849:Assign_L45_C8", "label": "matches =", "type": "assigned_variable", "loc": [45, 45], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99849:FunctionDef_L34_C4", "vector": [14, 2, 0.4286, 0.0095, 2, 0.82, 0.5, 684, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "matches", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " matches = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99849:For_L46_C8", "label": "for child", "type": "for", "loc": [46, 47], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99849:FunctionDef_L34_C4", "vector": [6, 2, 0.4429, 0.019, 2, 0.82, 0.75, 967, 7, 0, 0, 0, 0, 0, 2], "semantic": {"name": "child", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for child in self.children:\n matches += child._get_matching_elements(path.split('/'))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99849:Return_L48_C8", "label": "return", "type": "return", "loc": [48, 48], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99849:FunctionDef_L34_C4", "vector": [13, 2, 0.4571, 0.0095, 2, 0.82, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return matches"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99849:FunctionDef_L50_C4", "label": "_get_matching_elements", "type": "function", "loc": [50, 59], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99849:ClassDef_L18_C0", "vector": [2, 1, 0.519, 0.0952, 1, 0.84, 0.2857, 650, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "_get_matching_elements", "arg_names": ["self", "tokens"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _get_matching_elements(self, tokens):\n if self.name != tokens[0]:\n return []\n elif len(tokens) == 1:\n return [self]\n else:\n matches = []\n for child in self.children:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99849:If_L51_C8", "label": "if", "type": "if", "loc": [51, 59], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99849:FunctionDef_L50_C4", "vector": [4, 2, 0.5238, 0.0857, 2, 0.49, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.name != tokens[0]:\n return []\n elif len(tokens) == 1:\n return [self]\n else:\n matches = []\n for child in self.children:\n matches += child._get_matching_elements(tokens[1:])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99849:Return_L52_C12", "label": "return", "type": "return", "loc": [52, 52], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99849:If_L51_C8", "vector": [13, 3, 0.4952, 0.0095, 3, 0.48, 0.0, 0, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99849:If_L53_C8", "label": "if", "type": "if", "loc": [53, 59], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99849:If_L51_C8", "vector": [4, 3, 0.5333, 0.0667, 3, 0.48, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif len(tokens) == 1:\n return [self]\n else:\n matches = []\n for child in self.children:\n matches += child._get_matching_elements(tokens[1:])\n return matches"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99849:Return_L54_C12", "label": "return", "type": "return", "loc": [54, 54], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99849:If_L53_C8", "vector": [13, 4, 0.5143, 0.0095, 4, 0.61, 0.0, 0, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return [self]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99849:Assign_L56_C12", "label": "matches =", "type": "assigned_variable", "loc": [56, 56], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99849:If_L53_C8", "vector": [14, 4, 0.5333, 0.0095, 4, 0.61, 0.3333, 684, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "matches", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " matches = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99849:For_L57_C12", "label": "for child", "type": "for", "loc": [57, 58], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99849:If_L53_C8", "vector": [6, 4, 0.5476, 0.019, 4, 0.61, 0.6667, 967, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "child", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for child in self.children:\n matches += child._get_matching_elements(tokens[1:])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99849:Return_L59_C12", "label": "return", "type": "return", "loc": [59, 59], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99849:If_L53_C8", "vector": [13, 4, 0.5619, 0.0095, 4, 0.61, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return matches"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99849:FunctionDef_L61_C4", "label": "get_node", "type": "function", "loc": [61, 72], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99849:ClassDef_L18_C0", "vector": [2, 1, 0.6333, 0.1143, 1, 0.84, 0.4286, 37, 0, 2, 1, 0, 0, 0, 5], "semantic": {"name": "get_node", "arg_names": ["self", "path"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_node(self, path):\n \"\"\"Similar as get_nodes but checks that exactly one node is found.\n\n Node is returned as is (i.e. not in a list) and AttributeError risen if\n no match or more than one match found.\n \"\"\"\n nodes = self.get_nodes(path)\n if len(nodes) == 0:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99849:Expr_L62_C8", "label": "expression", "type": "expression", "loc": [62, 66], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99849:FunctionDef_L61_C4", "vector": [8, 2, 0.6095, 0.0476, 2, 0.43, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Similar as get_nodes but checks that exactly one node is found.\n\n Node is returned as is (i.e. not in a list) and AttributeError risen if\n no match or more than one match found.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99849:Assign_L67_C8", "label": "nodes = get_nodes()", "type": "assigned_variable", "loc": [67, 67], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99849:FunctionDef_L61_C4", "vector": [14, 2, 0.6381, 0.0095, 2, 0.43, 0.25, 696, 3, 1, 0, 0, 129, 10, 1], "semantic": {"name": "nodes", "arg_names": [], "import_names": [], "rhs_call_name": "get_nodes", "annotation": ""}, "snippet": " nodes = self.get_nodes(path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99849:If_L68_C8", "label": "if", "type": "if", "loc": [68, 69], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99849:FunctionDef_L61_C4", "vector": [4, 2, 0.6524, 0.019, 2, 0.43, 0.5, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(nodes) == 0:\n raise AttributeError(\"No nodes matching path '%s' found\" % path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99849:If_L70_C8", "label": "if", "type": "if", "loc": [70, 71], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99849:FunctionDef_L61_C4", "vector": [4, 2, 0.6714, 0.019, 2, 0.43, 0.75, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(nodes) > 1:\n raise AttributeError(\"Multiple nodes matching path '%s' found\" % path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99849:Return_L72_C8", "label": "return", "type": "return", "loc": [72, 72], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99849:FunctionDef_L61_C4", "vector": [13, 2, 0.6857, 0.0095, 2, 0.43, 1.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return nodes[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99849:FunctionDef_L74_C4", "label": "get_attr", "type": "function", "loc": [74, 83], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99849:ClassDef_L18_C0", "vector": [2, 1, 0.7476, 0.0952, 1, 0.84, 0.5714, 244, 0, 3, 1, 0, 0, 0, 2], "semantic": {"name": "get_attr", "arg_names": ["self", "name", "default"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_attr(self, name, default=None):\n \"\"\"Helper for getting node's attributes.\n\n Otherwise equivalent to 'node.attrs.get(name, default)' but raises\n an AttributeError if no value found and no default given.\n \"\"\"\n ret = self.attrs.get(name, default)\n if ret is None:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99849:Expr_L75_C8", "label": "expression", "type": "expression", "loc": [75, 79], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99849:FunctionDef_L74_C4", "vector": [8, 2, 0.7333, 0.0476, 2, 0.24, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Helper for getting node's attributes.\n\n Otherwise equivalent to 'node.attrs.get(name, default)' but raises\n an AttributeError if no value found and no default given.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99849:Assign_L80_C8", "label": "ret = get()", "type": "assigned_variable", "loc": [80, 80], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99849:FunctionDef_L74_C4", "vector": [14, 2, 0.7619, 0.0095, 2, 0.24, 0.3333, 501, 3, 2, 0, 0, 607, 10, 1], "semantic": {"name": "ret", "arg_names": [], "import_names": [], "rhs_call_name": "get", "annotation": ""}, "snippet": " ret = self.attrs.get(name, default)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99849:If_L81_C8", "label": "if", "type": "if", "loc": [81, 82], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99849:FunctionDef_L74_C4", "vector": [4, 2, 0.7762, 0.019, 2, 0.24, 0.6667, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if ret is None:\n raise AttributeError(\"No attribute '%s' found\" % name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99849:Return_L83_C8", "label": "return", "type": "return", "loc": [83, 83], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99849:FunctionDef_L74_C4", "vector": [13, 2, 0.7905, 0.0095, 2, 0.24, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ret"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99849:FunctionDef_L85_C4", "label": "__getattr__", "type": "function", "loc": [85, 94], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99849:ClassDef_L18_C0", "vector": [2, 1, 0.8524, 0.0952, 1, 0.84, 0.7143, 210, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "__getattr__", "arg_names": ["self", "name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __getattr__(self, name):\n \"\"\"Syntactic sugar for get_nodes (e.g. dom.elem[0].subelem).\n\n Differs from get_nodes so that if not matching nodes are found an\n AttributeError is risen instead of returning an empty list.\n \"\"\"\n nodes = self.get_nodes(name)\n if not nodes:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99849:Expr_L86_C8", "label": "expression", "type": "expression", "loc": [86, 90], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99849:FunctionDef_L85_C4", "vector": [8, 2, 0.8381, 0.0476, 2, 0.22, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Syntactic sugar for get_nodes (e.g. dom.elem[0].subelem).\n\n Differs from get_nodes so that if not matching nodes are found an\n AttributeError is risen instead of returning an empty list.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99849:Assign_L91_C8", "label": "nodes = get_nodes()", "type": "assigned_variable", "loc": [91, 91], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99849:FunctionDef_L85_C4", "vector": [14, 2, 0.8667, 0.0095, 2, 0.22, 0.3333, 696, 3, 1, 0, 0, 129, 10, 1], "semantic": {"name": "nodes", "arg_names": [], "import_names": [], "rhs_call_name": "get_nodes", "annotation": ""}, "snippet": " nodes = self.get_nodes(name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99849:If_L92_C8", "label": "if", "type": "if", "loc": [92, 93], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99849:FunctionDef_L85_C4", "vector": [4, 2, 0.881, 0.019, 2, 0.22, 0.6667, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not nodes:\n raise AttributeError(\"No nodes matching path '%s' found\" % name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99849:Return_L94_C8", "label": "return", "type": "return", "loc": [94, 94], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99849:FunctionDef_L85_C4", "vector": [13, 2, 0.8952, 0.0095, 2, 0.22, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return nodes"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99849:FunctionDef_L96_C4", "label": "__getitem__", "type": "function", "loc": [96, 101], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99849:ClassDef_L18_C0", "vector": [2, 1, 0.9381, 0.0571, 1, 0.84, 0.8571, 698, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "__getitem__", "arg_names": ["self", "name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __getitem__(self, name):\n \"\"\"Syntactic sugar for get_node (e.g. dom['elem/subelem'])\"\"\"\n try:\n return self.get_node(name)\n except AttributeError:\n raise IndexError(\"No node '%s' found\" % name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99849:Expr_L97_C8", "label": "expression", "type": "expression", "loc": [97, 97], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99849:FunctionDef_L96_C4", "vector": [8, 2, 0.9238, 0.0095, 2, 0.13, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Syntactic sugar for get_node (e.g. dom['elem/subelem'])\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99849:Try_L98_C8", "label": "try", "type": "try", "loc": [98, 101], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99849:FunctionDef_L96_C4", "vector": [7, 2, 0.9476, 0.0381, 2, 0.13, 1.0, 0, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n return self.get_node(name)\n except AttributeError:\n raise IndexError(\"No node '%s' found\" % name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99849:Return_L99_C12", "label": "return", "type": "return", "loc": [99, 99], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99849:Try_L98_C8", "vector": [13, 3, 0.9429, 0.0095, 3, 0.6, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.get_node(name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99849:FunctionDef_L103_C4", "label": "__repr__", "type": "function", "loc": [103, 105], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99849:ClassDef_L18_C0", "vector": [2, 1, 0.9905, 0.0286, 1, 0.84, 1.0, 204, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "__repr__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __repr__(self):\n \"\"\"Return node name. Mainly for debugging purposes.\"\"\"\n return self.name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99849:Expr_L104_C8", "label": "expression", "type": "expression", "loc": [104, 104], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99849:FunctionDef_L103_C4", "vector": [8, 2, 0.9905, 0.0095, 2, 0.89, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Return node name. Mainly for debugging purposes.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99849:Return_L105_C8", "label": "return", "type": "return", "loc": [105, 105], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99849:FunctionDef_L103_C4", "vector": [13, 2, 1.0, 0.0095, 2, 0.89, 1.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.name"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99849:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99849:FunctionDef_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99849:FunctionDef_L20_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99849:Expr_L21_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99849:FunctionDef_L20_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99849:Assign_L27_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99849:FunctionDef_L20_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99849:Assign_L28_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99849:FunctionDef_L20_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99849:Assign_L29_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99849:FunctionDef_L20_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99849:Assign_L30_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99849:FunctionDef_L20_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99849:Assign_L31_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99849:FunctionDef_L20_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99849:Assign_L32_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99849:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99849:FunctionDef_L34_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99849:FunctionDef_L34_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99849:Expr_L35_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99849:FunctionDef_L34_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99849:If_L42_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99849:FunctionDef_L34_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99849:Assign_L45_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99849:FunctionDef_L34_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99849:For_L46_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99849:FunctionDef_L34_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99849:Return_L48_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99849:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99849:FunctionDef_L50_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99849:FunctionDef_L50_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99849:If_L51_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99849:If_L51_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99849:Return_L52_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99849:If_L51_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99849:If_L53_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99849:If_L53_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99849:Return_L54_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99849:If_L53_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99849:Assign_L56_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99849:If_L53_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99849:For_L57_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99849:If_L53_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99849:Return_L59_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99849:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99849:FunctionDef_L61_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99849:FunctionDef_L61_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99849:Expr_L62_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99849:FunctionDef_L61_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99849:Assign_L67_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99849:FunctionDef_L61_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99849:If_L68_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99849:FunctionDef_L61_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99849:If_L70_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99849:FunctionDef_L61_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99849:Return_L72_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99849:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99849:FunctionDef_L74_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99849:FunctionDef_L74_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99849:Expr_L75_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99849:FunctionDef_L74_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99849:Assign_L80_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99849:FunctionDef_L74_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99849:If_L81_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99849:FunctionDef_L74_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99849:Return_L83_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99849:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99849:FunctionDef_L85_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99849:FunctionDef_L85_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99849:Expr_L86_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99849:FunctionDef_L85_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99849:Assign_L91_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99849:FunctionDef_L85_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99849:If_L92_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99849:FunctionDef_L85_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99849:Return_L94_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99849:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99849:FunctionDef_L96_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99849:FunctionDef_L96_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99849:Expr_L97_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99849:FunctionDef_L96_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99849:Try_L98_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99849:Try_L98_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99849:Return_L99_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99849:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99849:FunctionDef_L103_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99849:FunctionDef_L103_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99849:Expr_L104_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99849:FunctionDef_L103_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99849:Return_L105_C8"}] |
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from unic import unic
def printable_name(string, code_style=False):
"""Generates and returns printable name from the given string.
Examples:
'simple' -> 'Simple'
'name with spaces' -> 'Name With Spaces'
'more spaces' -> 'More Spaces'
'Cases AND spaces' -> 'Cases AND Spaces'
'' -> ''
If 'code_style' is True:
'mixedCAPSCamel' -> 'Mixed CAPS Camel'
'camelCaseName' -> 'Camel Case Name'
'under_score_name' -> 'Under Score Name'
'under_and space' -> 'Under And Space'
'miXed_CAPS_nAMe' -> 'MiXed CAPS NAMe'
'' -> ''
"""
if code_style:
string = string.replace('_', ' ')
parts = string.split()
if len(parts) == 0:
return ''
elif len(parts) == 1 and code_style:
parts = _splitCamelCaseString(parts[0])
parts = [ part[0].upper() + part[1:] for part in parts if part != '' ]
return ' '.join(parts)
def _splitCamelCaseString(string):
parts = []
current_part = []
string = ' ' + string + ' ' # extra spaces make going through string easier
for i in range(1, len(string)-1):
# on 1st/last round prev/next is ' ' and char is 1st/last real char
prev, char, next = string[i-1:i+2]
if _isWordBoundary(prev, char, next):
parts.append(''.join(current_part))
current_part = [ char ]
else:
current_part.append(char)
parts.append(''.join(current_part)) # append last part
return parts
def _isWordBoundary(prev, char, next):
if char.isupper():
return (prev.islower() or next.islower()) and prev.isalnum()
if char.isdigit():
return prev.isalpha()
return prev.isdigit()
def plural_or_not(item):
count = item if isinstance(item, (int, long)) else len(item)
return '' if count == 1 else 's'
def seq2str(sequence, quote="'", sep=', ', lastsep=' and '):
"""Returns sequence in format 'item 1', 'item 2' and 'item 3'"""
quote_elem = lambda string: quote + unic(string) + quote
if len(sequence) == 0:
return ''
if len(sequence) == 1:
return quote_elem(sequence[0])
elems = [quote_elem(s) for s in sequence[:-2]]
elems.append(quote_elem(sequence[-2]) + lastsep + quote_elem(sequence[-1]))
return sep.join(elems)
def seq2str2(sequence):
"""Returns sequence in format [ item 1 | item 2 | ... ] """
if not sequence:
return '[ ]'
return '[ %s ]' % ' | '.join(unic(item) for item in sequence)
| ajibawa-2023/Python-Code-Large/train/row_99851 | 48 | 93 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99851:ImportFrom_L15_C0", "label": "from unic import unic", "type": "import", "loc": [15, 15], "level": 0, "parent": null, "vector": [1, 0, 0.1613, 0.0108, 0, 0.66, 0.0, 992, 0, 1, 0, 0, 992, 0, 0], "semantic": {"name": "unic", "arg_names": [], "import_names": ["unic"], "rhs_call_name": "", "annotation": ""}, "snippet": "from unic import unic"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99851:FunctionDef_L18_C0", "label": "printable_name", "type": "function", "loc": [18, 45], "level": 0, "parent": null, "vector": [2, 0, 0.3387, 0.3011, 0, 0.66, 0.1667, 934, 0, 2, 1, 0, 0, 0, 7], "semantic": {"name": "printable_name", "arg_names": ["string", "code_style"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def printable_name(string, code_style=False):\n \"\"\"Generates and returns printable name from the given string.\n\n Examples:\n 'simple' -> 'Simple'\n 'name with spaces' -> 'Name With Spaces'\n 'more spaces' -> 'More Spaces'\n 'Cases AND spaces' -> 'Cases AND Spaces'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99851:Expr_L19_C4", "label": "expression", "type": "expression", "loc": [19, 36], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99851:FunctionDef_L18_C0", "vector": [8, 1, 0.2957, 0.1935, 1, 0.84, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Generates and returns printable name from the given string.\n\n Examples:\n 'simple' -> 'Simple'\n 'name with spaces' -> 'Name With Spaces'\n 'more spaces' -> 'More Spaces'\n 'Cases AND spaces' -> 'Cases AND Spaces'\n '' -> ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99851:If_L37_C4", "label": "if", "type": "if", "loc": [37, 38], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99851:FunctionDef_L18_C0", "vector": [4, 1, 0.4032, 0.0215, 1, 0.84, 0.2, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if code_style:\n string = string.replace('_', ' ')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99851:Assign_L38_C8", "label": "string = replace()", "type": "assigned_variable", "loc": [38, 38], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99851:If_L37_C4", "vector": [14, 2, 0.4086, 0.0108, 2, 0.72, 0.0, 890, 3, 2, 0, 0, 293, 10, 1], "semantic": {"name": "string", "arg_names": [], "import_names": [], "rhs_call_name": "replace", "annotation": ""}, "snippet": " string = string.replace('_', ' ')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99851:Assign_L39_C4", "label": "parts = split()", "type": "assigned_variable", "loc": [39, 39], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99851:FunctionDef_L18_C0", "vector": [14, 1, 0.4194, 0.0108, 1, 0.84, 0.4, 13, 3, 0, 0, 0, 908, 10, 1], "semantic": {"name": "parts", "arg_names": [], "import_names": [], "rhs_call_name": "split", "annotation": ""}, "snippet": " parts = string.split()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99851:If_L40_C4", "label": "if", "type": "if", "loc": [40, 43], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99851:FunctionDef_L18_C0", "vector": [4, 1, 0.4462, 0.043, 1, 0.84, 0.6, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(parts) == 0:\n return ''\n elif len(parts) == 1 and code_style:\n parts = _splitCamelCaseString(parts[0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99851:Return_L41_C8", "label": "return", "type": "return", "loc": [41, 41], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99851:If_L40_C4", "vector": [13, 2, 0.4409, 0.0108, 2, 0.02, 0.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99851:If_L42_C4", "label": "if", "type": "if", "loc": [42, 43], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99851:If_L40_C4", "vector": [4, 2, 0.457, 0.0215, 2, 0.02, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif len(parts) == 1 and code_style:\n parts = _splitCamelCaseString(parts[0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99851:Assign_L43_C8", "label": "parts = _splitCamelCaseString()", "type": "assigned_variable", "loc": [43, 43], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99851:If_L42_C4", "vector": [14, 3, 0.4624, 0.0108, 3, 0.83, 0.0, 13, 3, 1, 0, 0, 174, 10, 1], "semantic": {"name": "parts", "arg_names": [], "import_names": [], "rhs_call_name": "_splitCamelCaseString", "annotation": ""}, "snippet": " parts = _splitCamelCaseString(parts[0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99851:Assign_L44_C4", "label": "parts =", "type": "assigned_variable", "loc": [44, 44], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99851:FunctionDef_L18_C0", "vector": [14, 1, 0.4731, 0.0108, 1, 0.84, 0.8, 13, 5, 0, 0, 0, 0, 0, 1], "semantic": {"name": "parts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " parts = [ part[0].upper() + part[1:] for part in parts if part != '' ]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99851:Return_L45_C4", "label": "return", "type": "return", "loc": [45, 45], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99851:FunctionDef_L18_C0", "vector": [13, 1, 0.4839, 0.0108, 1, 0.84, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ' '.join(parts)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99851:FunctionDef_L48_C0", "label": "_splitCamelCaseString", "type": "function", "loc": [48, 61], "level": 0, "parent": null, "vector": [2, 0, 0.586, 0.1505, 0, 0.66, 0.3333, 174, 0, 1, 1, 0, 0, 0, 8], "semantic": {"name": "_splitCamelCaseString", "arg_names": ["string"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def _splitCamelCaseString(string):\n parts = []\n current_part = []\n string = ' ' + string + ' ' # extra spaces make going through string easier\n for i in range(1, len(string)-1):\n # on 1st/last round prev/next is ' ' and char is 1st/last real char\n prev, char, next = string[i-1:i+2]\n if _isWordBoundary(prev, char, next):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99851:Assign_L49_C4", "label": "parts =", "type": "assigned_variable", "loc": [49, 49], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99851:FunctionDef_L48_C0", "vector": [14, 1, 0.5269, 0.0108, 1, 0.07, 0.0, 13, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "parts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " parts = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99851:Assign_L50_C4", "label": "current_part =", "type": "assigned_variable", "loc": [50, 50], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99851:FunctionDef_L48_C0", "vector": [14, 1, 0.5376, 0.0108, 1, 0.07, 0.2, 67, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "current_part", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " current_part = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99851:Assign_L51_C4", "label": "string =", "type": "assigned_variable", "loc": [51, 51], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99851:FunctionDef_L48_C0", "vector": [14, 1, 0.5484, 0.0108, 1, 0.07, 0.4, 890, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "string", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " string = ' ' + string + ' ' # extra spaces make going through string easier"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99851:For_L52_C4", "label": "for i", "type": "for", "loc": [52, 59], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99851:FunctionDef_L48_C0", "vector": [6, 1, 0.5968, 0.086, 1, 0.07, 0.6, 826, 3, 0, 0, 0, 0, 0, 6], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in range(1, len(string)-1):\n # on 1st/last round prev/next is ' ' and char is 1st/last real char\n prev, char, next = string[i-1:i+2]\n if _isWordBoundary(prev, char, next):\n parts.append(''.join(current_part))\n current_part = [ char ]\n else:\n current_part.append(char)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99851:Assign_L54_C8", "label": "prev, char, next =", "type": "assigned_variable", "loc": [54, 54], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99851:For_L52_C4", "vector": [14, 2, 0.5806, 0.0108, 2, 0.66, 0.0, 801, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "prev, char, next", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " prev, char, next = string[i-1:i+2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99851:If_L55_C8", "label": "if", "type": "if", "loc": [55, 59], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99851:For_L52_C4", "vector": [4, 2, 0.6129, 0.0538, 2, 0.66, 1.0, 0, 3, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if _isWordBoundary(prev, char, next):\n parts.append(''.join(current_part))\n current_part = [ char ]\n else:\n current_part.append(char)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99851:Expr_L56_C12", "label": "append()", "type": "expression", "loc": [56, 56], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99851:If_L55_C8", "vector": [8, 3, 0.6022, 0.0108, 3, 0.76, 0.0, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " parts.append(''.join(current_part))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99851:Assign_L57_C12", "label": "current_part =", "type": "assigned_variable", "loc": [57, 57], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99851:If_L55_C8", "vector": [14, 3, 0.6129, 0.0108, 3, 0.76, 0.5, 67, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "current_part", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " current_part = [ char ]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99851:Expr_L59_C12", "label": "append()", "type": "expression", "loc": [59, 59], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99851:If_L55_C8", "vector": [8, 3, 0.6344, 0.0108, 3, 0.76, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " current_part.append(char)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99851:Expr_L60_C4", "label": "append()", "type": "expression", "loc": [60, 60], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99851:FunctionDef_L48_C0", "vector": [8, 1, 0.6452, 0.0108, 1, 0.07, 0.8, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " parts.append(''.join(current_part)) # append last part"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99851:Return_L61_C4", "label": "return", "type": "return", "loc": [61, 61], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99851:FunctionDef_L48_C0", "vector": [13, 1, 0.6559, 0.0108, 1, 0.07, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return parts"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99851:FunctionDef_L64_C0", "label": "_isWordBoundary", "type": "function", "loc": [64, 69], "level": 0, "parent": null, "vector": [2, 0, 0.7151, 0.0645, 0, 0.66, 0.5, 748, 0, 3, 1, 0, 0, 0, 7], "semantic": {"name": "_isWordBoundary", "arg_names": ["prev", "char", "next"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def _isWordBoundary(prev, char, next):\n if char.isupper():\n return (prev.islower() or next.islower()) and prev.isalnum()\n if char.isdigit():\n return prev.isalpha()\n return prev.isdigit()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99851:If_L65_C4", "label": "if", "type": "if", "loc": [65, 66], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99851:FunctionDef_L64_C0", "vector": [4, 1, 0.7043, 0.0215, 1, 0.74, 0.0, 0, 3, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if char.isupper():\n return (prev.islower() or next.islower()) and prev.isalnum()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99851:Return_L66_C8", "label": "return", "type": "return", "loc": [66, 66], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99851:If_L65_C4", "vector": [13, 2, 0.7097, 0.0108, 2, 0.79, 0.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return (prev.islower() or next.islower()) and prev.isalnum()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99851:If_L67_C4", "label": "if", "type": "if", "loc": [67, 68], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99851:FunctionDef_L64_C0", "vector": [4, 1, 0.7258, 0.0215, 1, 0.74, 0.5, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if char.isdigit():\n return prev.isalpha()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99851:Return_L68_C8", "label": "return", "type": "return", "loc": [68, 68], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99851:If_L67_C4", "vector": [13, 2, 0.7312, 0.0108, 2, 0.84, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return prev.isalpha()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99851:Return_L69_C4", "label": "return", "type": "return", "loc": [69, 69], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99851:FunctionDef_L64_C0", "vector": [13, 1, 0.7419, 0.0108, 1, 0.74, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return prev.isdigit()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99851:FunctionDef_L72_C0", "label": "plural_or_not", "type": "function", "loc": [72, 74], "level": 0, "parent": null, "vector": [2, 0, 0.7849, 0.0323, 0, 0.66, 0.6667, 673, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "plural_or_not", "arg_names": ["item"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def plural_or_not(item):\n count = item if isinstance(item, (int, long)) else len(item)\n return '' if count == 1 else 's'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99851:Assign_L73_C4", "label": "count =", "type": "assigned_variable", "loc": [73, 73], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99851:FunctionDef_L72_C0", "vector": [14, 1, 0.7849, 0.0108, 1, 0.26, 0.0, 778, 8, 0, 0, 0, 0, 0, 2], "semantic": {"name": "count", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " count = item if isinstance(item, (int, long)) else len(item)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99851:Return_L74_C4", "label": "return", "type": "return", "loc": [74, 74], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99851:FunctionDef_L72_C0", "vector": [13, 1, 0.7957, 0.0108, 1, 0.26, 1.0, 0, 8, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return '' if count == 1 else 's'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99851:FunctionDef_L77_C0", "label": "seq2str", "type": "function", "loc": [77, 86], "level": 0, "parent": null, "vector": [2, 0, 0.8763, 0.1075, 0, 0.66, 0.8333, 58, 0, 4, 1, 0, 0, 0, 9], "semantic": {"name": "seq2str", "arg_names": ["sequence", "quote", "sep", "lastsep"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def seq2str(sequence, quote=\"'\", sep=', ', lastsep=' and '):\n \"\"\"Returns sequence in format 'item 1', 'item 2' and 'item 3'\"\"\"\n quote_elem = lambda string: quote + unic(string) + quote\n if len(sequence) == 0:\n return ''\n if len(sequence) == 1:\n return quote_elem(sequence[0])\n elems = [quote_elem(s) for s in sequence[:-2]]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99851:Expr_L78_C4", "label": "expression", "type": "expression", "loc": [78, 78], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99851:FunctionDef_L77_C0", "vector": [8, 1, 0.8387, 0.0108, 1, 0.0, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Returns sequence in format 'item 1', 'item 2' and 'item 3'\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99851:Assign_L79_C4", "label": "quote_elem =", "type": "assigned_variable", "loc": [79, 79], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99851:FunctionDef_L77_C0", "vector": [14, 1, 0.8495, 0.0108, 1, 0.0, 0.1667, 880, 9, 0, 0, 0, 0, 0, 1], "semantic": {"name": "quote_elem", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " quote_elem = lambda string: quote + unic(string) + quote"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99851:If_L80_C4", "label": "if", "type": "if", "loc": [80, 81], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99851:FunctionDef_L77_C0", "vector": [4, 1, 0.8656, 0.0215, 1, 0.0, 0.3333, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(sequence) == 0:\n return ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99851:Return_L81_C8", "label": "return", "type": "return", "loc": [81, 81], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99851:If_L80_C4", "vector": [13, 2, 0.871, 0.0108, 2, 0.1, 0.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99851:If_L82_C4", "label": "if", "type": "if", "loc": [82, 83], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99851:FunctionDef_L77_C0", "vector": [4, 1, 0.8871, 0.0215, 1, 0.0, 0.5, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(sequence) == 1:\n return quote_elem(sequence[0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99851:Return_L83_C8", "label": "return", "type": "return", "loc": [83, 83], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99851:If_L82_C4", "vector": [13, 2, 0.8925, 0.0108, 2, 0.91, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return quote_elem(sequence[0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99851:Assign_L84_C4", "label": "elems =", "type": "assigned_variable", "loc": [84, 84], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99851:FunctionDef_L77_C0", "vector": [14, 1, 0.9032, 0.0108, 1, 0.0, 0.6667, 280, 5, 0, 0, 0, 0, 0, 1], "semantic": {"name": "elems", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elems = [quote_elem(s) for s in sequence[:-2]]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99851:Expr_L85_C4", "label": "append()", "type": "expression", "loc": [85, 85], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99851:FunctionDef_L77_C0", "vector": [8, 1, 0.914, 0.0108, 1, 0.0, 0.8333, 243, 3, 1, 0, 0, 0, 0, 3], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " elems.append(quote_elem(sequence[-2]) + lastsep + quote_elem(sequence[-1]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99851:Return_L86_C4", "label": "return", "type": "return", "loc": [86, 86], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99851:FunctionDef_L77_C0", "vector": [13, 1, 0.9247, 0.0108, 1, 0.0, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return sep.join(elems)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99851:FunctionDef_L89_C0", "label": "seq2str2", "type": "function", "loc": [89, 93], "level": 0, "parent": null, "vector": [2, 0, 0.9785, 0.0538, 0, 0.66, 1.0, 37, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "seq2str2", "arg_names": ["sequence"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def seq2str2(sequence):\n \"\"\"Returns sequence in format [ item 1 | item 2 | ... ] \"\"\"\n if not sequence:\n return '[ ]'\n return '[ %s ]' % ' | '.join(unic(item) for item in sequence)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99851:Expr_L90_C4", "label": "expression", "type": "expression", "loc": [90, 90], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99851:FunctionDef_L89_C0", "vector": [8, 1, 0.9677, 0.0108, 1, 0.64, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Returns sequence in format [ item 1 | item 2 | ... ] \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99851:If_L91_C4", "label": "if", "type": "if", "loc": [91, 92], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99851:FunctionDef_L89_C0", "vector": [4, 1, 0.9839, 0.0215, 1, 0.64, 0.5, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not sequence:\n return '[ ]'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99851:Return_L92_C8", "label": "return", "type": "return", "loc": [92, 92], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99851:If_L91_C4", "vector": [13, 2, 0.9892, 0.0108, 2, 0.54, 0.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return '[ ]'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99851:Return_L93_C4", "label": "return", "type": "return", "loc": [93, 93], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99851:FunctionDef_L89_C0", "vector": [13, 1, 1.0, 0.0108, 1, 0.64, 1.0, 0, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return '[ %s ]' % ' | '.join(unic(item) for item in sequence)"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99851:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99851:Expr_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99851:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99851:If_L37_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99851:If_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99851:Assign_L38_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99851:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99851:Assign_L39_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99851:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99851:If_L40_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99851:If_L40_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99851:Return_L41_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99851:If_L40_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99851:If_L42_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99851:If_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99851:Assign_L43_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99851:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99851:Assign_L44_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99851:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99851:Return_L45_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99851:FunctionDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99851:Assign_L49_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99851:FunctionDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99851:Assign_L50_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99851:FunctionDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99851:Assign_L51_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99851:FunctionDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99851:For_L52_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99851:For_L52_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99851:Assign_L54_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99851:For_L52_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99851:If_L55_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99851:If_L55_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99851:Expr_L56_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99851:If_L55_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99851:Assign_L57_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99851:If_L55_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99851:Expr_L59_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99851:FunctionDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99851:Expr_L60_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99851:FunctionDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99851:Return_L61_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99851:FunctionDef_L64_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99851:If_L65_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99851:If_L65_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99851:Return_L66_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99851:FunctionDef_L64_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99851:If_L67_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99851:If_L67_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99851:Return_L68_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99851:FunctionDef_L64_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99851:Return_L69_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99851:FunctionDef_L72_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99851:Assign_L73_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99851:FunctionDef_L72_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99851:Return_L74_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99851:FunctionDef_L77_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99851:Expr_L78_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99851:FunctionDef_L77_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99851:Assign_L79_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99851:FunctionDef_L77_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99851:If_L80_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99851:If_L80_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99851:Return_L81_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99851:FunctionDef_L77_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99851:If_L82_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99851:If_L82_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99851:Return_L83_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99851:FunctionDef_L77_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99851:Assign_L84_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99851:FunctionDef_L77_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99851:Expr_L85_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99851:FunctionDef_L77_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99851:Return_L86_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99851:FunctionDef_L89_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99851:Expr_L90_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99851:FunctionDef_L89_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99851:If_L91_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99851:If_L91_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99851:Return_L92_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99851:FunctionDef_L89_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99851:Return_L93_C4"}] |
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""A module to handle different character widths on the console.
Some East Asian characters have width of two on console, and combining
characters themselves take no extra space.
See issue 604 [1] for more details. It also contains `generate_wild_chars.py`
script that was originally used to create the East Asian wild character map.
Big thanks for xieyanbo for the script and the original patch.
Note that Python's `unicodedata` module is not used here because importing
it takes several seconds on Jython.
[1] http://code.google.com/p/robotframework/issues/detail?id=604
"""
def get_char_width(char):
char = ord(char)
if _char_in_map(char, _COMBINING_CHARS):
return 0
if _char_in_map(char, _EAST_ASIAN_WILD_CHARS):
return 2
return 1
def _char_in_map(char, map):
for begin, end in map:
if char < begin:
break
if begin <= char <= end:
return True
return False
_COMBINING_CHARS = [(768,879)]
_EAST_ASIAN_WILD_CHARS = [
(888, 889), (896, 899), (909, 909), (1316, 1328), (1368, 1368),
(1416, 1416), (1420, 1424), (1481, 1487), (1516, 1519),
(1526, 1535), (1541, 1541), (1565, 1565), (1631, 1631),
(1867, 1868), (1971, 1983), (2044, 2304), (2363, 2363),
(2383, 2383), (2390, 2391), (2420, 2426), (2436, 2436),
(2446, 2446), (2450, 2450), (2481, 2481), (2484, 2485),
(2491, 2491), (2502, 2502), (2506, 2506), (2512, 2518),
(2521, 2523), (2532, 2533), (2556, 2560), (2571, 2574),
(2578, 2578), (2609, 2609), (2615, 2615), (2619, 2619),
(2627, 2630), (2634, 2634), (2639, 2640), (2643, 2648),
(2655, 2661), (2679, 2688), (2702, 2702), (2729, 2729),
(2740, 2740), (2747, 2747), (2762, 2762), (2767, 2767),
(2770, 2783), (2789, 2789), (2802, 2816), (2829, 2830),
(2834, 2834), (2865, 2865), (2874, 2875), (2886, 2886),
(2890, 2890), (2895, 2901), (2905, 2907), (2916, 2917),
(2931, 2945), (2955, 2957), (2966, 2968), (2973, 2973),
(2977, 2978), (2982, 2983), (2988, 2989), (3003, 3005),
(3012, 3013), (3022, 3023), (3026, 3030), (3033, 3045),
(3068, 3072), (3085, 3085), (3113, 3113), (3130, 3132),
(3145, 3145), (3151, 3156), (3162, 3167), (3173, 3173),
(3185, 3191), (3201, 3201), (3213, 3213), (3241, 3241),
(3258, 3259), (3273, 3273), (3279, 3284), (3288, 3293),
(3300, 3301), (3315, 3329), (3341, 3341), (3369, 3369),
(3387, 3388), (3401, 3401), (3407, 3414), (3417, 3423),
(3429, 3429), (3447, 3448), (3457, 3457), (3479, 3481),
(3516, 3516), (3519, 3519), (3528, 3529), (3532, 3534),
(3543, 3543), (3553, 3569), (3574, 3584), (3644, 3646),
(3677, 3712), (3717, 3718), (3723, 3724), (3727, 3731),
(3744, 3744), (3750, 3750), (3753, 3753), (3770, 3770),
(3775, 3775), (3783, 3783), (3791, 3791), (3803, 3803),
(3807, 3839), (3949, 3952), (3981, 3983), (4029, 4029),
(4053, 4095), (4251, 4253), (4295, 4303), (4350, 4447),
(4516, 4519), (4603, 4607), (4686, 4687), (4697, 4697),
(4703, 4703), (4750, 4751), (4790, 4791), (4801, 4801),
(4807, 4807), (4881, 4881), (4887, 4887), (4956, 4958),
(4990, 4991), (5019, 5023), (5110, 5120), (5752, 5759),
(5790, 5791), (5874, 5887), (5909, 5919), (5944, 5951),
(5973, 5983), (6001, 6001), (6005, 6015), (6111, 6111),
(6123, 6127), (6139, 6143), (6170, 6175), (6265, 6271),
(6316, 6399), (6430, 6431), (6445, 6447), (6461, 6463),
(6466, 6467), (6511, 6511), (6518, 6527), (6571, 6575),
(6603, 6607), (6619, 6621), (6685, 6685), (6689, 6911),
(6989, 6991), (7038, 7039), (7084, 7085), (7099, 7167),
(7225, 7226), (7243, 7244), (7297, 7423), (7656, 7677),
(7959, 7959), (7967, 7967), (8007, 8007), (8015, 8015),
(8026, 8026), (8030, 8030), (8063, 8063), (8133, 8133),
(8149, 8149), (8176, 8177), (8191, 8191), (8294, 8297),
(8307, 8307), (8341, 8351), (8375, 8399), (8434, 8447),
(8529, 8530), (8586, 8591), (9002, 9002), (9193, 9215),
(9256, 9279), (9292, 9311), (9887, 9887), (9918, 9919),
(9925, 9984), (9994, 9995), (10060, 10060), (10067, 10069),
(10079, 10080), (10134, 10135), (10175, 10175), (10189, 10191),
(11086, 11087), (11094, 11263), (11359, 11359), (11390, 11391),
(11500, 11512), (11559, 11567), (11623, 11630), (11633, 11647),
(11672, 11679), (11695, 11695), (11711, 11711), (11727, 11727),
(11743, 11743), (11826, 12350), (12353, 19903), (19969, 42239),
(42541, 42559), (42593, 42593), (42613, 42619), (42649, 42751),
(42894, 43002), (43053, 43071), (43129, 43135), (43206, 43213),
(43227, 43263), (43349, 43358), (43361, 43519), (43576, 43583),
(43599, 43599), (43611, 43611), (43617, 55295), (63745, 64255),
(64264, 64274), (64281, 64284), (64317, 64317), (64322, 64322),
(64434, 64466), (64833, 64847), (64913, 64913), (64969, 65007),
(65023, 65023), (65041, 65055), (65064, 65135), (65277, 65278),
(65281, 65376), (65472, 65473), (65481, 65481), (65489, 65489),
(65497, 65497), (65502, 65511), (65520, 65528), (65535, 65535),
]
| ajibawa-2023/Python-Code-Large/train/row_99852 | 16 | 116 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99852:Expr_L16_C0", "label": "expression", "type": "expression", "loc": [16, 29], "level": 0, "parent": null, "vector": [8, 0, 0.194, 0.1207, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\"\"\"A module to handle different character widths on the console.\n\nSome East Asian characters have width of two on console, and combining\ncharacters themselves take no extra space.\n\nSee issue 604 [1] for more details. It also contains `generate_wild_chars.py`\nscript that was originally used to create the East Asian wild character map.\nBig thanks for xieyanbo for the script and the original patch."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99852:FunctionDef_L31_C0", "label": "get_char_width", "type": "function", "loc": [31, 37], "level": 0, "parent": null, "vector": [2, 0, 0.2931, 0.0603, 0, 0.66, 0.25, 601, 0, 1, 1, 0, 0, 0, 3], "semantic": {"name": "get_char_width", "arg_names": ["char"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def get_char_width(char):\n char = ord(char)\n if _char_in_map(char, _COMBINING_CHARS):\n return 0\n if _char_in_map(char, _EAST_ASIAN_WILD_CHARS):\n return 2\n return 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99852:Assign_L32_C4", "label": "char = ord()", "type": "assigned_variable", "loc": [32, 32], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99852:FunctionDef_L31_C0", "vector": [14, 1, 0.2759, 0.0086, 1, 0.4, 0.0, 272, 3, 1, 0, 0, 171, 10, 1], "semantic": {"name": "char", "arg_names": [], "import_names": [], "rhs_call_name": "ord", "annotation": ""}, "snippet": " char = ord(char)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99852:If_L33_C4", "label": "if", "type": "if", "loc": [33, 34], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99852:FunctionDef_L31_C0", "vector": [4, 1, 0.2888, 0.0172, 1, 0.4, 0.3333, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if _char_in_map(char, _COMBINING_CHARS):\n return 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99852:Return_L34_C8", "label": "return", "type": "return", "loc": [34, 34], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99852:If_L33_C4", "vector": [13, 2, 0.2931, 0.0086, 2, 0.04, 0.0, 0, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99852:If_L35_C4", "label": "if", "type": "if", "loc": [35, 36], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99852:FunctionDef_L31_C0", "vector": [4, 1, 0.306, 0.0172, 1, 0.4, 0.6667, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if _char_in_map(char, _EAST_ASIAN_WILD_CHARS):\n return 2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99852:Return_L36_C8", "label": "return", "type": "return", "loc": [36, 36], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99852:If_L35_C4", "vector": [13, 2, 0.3103, 0.0086, 2, 0.01, 0.0, 0, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99852:Return_L37_C4", "label": "return", "type": "return", "loc": [37, 37], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99852:FunctionDef_L31_C0", "vector": [13, 1, 0.319, 0.0086, 1, 0.4, 1.0, 0, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99852:FunctionDef_L39_C0", "label": "_char_in_map", "type": "function", "loc": [39, 45], "level": 0, "parent": null, "vector": [2, 0, 0.3621, 0.0603, 0, 0.66, 0.5, 791, 0, 2, 1, 0, 0, 0, 0], "semantic": {"name": "_char_in_map", "arg_names": ["char", "map"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def _char_in_map(char, map):\n for begin, end in map:\n if char < begin:\n break\n if begin <= char <= end:\n return True\n return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99852:For_L40_C4", "label": "for begin, end", "type": "for", "loc": [40, 44], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99852:FunctionDef_L39_C0", "vector": [6, 1, 0.3621, 0.0431, 1, 0.47, 0.0, 536, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "begin, end", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for begin, end in map:\n if char < begin:\n break\n if begin <= char <= end:\n return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99852:If_L41_C8", "label": "if", "type": "if", "loc": [41, 42], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99852:For_L40_C4", "vector": [4, 2, 0.3578, 0.0172, 2, 0.43, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if char < begin:\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99852:If_L43_C8", "label": "if", "type": "if", "loc": [43, 44], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99852:For_L40_C4", "vector": [4, 2, 0.375, 0.0172, 2, 0.43, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if begin <= char <= end:\n return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99852:Return_L44_C12", "label": "return", "type": "return", "loc": [44, 44], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99852:If_L43_C8", "vector": [13, 3, 0.3793, 0.0086, 3, 0.68, 0.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99852:Return_L45_C4", "label": "return", "type": "return", "loc": [45, 45], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99852:FunctionDef_L39_C0", "vector": [13, 1, 0.3879, 0.0086, 1, 0.47, 1.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99852:Assign_L48_C0", "label": "_COMBINING_CHARS =", "type": "assigned_variable", "loc": [48, 48], "level": 0, "parent": null, "vector": [14, 0, 0.4138, 0.0086, 0, 0.66, 0.75, 663, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "_COMBINING_CHARS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "_COMBINING_CHARS = [(768,879)]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99852:Assign_L50_C0", "label": "_EAST_ASIAN_WILD_CHARS =", "type": "assigned_variable", "loc": [50, 116], "level": 0, "parent": null, "vector": [14, 0, 0.7155, 0.5776, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "_EAST_ASIAN_WILD_CHARS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "_EAST_ASIAN_WILD_CHARS = [\n (888, 889), (896, 899), (909, 909), (1316, 1328), (1368, 1368),\n (1416, 1416), (1420, 1424), (1481, 1487), (1516, 1519),\n (1526, 1535), (1541, 1541), (1565, 1565), (1631, 1631),\n (1867, 1868), (1971, 1983), (2044, 2304), (2363, 2363),\n (2383, 2383), (2390, 2391), (2420, 2426), (2436, 2436),\n (2446, 2446), (2450, 2450), (2481, 2481), (2484, 2485),\n (2491, 2491), (2502, 2502), (2506, 2506), (2512, 2518),"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99852:FunctionDef_L31_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99852:Assign_L32_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99852:FunctionDef_L31_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99852:If_L33_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99852:If_L33_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99852:Return_L34_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99852:FunctionDef_L31_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99852:If_L35_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99852:If_L35_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99852:Return_L36_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99852:FunctionDef_L31_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99852:Return_L37_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99852:FunctionDef_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99852:For_L40_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99852:For_L40_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99852:If_L41_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99852:For_L40_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99852:If_L43_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99852:If_L43_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99852:Return_L44_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99852:FunctionDef_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99852:Return_L45_C4"}] |
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import sys
# Need different unic implementations for different Pythons because:
# 1) Importing unicodedata module on Jython takes a very long time, and doesn't
# seem to be necessary as Java probably already handles normalization.
# Furthermore, Jython on Java 1.5 doesn't even have unicodedata.normalize.
# 2) IronPython 2.6 doesn't have unicodedata and probably doesn't need it.
# 3) CPython doesn't automatically normalize Unicode strings.
if sys.platform.startswith('java'):
from java.lang import Object, Class
def unic(item, *args):
# http://bugs.jython.org/issue1564
if isinstance(item, Object) and not isinstance(item, Class):
item = item.toString() # http://bugs.jython.org/issue1563
return _unic(item, *args)
elif sys.platform == 'cli':
def unic(item, *args):
return _unic(item, *args)
else:
from unicodedata import normalize
def unic(item, *args):
return normalize('NFC', _unic(item, *args))
def _unic(item, *args):
# Based on a recipe from http://code.activestate.com/recipes/466341
try:
return unicode(item, *args)
except UnicodeError:
try:
ascii_text = str(item).encode('string_escape')
except UnicodeError:
return u"<unrepresentable object '%s'>" % item.__class__.__name__
else:
return unicode(ascii_text)
def safe_repr(item):
try:
return unic(repr(item))
except UnicodeError:
return repr(unic(item))
| ajibawa-2023/Python-Code-Large/train/row_99853 | 24 | 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_99853:Import_L15_C0", "label": "sys import sys", "type": "import", "loc": [15, 15], "level": 0, "parent": null, "vector": [1, 0, 0.25, 0.0167, 0, 0.66, 0.0, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sys"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99853:If_L25_C0", "label": "if", "type": "if", "loc": [25, 40], "level": 0, "parent": null, "vector": [4, 0, 0.5417, 0.2667, 0, 0.66, 0.3333, 0, 3, 0, 0, 0, 0, 0, 8], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if sys.platform.startswith('java'):\n from java.lang import Object, Class\n def unic(item, *args):\n # http://bugs.jython.org/issue1564\n if isinstance(item, Object) and not isinstance(item, Class):\n item = item.toString() # http://bugs.jython.org/issue1563\n return _unic(item, *args)\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99853:ImportFrom_L26_C4", "label": "from java.lang import Object, Class", "type": "import", "loc": [26, 26], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99853:If_L25_C0", "vector": [1, 1, 0.4333, 0.0167, 1, 0.62, 0.0, 100, 0, 2, 0, 0, 100, 0, 0], "semantic": {"name": "java.lang", "arg_names": [], "import_names": ["Object", "Class"], "rhs_call_name": "", "annotation": ""}, "snippet": " from java.lang import Object, Class"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99853:FunctionDef_L27_C4", "label": "unic", "type": "function", "loc": [27, 31], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99853:If_L25_C0", "vector": [2, 1, 0.4833, 0.0833, 1, 0.62, 0.5, 992, 0, 2, 1, 0, 0, 0, 4], "semantic": {"name": "unic", "arg_names": ["item", "args"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def unic(item, *args):\n # http://bugs.jython.org/issue1564\n if isinstance(item, Object) and not isinstance(item, Class):\n item = item.toString() # http://bugs.jython.org/issue1563\n return _unic(item, *args)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99853:If_L29_C8", "label": "if", "type": "if", "loc": [29, 30], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99853:FunctionDef_L27_C4", "vector": [4, 2, 0.4917, 0.0333, 2, 0.21, 0.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if isinstance(item, Object) and not isinstance(item, Class):\n item = item.toString() # http://bugs.jython.org/issue1563"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99853:Assign_L30_C12", "label": "item = toString()", "type": "assigned_variable", "loc": [30, 30], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99853:If_L29_C8", "vector": [14, 3, 0.5, 0.0167, 3, 0.84, 0.0, 434, 3, 0, 0, 0, 661, 10, 1], "semantic": {"name": "item", "arg_names": [], "import_names": [], "rhs_call_name": "toString", "annotation": ""}, "snippet": " item = item.toString() # http://bugs.jython.org/issue1563"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99853:Return_L31_C8", "label": "return", "type": "return", "loc": [31, 31], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99853:FunctionDef_L27_C4", "vector": [13, 2, 0.5167, 0.0167, 2, 0.21, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return _unic(item, *args)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99853:If_L33_C0", "label": "if", "type": "if", "loc": [33, 40], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99853:If_L25_C0", "vector": [4, 1, 0.6083, 0.1333, 1, 0.62, 1.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "elif sys.platform == 'cli':\n def unic(item, *args):\n return _unic(item, *args)\n\nelse:\n from unicodedata import normalize\n def unic(item, *args):\n return normalize('NFC', _unic(item, *args))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99853:FunctionDef_L34_C4", "label": "unic", "type": "function", "loc": [34, 35], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99853:If_L33_C0", "vector": [2, 2, 0.575, 0.0333, 2, 0.81, 0.0, 992, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "unic", "arg_names": ["item", "args"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def unic(item, *args):\n return _unic(item, *args)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99853:Return_L35_C8", "label": "return", "type": "return", "loc": [35, 35], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99853:FunctionDef_L34_C4", "vector": [13, 3, 0.5833, 0.0167, 3, 0.43, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return _unic(item, *args)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99853:ImportFrom_L38_C4", "label": "from unicodedata import normalize", "type": "import", "loc": [38, 38], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99853:If_L33_C0", "vector": [1, 2, 0.6333, 0.0167, 2, 0.81, 0.5, 759, 0, 1, 0, 0, 759, 0, 0], "semantic": {"name": "unicodedata", "arg_names": [], "import_names": ["normalize"], "rhs_call_name": "", "annotation": ""}, "snippet": " from unicodedata import normalize"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99853:FunctionDef_L39_C4", "label": "unic", "type": "function", "loc": [39, 40], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99853:If_L33_C0", "vector": [2, 2, 0.6583, 0.0333, 2, 0.81, 1.0, 992, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "unic", "arg_names": ["item", "args"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def unic(item, *args):\n return normalize('NFC', _unic(item, *args))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99853:Return_L40_C8", "label": "return", "type": "return", "loc": [40, 40], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99853:FunctionDef_L39_C4", "vector": [13, 3, 0.6667, 0.0167, 3, 0.68, 0.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return normalize('NFC', _unic(item, *args))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99853:FunctionDef_L43_C0", "label": "_unic", "type": "function", "loc": [43, 53], "level": 0, "parent": null, "vector": [2, 0, 0.8, 0.1833, 0, 0.66, 0.6667, 333, 0, 2, 1, 0, 0, 0, 4], "semantic": {"name": "_unic", "arg_names": ["item", "args"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def _unic(item, *args):\n # Based on a recipe from http://code.activestate.com/recipes/466341\n try:\n return unicode(item, *args)\n except UnicodeError:\n try:\n ascii_text = str(item).encode('string_escape')\n except UnicodeError:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99853:Try_L45_C4", "label": "try", "type": "try", "loc": [45, 53], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99853:FunctionDef_L43_C0", "vector": [7, 1, 0.8167, 0.15, 1, 0.33, 0.0, 0, 0, 1, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n return unicode(item, *args)\n except UnicodeError:\n try:\n ascii_text = str(item).encode('string_escape')\n except UnicodeError:\n return u\"<unrepresentable object '%s'>\" % item.__class__.__name__\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99853:Return_L46_C8", "label": "return", "type": "return", "loc": [46, 46], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99853:Try_L45_C4", "vector": [13, 2, 0.7667, 0.0167, 2, 0.97, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return unicode(item, *args)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99853:Try_L48_C8", "label": "try", "type": "try", "loc": [48, 53], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99853:Try_L45_C4", "vector": [7, 2, 0.8417, 0.1, 2, 0.97, 0.0, 0, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n ascii_text = str(item).encode('string_escape')\n except UnicodeError:\n return u\"<unrepresentable object '%s'>\" % item.__class__.__name__\n else:\n return unicode(ascii_text)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99853:Assign_L49_C12", "label": "ascii_text = encode()", "type": "assigned_variable", "loc": [49, 49], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99853:Try_L48_C8", "vector": [14, 3, 0.8167, 0.0167, 3, 0.9, 0.0, 127, 3, 1, 0, 0, 623, 10, 2], "semantic": {"name": "ascii_text", "arg_names": [], "import_names": [], "rhs_call_name": "encode", "annotation": ""}, "snippet": " ascii_text = str(item).encode('string_escape')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99853:Return_L51_C12", "label": "return", "type": "return", "loc": [51, 51], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99853:Try_L48_C8", "vector": [13, 3, 0.85, 0.0167, 3, 0.9, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return u\"<unrepresentable object '%s'>\" % item.__class__.__name__"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99853:Return_L53_C12", "label": "return", "type": "return", "loc": [53, 53], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99853:Try_L48_C8", "vector": [13, 3, 0.8833, 0.0167, 3, 0.9, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return unicode(ascii_text)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99853:FunctionDef_L56_C0", "label": "safe_repr", "type": "function", "loc": [56, 60], "level": 0, "parent": null, "vector": [2, 0, 0.9667, 0.0833, 0, 0.66, 1.0, 825, 0, 1, 1, 0, 0, 0, 4], "semantic": {"name": "safe_repr", "arg_names": ["item"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def safe_repr(item):\n try:\n return unic(repr(item))\n except UnicodeError:\n return repr(unic(item))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99853:Try_L57_C4", "label": "try", "type": "try", "loc": [57, 60], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99853:FunctionDef_L56_C0", "vector": [7, 1, 0.975, 0.0667, 1, 0.0, 0.0, 0, 0, 1, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n return unic(repr(item))\n except UnicodeError:\n return repr(unic(item))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99853:Return_L58_C8", "label": "return", "type": "return", "loc": [58, 58], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99853:Try_L57_C4", "vector": [13, 2, 0.9667, 0.0167, 2, 0.05, 0.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return unic(repr(item))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99853:Return_L60_C8", "label": "return", "type": "return", "loc": [60, 60], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99853:Try_L57_C4", "vector": [13, 2, 1.0, 0.0167, 2, 0.05, 0.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return repr(unic(item))"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99853:If_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99853:ImportFrom_L26_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99853:If_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99853:FunctionDef_L27_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99853:FunctionDef_L27_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99853:If_L29_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99853:If_L29_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99853:Assign_L30_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99853:FunctionDef_L27_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99853:Return_L31_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99853:If_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99853:If_L33_C0"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99853:If_L33_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99853:FunctionDef_L34_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99853:FunctionDef_L34_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99853:Return_L35_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99853:If_L33_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99853:ImportFrom_L38_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99853:If_L33_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99853:FunctionDef_L39_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99853:FunctionDef_L39_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99853:Return_L40_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99853:FunctionDef_L43_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99853:Try_L45_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99853:Try_L45_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99853:Return_L46_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99853:Try_L45_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99853:Try_L48_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99853:Try_L48_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99853:Assign_L49_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99853:Try_L48_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99853:Return_L51_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99853:Try_L48_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99853:Return_L53_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99853:FunctionDef_L56_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99853:Try_L57_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99853:Try_L57_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99853:Return_L58_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99853:Try_L57_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99853:Return_L60_C8"}] |
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import re
from UserDict import UserDict
_WHITESPACE_REGEXP = re.compile('\s+')
def normalize(string, ignore=[], caseless=True, spaceless=True):
"""Normalizes given string according to given spec.
By default string is turned to lower case and all whitespace is removed.
Additional characters can be removed by giving them in `ignore` list.
"""
if spaceless:
string = _WHITESPACE_REGEXP.sub('', string)
if caseless:
string = string.lower()
ignore = [i.lower() for i in ignore]
for ign in ignore:
string = string.replace(ign, '')
return string
def normalize_tags(tags):
"""Returns tags sorted and duplicates, empty, and NONE removed.
If duplicate tags have different case/space, the one used first wins.
"""
norm = NormalizedDict(((t, 1) for t in tags), ignore=['_'])
for removed in '', 'NONE':
if removed in norm:
norm.pop(removed)
return norm.keys()
class NormalizedDict(UserDict):
"""Custom dictionary implementation automatically normalizing keys."""
def __init__(self, initial=None, ignore=[], caseless=True, spaceless=True):
"""Initializes with possible initial value and normalizing spec.
Initial values can be either a dictionary or an iterable of name/value
pairs. In the latter case items are added in the given order.
Normalizing spec has exact same semantics as with `normalize` method.
"""
UserDict.__init__(self)
self._keys = {}
self._normalize = lambda s: normalize(s, ignore, caseless, spaceless)
if initial:
self._add_initial(initial)
def _add_initial(self, items):
if hasattr(items, 'items'):
items = items.items()
for key, value in items:
self[key] = value
def update(self, dict=None, **kwargs):
if dict:
UserDict.update(self, dict)
for key in dict:
self._add_key(key)
if kwargs:
self.update(kwargs)
def _add_key(self, key):
nkey = self._normalize(key)
self._keys.setdefault(nkey, key)
return nkey
def set(self, key, value):
nkey = self._add_key(key)
self.data[nkey] = value
__setitem__ = set
def get(self, key, default=None):
try:
return self.__getitem__(key)
except KeyError:
return default
def __getitem__(self, key):
return self.data[self._normalize(key)]
def pop(self, key):
nkey = self._normalize(key)
del self._keys[nkey]
return self.data.pop(nkey)
__delitem__ = pop
def has_key(self, key):
return self.data.has_key(self._normalize(key))
__contains__ = has_key
def keys(self):
return [self._keys[nkey] for nkey in sorted(self._keys)]
def __iter__(self):
return iter(self.keys())
def values(self):
return [self[key] for key in self]
def items(self):
return [(key, self[key]) for key in self]
def copy(self):
copy = UserDict.copy(self)
copy._keys = self._keys.copy()
return copy
def __str__(self):
return str(dict(self.items()))
| ajibawa-2023/Python-Code-Large/train/row_99854 | 76 | 131 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99854:Import_L15_C0", "label": "re import re", "type": "import", "loc": [15, 15], "level": 0, "parent": null, "vector": [1, 0, 0.1145, 0.0076, 0, 0.66, 0.0, 540, 0, 1, 0, 0, 540, 0, 0], "semantic": {"name": "re", "arg_names": [], "import_names": ["re"], "rhs_call_name": "", "annotation": ""}, "snippet": "import re"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99854:ImportFrom_L16_C0", "label": "from UserDict import UserDict", "type": "import", "loc": [16, 16], "level": 0, "parent": null, "vector": [1, 0, 0.1221, 0.0076, 0, 0.66, 0.2, 351, 0, 1, 0, 0, 351, 0, 0], "semantic": {"name": "UserDict", "arg_names": [], "import_names": ["UserDict"], "rhs_call_name": "", "annotation": ""}, "snippet": "from UserDict import UserDict"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99854:Assign_L19_C0", "label": "_WHITESPACE_REGEXP = compile()", "type": "assigned_variable", "loc": [19, 19], "level": 0, "parent": null, "vector": [14, 0, 0.145, 0.0076, 0, 0.66, 0.4, 38, 3, 1, 0, 0, 821, 10, 1], "semantic": {"name": "_WHITESPACE_REGEXP", "arg_names": [], "import_names": [], "rhs_call_name": "compile", "annotation": ""}, "snippet": "_WHITESPACE_REGEXP = re.compile('\\s+')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99854:FunctionDef_L22_C0", "label": "normalize", "type": "function", "loc": [22, 35], "level": 0, "parent": null, "vector": [2, 0, 0.2176, 0.1069, 0, 0.66, 0.6, 257, 0, 4, 1, 0, 0, 0, 4], "semantic": {"name": "normalize", "arg_names": ["string", "ignore", "caseless", "spaceless"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def normalize(string, ignore=[], caseless=True, spaceless=True):\n \"\"\"Normalizes given string according to given spec.\n\n By default string is turned to lower case and all whitespace is removed.\n Additional characters can be removed by giving them in `ignore` list.\n \"\"\"\n if spaceless:\n string = _WHITESPACE_REGEXP.sub('', string)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99854:Expr_L23_C4", "label": "expression", "type": "expression", "loc": [23, 27], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99854:FunctionDef_L22_C0", "vector": [8, 1, 0.1908, 0.0382, 1, 0.29, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Normalizes given string according to given spec.\n\n By default string is turned to lower case and all whitespace is removed.\n Additional characters can be removed by giving them in `ignore` list.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99854:If_L28_C4", "label": "if", "type": "if", "loc": [28, 29], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99854:FunctionDef_L22_C0", "vector": [4, 1, 0.2176, 0.0153, 1, 0.29, 0.25, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if spaceless:\n string = _WHITESPACE_REGEXP.sub('', string)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99854:Assign_L29_C8", "label": "string = sub()", "type": "assigned_variable", "loc": [29, 29], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99854:If_L28_C4", "vector": [14, 2, 0.2214, 0.0076, 2, 0.12, 0.0, 890, 3, 2, 0, 0, 819, 10, 1], "semantic": {"name": "string", "arg_names": [], "import_names": [], "rhs_call_name": "sub", "annotation": ""}, "snippet": " string = _WHITESPACE_REGEXP.sub('', string)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99854:If_L30_C4", "label": "if", "type": "if", "loc": [30, 32], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99854:FunctionDef_L22_C0", "vector": [4, 1, 0.2366, 0.0229, 1, 0.29, 0.5, 0, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if caseless:\n string = string.lower()\n ignore = [i.lower() for i in ignore]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99854:Assign_L31_C8", "label": "string = lower()", "type": "assigned_variable", "loc": [31, 31], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99854:If_L30_C4", "vector": [14, 2, 0.2366, 0.0076, 2, 0.31, 0.0, 890, 3, 0, 0, 0, 432, 10, 1], "semantic": {"name": "string", "arg_names": [], "import_names": [], "rhs_call_name": "lower", "annotation": ""}, "snippet": " string = string.lower()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99854:Assign_L32_C8", "label": "ignore =", "type": "assigned_variable", "loc": [32, 32], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99854:If_L30_C4", "vector": [14, 2, 0.2443, 0.0076, 2, 0.31, 1.0, 371, 5, 0, 0, 0, 0, 0, 1], "semantic": {"name": "ignore", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ignore = [i.lower() for i in ignore]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99854:For_L33_C4", "label": "for ign", "type": "for", "loc": [33, 34], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99854:FunctionDef_L22_C0", "vector": [6, 1, 0.2557, 0.0153, 1, 0.29, 0.75, 964, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "ign", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for ign in ignore:\n string = string.replace(ign, '')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99854:Assign_L34_C8", "label": "string = replace()", "type": "assigned_variable", "loc": [34, 34], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99854:For_L33_C4", "vector": [14, 2, 0.2595, 0.0076, 2, 0.08, 0.0, 890, 3, 2, 0, 0, 293, 10, 1], "semantic": {"name": "string", "arg_names": [], "import_names": [], "rhs_call_name": "replace", "annotation": ""}, "snippet": " string = string.replace(ign, '')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99854:Return_L35_C4", "label": "return", "type": "return", "loc": [35, 35], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99854:FunctionDef_L22_C0", "vector": [13, 1, 0.2672, 0.0076, 1, 0.29, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return string"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99854:FunctionDef_L38_C0", "label": "normalize_tags", "type": "function", "loc": [38, 47], "level": 0, "parent": null, "vector": [2, 0, 0.3244, 0.0763, 0, 0.66, 0.8, 625, 0, 1, 1, 0, 0, 0, 3], "semantic": {"name": "normalize_tags", "arg_names": ["tags"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def normalize_tags(tags):\n \"\"\"Returns tags sorted and duplicates, empty, and NONE removed.\n\n If duplicate tags have different case/space, the one used first wins.\n \"\"\"\n norm = NormalizedDict(((t, 1) for t in tags), ignore=['_'])\n for removed in '', 'NONE':\n if removed in norm:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99854:Expr_L39_C4", "label": "expression", "type": "expression", "loc": [39, 42], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99854:FunctionDef_L38_C0", "vector": [8, 1, 0.3092, 0.0305, 1, 0.29, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Returns tags sorted and duplicates, empty, and NONE removed.\n\n If duplicate tags have different case/space, the one used first wins.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99854:Assign_L43_C4", "label": "norm = NormalizedDict()", "type": "assigned_variable", "loc": [43, 43], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99854:FunctionDef_L38_C0", "vector": [14, 1, 0.3282, 0.0076, 1, 0.29, 0.3333, 902, 3, 2, 0, 0, 696, 10, 1], "semantic": {"name": "norm", "arg_names": [], "import_names": [], "rhs_call_name": "NormalizedDict", "annotation": ""}, "snippet": " norm = NormalizedDict(((t, 1) for t in tags), ignore=['_'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99854:For_L44_C4", "label": "for removed", "type": "for", "loc": [44, 46], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99854:FunctionDef_L38_C0", "vector": [6, 1, 0.3435, 0.0229, 1, 0.29, 0.6667, 537, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "removed", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for removed in '', 'NONE':\n if removed in norm:\n norm.pop(removed)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99854:If_L45_C8", "label": "if", "type": "if", "loc": [45, 46], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99854:For_L44_C4", "vector": [4, 2, 0.3473, 0.0153, 2, 0.69, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if removed in norm:\n norm.pop(removed)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99854:Expr_L46_C12", "label": "pop()", "type": "expression", "loc": [46, 46], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99854:If_L45_C8", "vector": [8, 3, 0.3511, 0.0076, 3, 0.93, 0.0, 969, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "pop", "arg_names": [], "import_names": [], "rhs_call_name": "pop", "annotation": ""}, "snippet": " norm.pop(removed)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99854:Return_L47_C4", "label": "return", "type": "return", "loc": [47, 47], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99854:FunctionDef_L38_C0", "vector": [13, 1, 0.3588, 0.0076, 1, 0.29, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return norm.keys()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99854:ClassDef_L50_C0", "label": "NormalizedDict", "type": "class", "loc": [50, 131], "level": 0, "parent": null, "vector": [3, 0, 0.6908, 0.626, 0, 0.66, 1.0, 696, 0, 15, 0, 0, 351, 0, 25], "semantic": {"name": "NormalizedDict", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class NormalizedDict(UserDict):\n \"\"\"Custom dictionary implementation automatically normalizing keys.\"\"\"\n\n def __init__(self, initial=None, ignore=[], caseless=True, spaceless=True):\n \"\"\"Initializes with possible initial value and normalizing spec.\n\n Initial values can be either a dictionary or an iterable of name/value\n pairs. In the latter case items are added in the given order."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99854:Expr_L51_C4", "label": "expression", "type": "expression", "loc": [51, 51], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99854:ClassDef_L50_C0", "vector": [8, 1, 0.3893, 0.0076, 1, 0.8, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Custom dictionary implementation automatically normalizing keys.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99854:FunctionDef_L53_C4", "label": "__init__", "type": "function", "loc": [53, 65], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99854:ClassDef_L50_C0", "vector": [2, 1, 0.4504, 0.0992, 1, 0.8, 0.0556, 555, 0, 5, 0, 0, 0, 0, 3], "semantic": {"name": "__init__", "arg_names": ["self", "initial", "ignore", "caseless", "spaceless"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, initial=None, ignore=[], caseless=True, spaceless=True):\n \"\"\"Initializes with possible initial value and normalizing spec.\n\n Initial values can be either a dictionary or an iterable of name/value\n pairs. In the latter case items are added in the given order.\n\n Normalizing spec has exact same semantics as with `normalize` method.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99854:Expr_L54_C8", "label": "expression", "type": "expression", "loc": [54, 60], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99854:FunctionDef_L53_C4", "vector": [8, 2, 0.4351, 0.0534, 2, 0.96, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Initializes with possible initial value and normalizing spec.\n\n Initial values can be either a dictionary or an iterable of name/value\n pairs. In the latter case items are added in the given order.\n\n Normalizing spec has exact same semantics as with `normalize` method.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99854:Expr_L61_C8", "label": "__init__()", "type": "expression", "loc": [61, 61], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99854:FunctionDef_L53_C4", "vector": [8, 2, 0.4656, 0.0076, 2, 0.96, 0.25, 555, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " UserDict.__init__(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99854:Assign_L62_C8", "label": "self._keys =", "type": "assigned_variable", "loc": [62, 62], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99854:FunctionDef_L53_C4", "vector": [14, 2, 0.4733, 0.0076, 2, 0.96, 0.5, 589, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "self._keys", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._keys = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99854:Assign_L63_C8", "label": "self._normalize =", "type": "assigned_variable", "loc": [63, 63], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99854:FunctionDef_L53_C4", "vector": [14, 2, 0.4809, 0.0076, 2, 0.96, 0.75, 398, 9, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self._normalize", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._normalize = lambda s: normalize(s, ignore, caseless, spaceless)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99854:If_L64_C8", "label": "if", "type": "if", "loc": [64, 65], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99854:FunctionDef_L53_C4", "vector": [4, 2, 0.4924, 0.0153, 2, 0.96, 1.0, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if initial:\n self._add_initial(initial)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99854:Expr_L65_C12", "label": "_add_initial()", "type": "expression", "loc": [65, 65], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99854:If_L64_C8", "vector": [8, 3, 0.4962, 0.0076, 3, 0.94, 0.0, 936, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_add_initial", "arg_names": [], "import_names": [], "rhs_call_name": "_add_initial", "annotation": ""}, "snippet": " self._add_initial(initial)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99854:FunctionDef_L67_C4", "label": "_add_initial", "type": "function", "loc": [67, 71], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99854:ClassDef_L50_C0", "vector": [2, 1, 0.5267, 0.0382, 1, 0.8, 0.1111, 936, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "_add_initial", "arg_names": ["self", "items"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _add_initial(self, items):\n if hasattr(items, 'items'):\n items = items.items()\n for key, value in items:\n self[key] = value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99854:If_L68_C8", "label": "if", "type": "if", "loc": [68, 69], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99854:FunctionDef_L67_C4", "vector": [4, 2, 0.5229, 0.0153, 2, 0.25, 0.0, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if hasattr(items, 'items'):\n items = items.items()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99854:Assign_L69_C12", "label": "items = items()", "type": "assigned_variable", "loc": [69, 69], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99854:If_L68_C8", "vector": [14, 3, 0.5267, 0.0076, 3, 0.26, 0.0, 339, 3, 0, 0, 0, 339, 10, 1], "semantic": {"name": "items", "arg_names": [], "import_names": [], "rhs_call_name": "items", "annotation": ""}, "snippet": " items = items.items()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99854:For_L70_C8", "label": "for key, value", "type": "for", "loc": [70, 71], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99854:FunctionDef_L67_C4", "vector": [6, 2, 0.5382, 0.0153, 2, 0.25, 1.0, 839, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "key, value", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for key, value in items:\n self[key] = value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99854:Assign_L71_C12", "label": "assign", "type": "assigned_variable", "loc": [71, 71], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99854:For_L70_C8", "vector": [14, 3, 0.542, 0.0076, 3, 0.78, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self[key] = value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99854:FunctionDef_L73_C4", "label": "update", "type": "function", "loc": [73, 79], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99854:ClassDef_L50_C0", "vector": [2, 1, 0.5802, 0.0534, 1, 0.8, 0.1667, 637, 0, 3, 0, 0, 0, 0, 3], "semantic": {"name": "update", "arg_names": ["self", "dict", "kwargs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def update(self, dict=None, **kwargs):\n if dict:\n UserDict.update(self, dict)\n for key in dict:\n self._add_key(key)\n if kwargs:\n self.update(kwargs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99854:If_L74_C8", "label": "if", "type": "if", "loc": [74, 77], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99854:FunctionDef_L73_C4", "vector": [4, 2, 0.5763, 0.0305, 2, 0.96, 0.0, 0, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if dict:\n UserDict.update(self, dict)\n for key in dict:\n self._add_key(key)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99854:Expr_L75_C12", "label": "update()", "type": "expression", "loc": [75, 75], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99854:If_L74_C8", "vector": [8, 3, 0.5725, 0.0076, 3, 0.79, 0.0, 637, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "update", "arg_names": [], "import_names": [], "rhs_call_name": "update", "annotation": ""}, "snippet": " UserDict.update(self, dict)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99854:For_L76_C12", "label": "for key", "type": "for", "loc": [76, 77], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99854:If_L74_C8", "vector": [6, 3, 0.584, 0.0153, 3, 0.79, 1.0, 230, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "key", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for key in dict:\n self._add_key(key)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99854:Expr_L77_C16", "label": "_add_key()", "type": "expression", "loc": [77, 77], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99854:For_L76_C12", "vector": [8, 4, 0.5878, 0.0076, 4, 0.37, 0.0, 757, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_add_key", "arg_names": [], "import_names": [], "rhs_call_name": "_add_key", "annotation": ""}, "snippet": " self._add_key(key)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99854:If_L78_C8", "label": "if", "type": "if", "loc": [78, 79], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99854:FunctionDef_L73_C4", "vector": [4, 2, 0.5992, 0.0153, 2, 0.96, 1.0, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if kwargs:\n self.update(kwargs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99854:Expr_L79_C12", "label": "update()", "type": "expression", "loc": [79, 79], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99854:If_L78_C8", "vector": [8, 3, 0.6031, 0.0076, 3, 0.8, 0.0, 637, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "update", "arg_names": [], "import_names": [], "rhs_call_name": "update", "annotation": ""}, "snippet": " self.update(kwargs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99854:FunctionDef_L81_C4", "label": "_add_key", "type": "function", "loc": [81, 84], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99854:ClassDef_L50_C0", "vector": [2, 1, 0.6298, 0.0305, 1, 0.8, 0.2222, 757, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "_add_key", "arg_names": ["self", "key"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _add_key(self, key):\n nkey = self._normalize(key)\n self._keys.setdefault(nkey, key)\n return nkey"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99854:Assign_L82_C8", "label": "nkey = _normalize()", "type": "assigned_variable", "loc": [82, 82], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99854:FunctionDef_L81_C4", "vector": [14, 2, 0.626, 0.0076, 2, 0.4, 0.0, 920, 3, 1, 0, 0, 588, 10, 1], "semantic": {"name": "nkey", "arg_names": [], "import_names": [], "rhs_call_name": "_normalize", "annotation": ""}, "snippet": " nkey = self._normalize(key)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99854:Expr_L83_C8", "label": "setdefault()", "type": "expression", "loc": [83, 83], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99854:FunctionDef_L81_C4", "vector": [8, 2, 0.6336, 0.0076, 2, 0.4, 0.5, 262, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "setdefault", "arg_names": [], "import_names": [], "rhs_call_name": "setdefault", "annotation": ""}, "snippet": " self._keys.setdefault(nkey, key)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99854:Return_L84_C8", "label": "return", "type": "return", "loc": [84, 84], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99854:FunctionDef_L81_C4", "vector": [13, 2, 0.6412, 0.0076, 2, 0.4, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return nkey"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99854:FunctionDef_L86_C4", "label": "set", "type": "function", "loc": [86, 88], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99854:ClassDef_L50_C0", "vector": [2, 1, 0.6641, 0.0229, 1, 0.8, 0.2778, 21, 0, 3, 0, 0, 0, 0, 1], "semantic": {"name": "set", "arg_names": ["self", "key", "value"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def set(self, key, value):\n nkey = self._add_key(key)\n self.data[nkey] = value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99854:Assign_L87_C8", "label": "nkey = _add_key()", "type": "assigned_variable", "loc": [87, 87], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99854:FunctionDef_L86_C4", "vector": [14, 2, 0.6641, 0.0076, 2, 0.2, 0.0, 920, 3, 1, 0, 0, 757, 10, 1], "semantic": {"name": "nkey", "arg_names": [], "import_names": [], "rhs_call_name": "_add_key", "annotation": ""}, "snippet": " nkey = self._add_key(key)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99854:Assign_L88_C8", "label": "assign", "type": "assigned_variable", "loc": [88, 88], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99854:FunctionDef_L86_C4", "vector": [14, 2, 0.6718, 0.0076, 2, 0.2, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.data[nkey] = value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99854:Assign_L90_C4", "label": "__setitem__ =", "type": "assigned_variable", "loc": [90, 90], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99854:ClassDef_L50_C0", "vector": [14, 1, 0.687, 0.0076, 1, 0.8, 0.3333, 343, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "__setitem__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " __setitem__ = set"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99854:FunctionDef_L92_C4", "label": "get", "type": "function", "loc": [92, 96], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99854:ClassDef_L50_C0", "vector": [2, 1, 0.7176, 0.0382, 1, 0.8, 0.3889, 607, 0, 3, 1, 0, 0, 0, 1], "semantic": {"name": "get", "arg_names": ["self", "key", "default"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get(self, key, default=None):\n try:\n return self.__getitem__(key)\n except KeyError:\n return default"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99854:Try_L93_C8", "label": "try", "type": "try", "loc": [93, 96], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99854:FunctionDef_L92_C4", "vector": [7, 2, 0.7214, 0.0305, 2, 0.94, 0.0, 0, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n return self.__getitem__(key)\n except KeyError:\n return default"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99854:Return_L94_C12", "label": "return", "type": "return", "loc": [94, 94], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99854:Try_L93_C8", "vector": [13, 3, 0.7176, 0.0076, 3, 0.29, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.__getitem__(key)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99854:Return_L96_C12", "label": "return", "type": "return", "loc": [96, 96], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99854:Try_L93_C8", "vector": [13, 3, 0.7328, 0.0076, 3, 0.29, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return default"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99854:FunctionDef_L98_C4", "label": "__getitem__", "type": "function", "loc": [98, 99], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99854:ClassDef_L50_C0", "vector": [2, 1, 0.7519, 0.0153, 1, 0.8, 0.4444, 698, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "__getitem__", "arg_names": ["self", "key"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __getitem__(self, key):\n return self.data[self._normalize(key)]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99854:Return_L99_C8", "label": "return", "type": "return", "loc": [99, 99], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99854:FunctionDef_L98_C4", "vector": [13, 2, 0.7557, 0.0076, 2, 0.1, 0.0, 0, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.data[self._normalize(key)]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99854:FunctionDef_L101_C4", "label": "pop", "type": "function", "loc": [101, 104], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99854:ClassDef_L50_C0", "vector": [2, 1, 0.7824, 0.0305, 1, 0.8, 0.5, 969, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "pop", "arg_names": ["self", "key"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def pop(self, key):\n nkey = self._normalize(key)\n del self._keys[nkey]\n return self.data.pop(nkey)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99854:Assign_L102_C8", "label": "nkey = _normalize()", "type": "assigned_variable", "loc": [102, 102], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99854:FunctionDef_L101_C4", "vector": [14, 2, 0.7786, 0.0076, 2, 0.85, 0.0, 920, 3, 1, 0, 0, 588, 10, 1], "semantic": {"name": "nkey", "arg_names": [], "import_names": [], "rhs_call_name": "_normalize", "annotation": ""}, "snippet": " nkey = self._normalize(key)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99854:Return_L104_C8", "label": "return", "type": "return", "loc": [104, 104], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99854:FunctionDef_L101_C4", "vector": [13, 2, 0.7939, 0.0076, 2, 0.85, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.data.pop(nkey)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99854:Assign_L106_C4", "label": "__delitem__ =", "type": "assigned_variable", "loc": [106, 106], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99854:ClassDef_L50_C0", "vector": [14, 1, 0.8092, 0.0076, 1, 0.8, 0.5556, 66, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "__delitem__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " __delitem__ = pop"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99854:FunctionDef_L108_C4", "label": "has_key", "type": "function", "loc": [108, 109], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99854:ClassDef_L50_C0", "vector": [2, 1, 0.8282, 0.0153, 1, 0.8, 0.6111, 882, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "has_key", "arg_names": ["self", "key"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def has_key(self, key):\n return self.data.has_key(self._normalize(key))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99854:Return_L109_C8", "label": "return", "type": "return", "loc": [109, 109], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99854:FunctionDef_L108_C4", "vector": [13, 2, 0.8321, 0.0076, 2, 0.01, 0.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.data.has_key(self._normalize(key))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99854:Assign_L111_C4", "label": "__contains__ =", "type": "assigned_variable", "loc": [111, 111], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99854:ClassDef_L50_C0", "vector": [14, 1, 0.8473, 0.0076, 1, 0.8, 0.6667, 456, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "__contains__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " __contains__ = has_key"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99854:FunctionDef_L113_C4", "label": "keys", "type": "function", "loc": [113, 114], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99854:ClassDef_L50_C0", "vector": [2, 1, 0.8664, 0.0153, 1, 0.8, 0.7222, 204, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "keys", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def keys(self):\n return [self._keys[nkey] for nkey in sorted(self._keys)]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99854:Return_L114_C8", "label": "return", "type": "return", "loc": [114, 114], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99854:FunctionDef_L113_C4", "vector": [13, 2, 0.8702, 0.0076, 2, 0.61, 0.0, 0, 5, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return [self._keys[nkey] for nkey in sorted(self._keys)]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99854:FunctionDef_L116_C4", "label": "__iter__", "type": "function", "loc": [116, 117], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99854:ClassDef_L50_C0", "vector": [2, 1, 0.8893, 0.0153, 1, 0.8, 0.7778, 891, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "__iter__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __iter__(self):\n return iter(self.keys())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99854:Return_L117_C8", "label": "return", "type": "return", "loc": [117, 117], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99854:FunctionDef_L116_C4", "vector": [13, 2, 0.8931, 0.0076, 2, 0.05, 0.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return iter(self.keys())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99854:FunctionDef_L119_C4", "label": "values", "type": "function", "loc": [119, 120], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99854:ClassDef_L50_C0", "vector": [2, 1, 0.9122, 0.0153, 1, 0.8, 0.8333, 721, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "values", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def values(self):\n return [self[key] for key in self]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99854:Return_L120_C8", "label": "return", "type": "return", "loc": [120, 120], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99854:FunctionDef_L119_C4", "vector": [13, 2, 0.916, 0.0076, 2, 0.24, 0.0, 0, 5, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return [self[key] for key in self]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99854:FunctionDef_L122_C4", "label": "items", "type": "function", "loc": [122, 123], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99854:ClassDef_L50_C0", "vector": [2, 1, 0.9351, 0.0153, 1, 0.8, 0.8889, 339, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "items", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def items(self):\n return [(key, self[key]) for key in self]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99854:Return_L123_C8", "label": "return", "type": "return", "loc": [123, 123], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99854:FunctionDef_L122_C4", "vector": [13, 2, 0.9389, 0.0076, 2, 0.39, 0.0, 0, 5, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return [(key, self[key]) for key in self]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99854:FunctionDef_L125_C4", "label": "copy", "type": "function", "loc": [125, 128], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99854:ClassDef_L50_C0", "vector": [2, 1, 0.9656, 0.0305, 1, 0.8, 0.9444, 739, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "copy", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def copy(self):\n copy = UserDict.copy(self)\n copy._keys = self._keys.copy()\n return copy"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99854:Assign_L126_C8", "label": "copy = copy()", "type": "assigned_variable", "loc": [126, 126], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99854:FunctionDef_L125_C4", "vector": [14, 2, 0.9618, 0.0076, 2, 0.28, 0.0, 739, 3, 1, 0, 0, 739, 10, 1], "semantic": {"name": "copy", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " copy = UserDict.copy(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99854:Assign_L127_C8", "label": "copy._keys = copy()", "type": "assigned_variable", "loc": [127, 127], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99854:FunctionDef_L125_C4", "vector": [14, 2, 0.9695, 0.0076, 2, 0.28, 0.5, 462, 3, 0, 0, 0, 739, 10, 1], "semantic": {"name": "copy._keys", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " copy._keys = self._keys.copy()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99854:Return_L128_C8", "label": "return", "type": "return", "loc": [128, 128], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99854:FunctionDef_L125_C4", "vector": [13, 2, 0.9771, 0.0076, 2, 0.28, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return copy"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99854:FunctionDef_L130_C4", "label": "__str__", "type": "function", "loc": [130, 131], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99854:ClassDef_L50_C0", "vector": [2, 1, 0.9962, 0.0153, 1, 0.8, 1.0, 527, 0, 1, 1, 0, 0, 0, 3], "semantic": {"name": "__str__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __str__(self):\n return str(dict(self.items()))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99854:Return_L131_C8", "label": "return", "type": "return", "loc": [131, 131], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99854:FunctionDef_L130_C4", "vector": [13, 2, 1.0, 0.0076, 2, 0.04, 0.0, 0, 3, 0, 0, 0, 0, 10, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return str(dict(self.items()))"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99854:FunctionDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99854:Expr_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99854:FunctionDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99854:If_L28_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99854:If_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99854:Assign_L29_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99854:FunctionDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99854:If_L30_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99854:If_L30_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99854:Assign_L31_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99854:If_L30_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99854:Assign_L32_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99854:FunctionDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99854:For_L33_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99854:For_L33_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99854:Assign_L34_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99854:FunctionDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99854:Return_L35_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99854:FunctionDef_L38_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99854:Expr_L39_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99854:FunctionDef_L38_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99854:Assign_L43_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99854:FunctionDef_L38_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99854:For_L44_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99854:For_L44_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99854:If_L45_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99854:If_L45_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99854:Expr_L46_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99854:FunctionDef_L38_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99854:Return_L47_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99854:ClassDef_L50_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99854:Expr_L51_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99854:ClassDef_L50_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99854:FunctionDef_L53_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99854:FunctionDef_L53_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99854:Expr_L54_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99854:FunctionDef_L53_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99854:Expr_L61_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99854:FunctionDef_L53_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99854:Assign_L62_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99854:FunctionDef_L53_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99854:Assign_L63_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99854:FunctionDef_L53_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99854:If_L64_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99854:If_L64_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99854:Expr_L65_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99854:ClassDef_L50_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99854:FunctionDef_L67_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99854:FunctionDef_L67_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99854:If_L68_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99854:If_L68_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99854:Assign_L69_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99854:FunctionDef_L67_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99854:For_L70_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99854:For_L70_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99854:Assign_L71_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99854:ClassDef_L50_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99854:FunctionDef_L73_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99854:FunctionDef_L73_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99854:If_L74_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99854:If_L74_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99854:Expr_L75_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99854:If_L74_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99854:For_L76_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99854:For_L76_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99854:Expr_L77_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99854:FunctionDef_L73_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99854:If_L78_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99854:If_L78_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99854:Expr_L79_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99854:ClassDef_L50_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99854:FunctionDef_L81_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99854:FunctionDef_L81_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99854:Assign_L82_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99854:FunctionDef_L81_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99854:Expr_L83_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99854:FunctionDef_L81_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99854:Return_L84_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99854:ClassDef_L50_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99854:FunctionDef_L86_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99854:FunctionDef_L86_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99854:Assign_L87_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99854:FunctionDef_L86_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99854:Assign_L88_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99854:ClassDef_L50_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99854:Assign_L90_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99854:ClassDef_L50_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99854:FunctionDef_L92_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99854:FunctionDef_L92_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99854:Try_L93_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99854:Try_L93_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99854:Return_L94_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99854:Try_L93_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99854:Return_L96_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99854:ClassDef_L50_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99854:FunctionDef_L98_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99854:FunctionDef_L98_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99854:Return_L99_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99854:ClassDef_L50_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99854:FunctionDef_L101_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99854:FunctionDef_L101_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99854:Assign_L102_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99854:FunctionDef_L101_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99854:Return_L104_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99854:ClassDef_L50_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99854:Assign_L106_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99854:ClassDef_L50_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99854:FunctionDef_L108_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99854:FunctionDef_L108_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99854:Return_L109_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99854:ClassDef_L50_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99854:Assign_L111_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99854:ClassDef_L50_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99854:FunctionDef_L113_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99854:FunctionDef_L113_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99854:Return_L114_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99854:ClassDef_L50_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99854:FunctionDef_L116_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99854:FunctionDef_L116_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99854:Return_L117_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99854:ClassDef_L50_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99854:FunctionDef_L119_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99854:FunctionDef_L119_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99854:Return_L120_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99854:ClassDef_L50_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99854:FunctionDef_L122_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99854:FunctionDef_L122_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99854:Return_L123_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99854:ClassDef_L50_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99854:FunctionDef_L125_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99854:FunctionDef_L125_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99854:Assign_L126_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99854:FunctionDef_L125_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99854:Assign_L127_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99854:FunctionDef_L125_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99854:Return_L128_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99854:ClassDef_L50_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99854:FunctionDef_L130_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99854:FunctionDef_L130_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99854:Return_L131_C8"}] |
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from argumentparser import ArgumentParser
from connectioncache import ConnectionCache
from domwrapper import DomWrapper
from encoding import decode_output, encode_output, decode_from_file_system
from error import (get_error_message, get_error_details, ErrorDetails,
RERAISED_EXCEPTIONS)
from escaping import escape, unescape
from htmlutils import html_format, html_escape, html_attr_escape
from htmlwriter import HtmlWriter
from importing import simple_import, import_
from match import eq, eq_any, matches, matches_any
from misc import plural_or_not, printable_name, seq2str, seq2str2
from normalizing import normalize, normalize_tags, NormalizedDict
from robotpath import normpath, abspath, get_link_path
from robottime import (get_timestamp, get_start_timestamp, format_time,
get_time, get_elapsed_time, elapsed_time_to_string,
timestr_to_secs, secs_to_timestr, secs_to_timestamp,
timestamp_to_secs, parse_time)
from text import (cut_long_message, format_assign_message,
pad_console_length, get_console_length)
from unic import unic, safe_repr
from xmlwriter import XmlWriter
import sys
is_jython = sys.platform.startswith('java')
del sys
| ajibawa-2023/Python-Code-Large/train/row_99855 | 19 | 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_99855:ImportFrom_L15_C0", "label": "from argumentparser import ArgumentParser", "type": "import", "loc": [15, 15], "level": 0, "parent": null, "vector": [1, 0, 0.375, 0.025, 0, 0.66, 0.0, 215, 0, 1, 0, 0, 215, 0, 0], "semantic": {"name": "argumentparser", "arg_names": [], "import_names": ["ArgumentParser"], "rhs_call_name": "", "annotation": ""}, "snippet": "from argumentparser import ArgumentParser"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99855:ImportFrom_L16_C0", "label": "from connectioncache import ConnectionCache", "type": "import", "loc": [16, 16], "level": 0, "parent": null, "vector": [1, 0, 0.4, 0.025, 0, 0.66, 0.0556, 964, 0, 1, 0, 0, 964, 0, 0], "semantic": {"name": "connectioncache", "arg_names": [], "import_names": ["ConnectionCache"], "rhs_call_name": "", "annotation": ""}, "snippet": "from connectioncache import ConnectionCache"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99855:ImportFrom_L17_C0", "label": "from domwrapper import DomWrapper", "type": "import", "loc": [17, 17], "level": 0, "parent": null, "vector": [1, 0, 0.425, 0.025, 0, 0.66, 0.1111, 854, 0, 1, 0, 0, 854, 0, 0], "semantic": {"name": "domwrapper", "arg_names": [], "import_names": ["DomWrapper"], "rhs_call_name": "", "annotation": ""}, "snippet": "from domwrapper import DomWrapper"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99855:ImportFrom_L18_C0", "label": "from encoding import decode_output, encode_output, decode_from_file_system", "type": "import", "loc": [18, 18], "level": 0, "parent": null, "vector": [1, 0, 0.45, 0.025, 0, 0.66, 0.1667, 325, 0, 3, 0, 0, 325, 0, 0], "semantic": {"name": "encoding", "arg_names": [], "import_names": ["decode_output", "encode_output", "decode_from_file_system"], "rhs_call_name": "", "annotation": ""}, "snippet": "from encoding import decode_output, encode_output, decode_from_file_system"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99855:ImportFrom_L19_C0", "label": "from error import get_error_message, get_error_details, ErrorDetails\u2026", "type": "import", "loc": [19, 20], "level": 0, "parent": null, "vector": [1, 0, 0.4875, 0.05, 0, 0.66, 0.2222, 771, 0, 4, 0, 0, 771, 0, 0], "semantic": {"name": "error", "arg_names": [], "import_names": ["get_error_message", "get_error_details", "ErrorDetails", "RERAISED_EXCEPTIONS"], "rhs_call_name": "", "annotation": ""}, "snippet": "from error import (get_error_message, get_error_details, ErrorDetails,\n RERAISED_EXCEPTIONS)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99855:ImportFrom_L21_C0", "label": "from escaping import escape, unescape", "type": "import", "loc": [21, 21], "level": 0, "parent": null, "vector": [1, 0, 0.525, 0.025, 0, 0.66, 0.2778, 165, 0, 2, 0, 0, 165, 0, 0], "semantic": {"name": "escaping", "arg_names": [], "import_names": ["escape", "unescape"], "rhs_call_name": "", "annotation": ""}, "snippet": "from escaping import escape, unescape"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99855:ImportFrom_L22_C0", "label": "from htmlutils import html_format, html_escape, html_attr_escape", "type": "import", "loc": [22, 22], "level": 0, "parent": null, "vector": [1, 0, 0.55, 0.025, 0, 0.66, 0.3333, 801, 0, 3, 0, 0, 801, 0, 0], "semantic": {"name": "htmlutils", "arg_names": [], "import_names": ["html_format", "html_escape", "html_attr_escape"], "rhs_call_name": "", "annotation": ""}, "snippet": "from htmlutils import html_format, html_escape, html_attr_escape"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99855:ImportFrom_L23_C0", "label": "from htmlwriter import HtmlWriter", "type": "import", "loc": [23, 23], "level": 0, "parent": null, "vector": [1, 0, 0.575, 0.025, 0, 0.66, 0.3889, 548, 0, 1, 0, 0, 548, 0, 0], "semantic": {"name": "htmlwriter", "arg_names": [], "import_names": ["HtmlWriter"], "rhs_call_name": "", "annotation": ""}, "snippet": "from htmlwriter import HtmlWriter"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99855:ImportFrom_L24_C0", "label": "from importing import simple_import, import_", "type": "import", "loc": [24, 24], "level": 0, "parent": null, "vector": [1, 0, 0.6, 0.025, 0, 0.66, 0.4444, 338, 0, 2, 0, 0, 338, 0, 0], "semantic": {"name": "importing", "arg_names": [], "import_names": ["simple_import", "import_"], "rhs_call_name": "", "annotation": ""}, "snippet": "from importing import simple_import, import_"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99855:ImportFrom_L25_C0", "label": "from match import eq, eq_any, matches\u2026", "type": "import", "loc": [25, 25], "level": 0, "parent": null, "vector": [1, 0, 0.625, 0.025, 0, 0.66, 0.5, 36, 0, 4, 0, 0, 36, 0, 0], "semantic": {"name": "match", "arg_names": [], "import_names": ["eq", "eq_any", "matches", "matches_any"], "rhs_call_name": "", "annotation": ""}, "snippet": "from match import eq, eq_any, matches, matches_any"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99855:ImportFrom_L26_C0", "label": "from misc import plural_or_not, printable_name, seq2str\u2026", "type": "import", "loc": [26, 26], "level": 0, "parent": null, "vector": [1, 0, 0.65, 0.025, 0, 0.66, 0.5556, 733, 0, 4, 0, 0, 733, 0, 0], "semantic": {"name": "misc", "arg_names": [], "import_names": ["plural_or_not", "printable_name", "seq2str", "seq2str2"], "rhs_call_name": "", "annotation": ""}, "snippet": "from misc import plural_or_not, printable_name, seq2str, seq2str2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99855:ImportFrom_L27_C0", "label": "from normalizing import normalize, normalize_tags, NormalizedDict", "type": "import", "loc": [27, 27], "level": 0, "parent": null, "vector": [1, 0, 0.675, 0.025, 0, 0.66, 0.6111, 901, 0, 3, 0, 0, 901, 0, 0], "semantic": {"name": "normalizing", "arg_names": [], "import_names": ["normalize", "normalize_tags", "NormalizedDict"], "rhs_call_name": "", "annotation": ""}, "snippet": "from normalizing import normalize, normalize_tags, NormalizedDict"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99855:ImportFrom_L28_C0", "label": "from robotpath import normpath, abspath, get_link_path", "type": "import", "loc": [28, 28], "level": 0, "parent": null, "vector": [1, 0, 0.7, 0.025, 0, 0.66, 0.6667, 605, 0, 3, 0, 0, 605, 0, 0], "semantic": {"name": "robotpath", "arg_names": [], "import_names": ["normpath", "abspath", "get_link_path"], "rhs_call_name": "", "annotation": ""}, "snippet": "from robotpath import normpath, abspath, get_link_path"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99855:ImportFrom_L29_C0", "label": "from robottime import get_timestamp, get_start_timestamp, format_time\u2026", "type": "import", "loc": [29, 32], "level": 0, "parent": null, "vector": [1, 0, 0.7625, 0.1, 0, 0.66, 0.7222, 43, 0, 11, 0, 0, 43, 0, 0], "semantic": {"name": "robottime", "arg_names": [], "import_names": ["get_timestamp", "get_start_timestamp", "format_time", "get_time", "get_elapsed_time", "elapsed_time_to_string", "timestr_to_secs", "secs_to_timestr", "secs_to_timestamp", "timestamp_to_secs", "parse_time"], "rhs_call_name": "", "annotation": ""}, "snippet": "from robottime import (get_timestamp, get_start_timestamp, format_time,\n get_time, get_elapsed_time, elapsed_time_to_string,\n timestr_to_secs, secs_to_timestr, secs_to_timestamp,\n timestamp_to_secs, parse_time)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99855:ImportFrom_L33_C0", "label": "from text import cut_long_message, format_assign_message, pad_console_length\u2026", "type": "import", "loc": [33, 34], "level": 0, "parent": null, "vector": [1, 0, 0.8375, 0.05, 0, 0.66, 0.7778, 439, 0, 4, 0, 0, 439, 0, 0], "semantic": {"name": "text", "arg_names": [], "import_names": ["cut_long_message", "format_assign_message", "pad_console_length", "get_console_length"], "rhs_call_name": "", "annotation": ""}, "snippet": "from text import (cut_long_message, format_assign_message,\n pad_console_length, get_console_length)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99855:ImportFrom_L35_C0", "label": "from unic import unic, safe_repr", "type": "import", "loc": [35, 35], "level": 0, "parent": null, "vector": [1, 0, 0.875, 0.025, 0, 0.66, 0.8333, 992, 0, 2, 0, 0, 992, 0, 0], "semantic": {"name": "unic", "arg_names": [], "import_names": ["unic", "safe_repr"], "rhs_call_name": "", "annotation": ""}, "snippet": "from unic import unic, safe_repr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99855:ImportFrom_L36_C0", "label": "from xmlwriter import XmlWriter", "type": "import", "loc": [36, 36], "level": 0, "parent": null, "vector": [1, 0, 0.9, 0.025, 0, 0.66, 0.8889, 656, 0, 1, 0, 0, 656, 0, 0], "semantic": {"name": "xmlwriter", "arg_names": [], "import_names": ["XmlWriter"], "rhs_call_name": "", "annotation": ""}, "snippet": "from xmlwriter import XmlWriter"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99855:Import_L38_C0", "label": "sys import sys", "type": "import", "loc": [38, 38], "level": 0, "parent": null, "vector": [1, 0, 0.95, 0.025, 0, 0.66, 0.9444, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sys"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99855:Assign_L39_C0", "label": "is_jython = startswith()", "type": "assigned_variable", "loc": [39, 39], "level": 0, "parent": null, "vector": [14, 0, 0.975, 0.025, 0, 0.66, 1.0, 136, 3, 1, 0, 0, 193, 10, 1], "semantic": {"name": "is_jython", "arg_names": [], "import_names": [], "rhs_call_name": "startswith", "annotation": ""}, "snippet": "is_jython = sys.platform.startswith('java')"}] | [] |
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from normalizing import NormalizedDict
class ConnectionCache:
"""Connection cache for different Robot test libraries that use connections.
This cache stores connections and allows switching between them using
generated indexes or user given aliases. Can be used for example by web
testing libraries where there's need for multiple concurrent connections.
Note that in most cases there should be only one instance of this class but
this is not enforced.
"""
def __init__(self, no_current_msg='No open connection'):
self.current = self._no_current = _NoConnection(no_current_msg)
self.current_index = None
self._connections = []
self._aliases = NormalizedDict()
self._no_current_msg = no_current_msg
def register(self, connection, alias=None):
"""Registers given connection with optional alias and returns its index.
Given connection is set to be the current connection. Alias must be
a string. The index of the first connection after initialization or
close_all or empty_cache is 1, second is 2, etc.
"""
self.current = connection
self._connections.append(connection)
self.current_index = len(self._connections)
if isinstance(alias, basestring):
self._aliases[alias] = self.current_index
return self.current_index
def switch(self, index_or_alias):
"""Switches to the connection specified by given index or alias.
If alias is given it must be a string. Indexes can be either integers
or strings that can be converted into integer. Raises RuntimeError
if no connection with given index or alias found.
"""
try:
index = self._get_index(index_or_alias)
except ValueError:
raise RuntimeError("Non-existing index or alias '%s'" % index_or_alias)
self.current = self._connections[index-1]
self.current_index = index
return self.current
def close_all(self, closer_method='close'):
"""Closes connections using given closer method and empties cache.
If simply calling the closer method is not adequate for closing
connections, clients should close connections themselves and use
empty_cache afterwards.
"""
for conn in self._connections:
getattr(conn, closer_method)()
self.empty_cache()
return self.current
def empty_cache(self):
"""Empties the connections cache.
Indexes of new connections starts from 1 after this."""
self.current = self._no_current
self.current_index = None
self._connections = []
self._aliases = NormalizedDict()
def _get_index(self, index_or_alias):
try:
return self._resolve_alias(index_or_alias)
except ValueError:
return self._resolve_index(index_or_alias)
def _resolve_alias(self, alias):
if isinstance(alias, basestring):
try:
return self._aliases[alias]
except KeyError:
pass
raise ValueError
def _resolve_index(self, index):
index = int(index)
if not 0 < index <= len(self._connections):
raise ValueError
return index
class _NoConnection:
def __init__(self, msg):
self._msg = msg
def __getattr__(self, name):
if name.startswith('__') and name.endswith('__'):
raise AttributeError
raise RuntimeError(self._msg)
def __nonzero__(self):
return False
| ajibawa-2023/Python-Code-Large/train/row_99856 | 55 | 119 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99856:ImportFrom_L15_C0", "label": "from normalizing import NormalizedDict", "type": "import", "loc": [15, 15], "level": 0, "parent": null, "vector": [1, 0, 0.1261, 0.0084, 0, 0.66, 0.0, 901, 0, 1, 0, 0, 901, 0, 0], "semantic": {"name": "normalizing", "arg_names": [], "import_names": ["NormalizedDict"], "rhs_call_name": "", "annotation": ""}, "snippet": "from normalizing import NormalizedDict"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99856:ClassDef_L18_C0", "label": "ConnectionCache", "type": "class", "loc": [18, 105], "level": 0, "parent": null, "vector": [3, 0, 0.5168, 0.7395, 0, 0.66, 0.5, 797, 0, 8, 0, 0, 0, 0, 16], "semantic": {"name": "ConnectionCache", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class ConnectionCache:\n\n \"\"\"Connection cache for different Robot test libraries that use connections.\n\n This cache stores connections and allows switching between them using\n generated indexes or user given aliases. Can be used for example by web\n testing libraries where there's need for multiple concurrent connections.\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99856:Expr_L20_C4", "label": "expression", "type": "expression", "loc": [20, 28], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99856:ClassDef_L18_C0", "vector": [8, 1, 0.2017, 0.0756, 1, 0.97, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Connection cache for different Robot test libraries that use connections.\n\n This cache stores connections and allows switching between them using\n generated indexes or user given aliases. Can be used for example by web\n testing libraries where there's need for multiple concurrent connections.\n\n Note that in most cases there should be only one instance of this class but\n this is not enforced."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99856:FunctionDef_L30_C4", "label": "__init__", "type": "function", "loc": [30, 35], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99856:ClassDef_L18_C0", "vector": [2, 1, 0.2731, 0.0504, 1, 0.97, 0.125, 555, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": ["self", "no_current_msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, no_current_msg='No open connection'):\n self.current = self._no_current = _NoConnection(no_current_msg)\n self.current_index = None\n self._connections = []\n self._aliases = NormalizedDict()\n self._no_current_msg = no_current_msg"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99856:Assign_L31_C8", "label": "self.current = _NoConnection()", "type": "assigned_variable", "loc": [31, 31], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99856:FunctionDef_L30_C4", "vector": [14, 2, 0.2605, 0.0084, 2, 0.06, 0.0, 197, 3, 1, 0, 0, 554, 10, 1], "semantic": {"name": "self.current", "arg_names": [], "import_names": [], "rhs_call_name": "_NoConnection", "annotation": ""}, "snippet": " self.current = self._no_current = _NoConnection(no_current_msg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99856:Assign_L32_C8", "label": "self.current_index =", "type": "assigned_variable", "loc": [32, 32], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99856:FunctionDef_L30_C4", "vector": [14, 2, 0.2689, 0.0084, 2, 0.06, 0.25, 214, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.current_index", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.current_index = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99856:Assign_L33_C8", "label": "self._connections =", "type": "assigned_variable", "loc": [33, 33], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99856:FunctionDef_L30_C4", "vector": [14, 2, 0.2773, 0.0084, 2, 0.06, 0.5, 752, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self._connections", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._connections = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99856:Assign_L34_C8", "label": "self._aliases = NormalizedDict()", "type": "assigned_variable", "loc": [34, 34], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99856:FunctionDef_L30_C4", "vector": [14, 2, 0.2857, 0.0084, 2, 0.06, 0.75, 874, 3, 0, 0, 0, 696, 10, 1], "semantic": {"name": "self._aliases", "arg_names": [], "import_names": [], "rhs_call_name": "NormalizedDict", "annotation": ""}, "snippet": " self._aliases = NormalizedDict()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99856:Assign_L35_C8", "label": "self._no_current_msg =", "type": "assigned_variable", "loc": [35, 35], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99856:FunctionDef_L30_C4", "vector": [14, 2, 0.2941, 0.0084, 2, 0.06, 1.0, 648, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._no_current_msg", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._no_current_msg = no_current_msg"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99856:FunctionDef_L37_C4", "label": "register", "type": "function", "loc": [37, 49], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99856:ClassDef_L18_C0", "vector": [2, 1, 0.3613, 0.1092, 1, 0.97, 0.25, 276, 0, 3, 1, 0, 0, 0, 3], "semantic": {"name": "register", "arg_names": ["self", "connection", "alias"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def register(self, connection, alias=None):\n \"\"\"Registers given connection with optional alias and returns its index.\n\n Given connection is set to be the current connection. Alias must be\n a string. The index of the first connection after initialization or\n close_all or empty_cache is 1, second is 2, etc.\n \"\"\"\n self.current = connection"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99856:Expr_L38_C8", "label": "expression", "type": "expression", "loc": [38, 43], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99856:FunctionDef_L37_C4", "vector": [8, 2, 0.3403, 0.0504, 2, 0.77, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Registers given connection with optional alias and returns its index.\n\n Given connection is set to be the current connection. Alias must be\n a string. The index of the first connection after initialization or\n close_all or empty_cache is 1, second is 2, etc.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99856:Assign_L44_C8", "label": "self.current =", "type": "assigned_variable", "loc": [44, 44], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99856:FunctionDef_L37_C4", "vector": [14, 2, 0.3697, 0.0084, 2, 0.77, 0.2, 197, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.current", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.current = connection"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99856:Expr_L45_C8", "label": "append()", "type": "expression", "loc": [45, 45], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99856:FunctionDef_L37_C4", "vector": [8, 2, 0.3782, 0.0084, 2, 0.77, 0.4, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self._connections.append(connection)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99856:Assign_L46_C8", "label": "self.current_index = len()", "type": "assigned_variable", "loc": [46, 46], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99856:FunctionDef_L37_C4", "vector": [14, 2, 0.3866, 0.0084, 2, 0.77, 0.6, 214, 3, 1, 0, 0, 890, 10, 1], "semantic": {"name": "self.current_index", "arg_names": [], "import_names": [], "rhs_call_name": "len", "annotation": ""}, "snippet": " self.current_index = len(self._connections)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99856:If_L47_C8", "label": "if", "type": "if", "loc": [47, 48], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99856:FunctionDef_L37_C4", "vector": [4, 2, 0.3992, 0.0168, 2, 0.77, 0.8, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if isinstance(alias, basestring):\n self._aliases[alias] = self.current_index"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99856:Assign_L48_C12", "label": "assign", "type": "assigned_variable", "loc": [48, 48], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99856:If_L47_C8", "vector": [14, 3, 0.4034, 0.0084, 3, 0.68, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._aliases[alias] = self.current_index"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99856:Return_L49_C8", "label": "return", "type": "return", "loc": [49, 49], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99856:FunctionDef_L37_C4", "vector": [13, 2, 0.4118, 0.0084, 2, 0.77, 1.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.current_index"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99856:FunctionDef_L51_C4", "label": "switch", "type": "function", "loc": [51, 64], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99856:ClassDef_L18_C0", "vector": [2, 1, 0.4832, 0.1176, 1, 0.97, 0.375, 748, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "switch", "arg_names": ["self", "index_or_alias"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def switch(self, index_or_alias):\n \"\"\"Switches to the connection specified by given index or alias.\n\n If alias is given it must be a string. Indexes can be either integers\n or strings that can be converted into integer. Raises RuntimeError\n if no connection with given index or alias found.\n \"\"\"\n try:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99856:Expr_L52_C8", "label": "expression", "type": "expression", "loc": [52, 57], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99856:FunctionDef_L51_C4", "vector": [8, 2, 0.458, 0.0504, 2, 0.06, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Switches to the connection specified by given index or alias.\n\n If alias is given it must be a string. Indexes can be either integers\n or strings that can be converted into integer. Raises RuntimeError\n if no connection with given index or alias found.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99856:Try_L58_C8", "label": "try", "type": "try", "loc": [58, 61], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99856:FunctionDef_L51_C4", "vector": [7, 2, 0.5, 0.0336, 2, 0.06, 0.25, 0, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n index = self._get_index(index_or_alias)\n except ValueError:\n raise RuntimeError(\"Non-existing index or alias '%s'\" % index_or_alias)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99856:Assign_L59_C12", "label": "index = _get_index()", "type": "assigned_variable", "loc": [59, 59], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99856:Try_L58_C8", "vector": [14, 3, 0.4958, 0.0084, 3, 0.3, 0.0, 780, 3, 1, 0, 0, 422, 10, 1], "semantic": {"name": "index", "arg_names": [], "import_names": [], "rhs_call_name": "_get_index", "annotation": ""}, "snippet": " index = self._get_index(index_or_alias)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99856:Assign_L62_C8", "label": "self.current =", "type": "assigned_variable", "loc": [62, 62], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99856:FunctionDef_L51_C4", "vector": [14, 2, 0.521, 0.0084, 2, 0.06, 0.5, 197, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.current", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.current = self._connections[index-1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99856:Assign_L63_C8", "label": "self.current_index =", "type": "assigned_variable", "loc": [63, 63], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99856:FunctionDef_L51_C4", "vector": [14, 2, 0.5294, 0.0084, 2, 0.06, 0.75, 214, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.current_index", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.current_index = index"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99856:Return_L64_C8", "label": "return", "type": "return", "loc": [64, 64], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99856:FunctionDef_L51_C4", "vector": [13, 2, 0.5378, 0.0084, 2, 0.06, 1.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.current"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99856:FunctionDef_L66_C4", "label": "close_all", "type": "function", "loc": [66, 76], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99856:ClassDef_L18_C0", "vector": [2, 1, 0.5966, 0.0924, 1, 0.97, 0.5, 720, 0, 2, 1, 0, 0, 0, 3], "semantic": {"name": "close_all", "arg_names": ["self", "closer_method"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def close_all(self, closer_method='close'):\n \"\"\"Closes connections using given closer method and empties cache.\n\n If simply calling the closer method is not adequate for closing\n connections, clients should close connections themselves and use\n empty_cache afterwards.\n \"\"\"\n for conn in self._connections:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99856:Expr_L67_C8", "label": "expression", "type": "expression", "loc": [67, 72], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99856:FunctionDef_L66_C4", "vector": [8, 2, 0.584, 0.0504, 2, 0.32, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Closes connections using given closer method and empties cache.\n\n If simply calling the closer method is not adequate for closing\n connections, clients should close connections themselves and use\n empty_cache afterwards.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99856:For_L73_C8", "label": "for conn", "type": "for", "loc": [73, 74], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99856:FunctionDef_L66_C4", "vector": [6, 2, 0.6176, 0.0168, 2, 0.32, 0.3333, 345, 7, 0, 0, 0, 0, 0, 2], "semantic": {"name": "conn", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for conn in self._connections:\n getattr(conn, closer_method)()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99856:Expr_L74_C12", "label": "expression", "type": "expression", "loc": [74, 74], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99856:For_L73_C8", "vector": [8, 3, 0.6218, 0.0084, 3, 0.53, 0.0, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " getattr(conn, closer_method)()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99856:Expr_L75_C8", "label": "empty_cache()", "type": "expression", "loc": [75, 75], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99856:FunctionDef_L66_C4", "vector": [8, 2, 0.6303, 0.0084, 2, 0.32, 0.6667, 79, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "empty_cache", "arg_names": [], "import_names": [], "rhs_call_name": "empty_cache", "annotation": ""}, "snippet": " self.empty_cache()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99856:Return_L76_C8", "label": "return", "type": "return", "loc": [76, 76], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99856:FunctionDef_L66_C4", "vector": [13, 2, 0.6387, 0.0084, 2, 0.32, 1.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.current"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99856:FunctionDef_L78_C4", "label": "empty_cache", "type": "function", "loc": [78, 85], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99856:ClassDef_L18_C0", "vector": [2, 1, 0.6849, 0.0672, 1, 0.97, 0.625, 79, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "empty_cache", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def empty_cache(self):\n \"\"\"Empties the connections cache.\n\n Indexes of new connections starts from 1 after this.\"\"\"\n self.current = self._no_current\n self.current_index = None\n self._connections = []\n self._aliases = NormalizedDict()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99856:Expr_L79_C8", "label": "expression", "type": "expression", "loc": [79, 81], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99856:FunctionDef_L78_C4", "vector": [8, 2, 0.6723, 0.0252, 2, 0.49, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Empties the connections cache.\n\n Indexes of new connections starts from 1 after this.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99856:Assign_L82_C8", "label": "self.current =", "type": "assigned_variable", "loc": [82, 82], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99856:FunctionDef_L78_C4", "vector": [14, 2, 0.6891, 0.0084, 2, 0.49, 0.25, 197, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.current", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.current = self._no_current"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99856:Assign_L83_C8", "label": "self.current_index =", "type": "assigned_variable", "loc": [83, 83], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99856:FunctionDef_L78_C4", "vector": [14, 2, 0.6975, 0.0084, 2, 0.49, 0.5, 214, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.current_index", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.current_index = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99856:Assign_L84_C8", "label": "self._connections =", "type": "assigned_variable", "loc": [84, 84], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99856:FunctionDef_L78_C4", "vector": [14, 2, 0.7059, 0.0084, 2, 0.49, 0.75, 752, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self._connections", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._connections = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99856:Assign_L85_C8", "label": "self._aliases = NormalizedDict()", "type": "assigned_variable", "loc": [85, 85], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99856:FunctionDef_L78_C4", "vector": [14, 2, 0.7143, 0.0084, 2, 0.49, 1.0, 874, 3, 0, 0, 0, 696, 10, 1], "semantic": {"name": "self._aliases", "arg_names": [], "import_names": [], "rhs_call_name": "NormalizedDict", "annotation": ""}, "snippet": " self._aliases = NormalizedDict()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99856:FunctionDef_L87_C4", "label": "_get_index", "type": "function", "loc": [87, 91], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99856:ClassDef_L18_C0", "vector": [2, 1, 0.7479, 0.042, 1, 0.97, 0.75, 422, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "_get_index", "arg_names": ["self", "index_or_alias"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _get_index(self, index_or_alias):\n try:\n return self._resolve_alias(index_or_alias)\n except ValueError:\n return self._resolve_index(index_or_alias)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99856:Try_L88_C8", "label": "try", "type": "try", "loc": [88, 91], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99856:FunctionDef_L87_C4", "vector": [7, 2, 0.7521, 0.0336, 2, 0.31, 0.0, 0, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n return self._resolve_alias(index_or_alias)\n except ValueError:\n return self._resolve_index(index_or_alias)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99856:Return_L89_C12", "label": "return", "type": "return", "loc": [89, 89], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99856:Try_L88_C8", "vector": [13, 3, 0.7479, 0.0084, 3, 0.94, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._resolve_alias(index_or_alias)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99856:Return_L91_C12", "label": "return", "type": "return", "loc": [91, 91], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99856:Try_L88_C8", "vector": [13, 3, 0.7647, 0.0084, 3, 0.94, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._resolve_index(index_or_alias)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99856:FunctionDef_L93_C4", "label": "_resolve_alias", "type": "function", "loc": [93, 99], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99856:ClassDef_L18_C0", "vector": [2, 1, 0.8067, 0.0588, 1, 0.97, 0.875, 123, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "_resolve_alias", "arg_names": ["self", "alias"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _resolve_alias(self, alias):\n if isinstance(alias, basestring):\n try:\n return self._aliases[alias]\n except KeyError:\n pass\n raise ValueError"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99856:If_L94_C8", "label": "if", "type": "if", "loc": [94, 98], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99856:FunctionDef_L93_C4", "vector": [4, 2, 0.8067, 0.042, 2, 0.04, 0.0, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if isinstance(alias, basestring):\n try:\n return self._aliases[alias]\n except KeyError:\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99856:Try_L95_C12", "label": "try", "type": "try", "loc": [95, 98], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99856:If_L94_C8", "vector": [7, 3, 0.8109, 0.0336, 3, 0.48, 0.0, 0, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n return self._aliases[alias]\n except KeyError:\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99856:Return_L96_C16", "label": "return", "type": "return", "loc": [96, 96], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99856:Try_L95_C12", "vector": [13, 4, 0.8067, 0.0084, 4, 0.07, 0.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._aliases[alias]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99856:FunctionDef_L101_C4", "label": "_resolve_index", "type": "function", "loc": [101, 105], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99856:ClassDef_L18_C0", "vector": [2, 1, 0.8655, 0.042, 1, 0.97, 1.0, 760, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "_resolve_index", "arg_names": ["self", "index"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _resolve_index(self, index):\n index = int(index)\n if not 0 < index <= len(self._connections):\n raise ValueError\n return index"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99856:Assign_L102_C8", "label": "index = int()", "type": "assigned_variable", "loc": [102, 102], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99856:FunctionDef_L101_C4", "vector": [14, 2, 0.8571, 0.0084, 2, 0.57, 0.0, 780, 3, 1, 0, 0, 901, 10, 1], "semantic": {"name": "index", "arg_names": [], "import_names": [], "rhs_call_name": "int", "annotation": ""}, "snippet": " index = int(index)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99856:If_L103_C8", "label": "if", "type": "if", "loc": [103, 104], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99856:FunctionDef_L101_C4", "vector": [4, 2, 0.8697, 0.0168, 2, 0.57, 0.5, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not 0 < index <= len(self._connections):\n raise ValueError"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99856:Return_L105_C8", "label": "return", "type": "return", "loc": [105, 105], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99856:FunctionDef_L101_C4", "vector": [13, 2, 0.8824, 0.0084, 2, 0.57, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return index"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99856:ClassDef_L108_C0", "label": "_NoConnection", "type": "class", "loc": [108, 119], "level": 0, "parent": null, "vector": [3, 0, 0.9538, 0.1008, 0, 0.66, 1.0, 554, 0, 3, 0, 0, 0, 0, 3], "semantic": {"name": "_NoConnection", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class _NoConnection:\n\n def __init__(self, msg):\n self._msg = msg\n\n def __getattr__(self, name):\n if name.startswith('__') and name.endswith('__'):\n raise AttributeError"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99856:FunctionDef_L110_C4", "label": "__init__", "type": "function", "loc": [110, 111], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99856:ClassDef_L108_C0", "vector": [2, 1, 0.9286, 0.0168, 1, 0.55, 0.0, 555, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, msg):\n self._msg = msg"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99856:Assign_L111_C8", "label": "self._msg =", "type": "assigned_variable", "loc": [111, 111], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99856:FunctionDef_L110_C4", "vector": [14, 2, 0.9328, 0.0084, 2, 0.31, 0.0, 405, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._msg", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._msg = msg"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99856:FunctionDef_L113_C4", "label": "__getattr__", "type": "function", "loc": [113, 116], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99856:ClassDef_L108_C0", "vector": [2, 1, 0.9622, 0.0336, 1, 0.55, 0.5, 210, 0, 2, 0, 0, 0, 0, 3], "semantic": {"name": "__getattr__", "arg_names": ["self", "name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __getattr__(self, name):\n if name.startswith('__') and name.endswith('__'):\n raise AttributeError\n raise RuntimeError(self._msg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99856:If_L114_C8", "label": "if", "type": "if", "loc": [114, 115], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99856:FunctionDef_L113_C4", "vector": [4, 2, 0.9622, 0.0168, 2, 0.37, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if name.startswith('__') and name.endswith('__'):\n raise AttributeError"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99856:FunctionDef_L118_C4", "label": "__nonzero__", "type": "function", "loc": [118, 119], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99856:ClassDef_L108_C0", "vector": [2, 1, 0.9958, 0.0168, 1, 0.55, 1.0, 322, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "__nonzero__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __nonzero__(self):\n return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99856:Return_L119_C8", "label": "return", "type": "return", "loc": [119, 119], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99856:FunctionDef_L118_C4", "vector": [13, 2, 1.0, 0.0084, 2, 0.51, 0.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return False"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99856:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99856:Expr_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99856:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99856:FunctionDef_L30_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99856:FunctionDef_L30_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99856:Assign_L31_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99856:FunctionDef_L30_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99856:Assign_L32_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99856:FunctionDef_L30_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99856:Assign_L33_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99856:FunctionDef_L30_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99856:Assign_L34_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99856:FunctionDef_L30_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99856:Assign_L35_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99856:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99856:FunctionDef_L37_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99856:FunctionDef_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99856:Expr_L38_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99856:FunctionDef_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99856:Assign_L44_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99856:FunctionDef_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99856:Expr_L45_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99856:FunctionDef_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99856:Assign_L46_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99856:FunctionDef_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99856:If_L47_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99856:If_L47_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99856:Assign_L48_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99856:FunctionDef_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99856:Return_L49_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99856:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99856:FunctionDef_L51_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99856:FunctionDef_L51_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99856:Expr_L52_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99856:FunctionDef_L51_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99856:Try_L58_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99856:Try_L58_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99856:Assign_L59_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99856:FunctionDef_L51_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99856:Assign_L62_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99856:FunctionDef_L51_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99856:Assign_L63_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99856:FunctionDef_L51_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99856:Return_L64_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99856:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99856:FunctionDef_L66_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99856:FunctionDef_L66_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99856:Expr_L67_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99856:FunctionDef_L66_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99856:For_L73_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99856:For_L73_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99856:Expr_L74_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99856:FunctionDef_L66_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99856:Expr_L75_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99856:FunctionDef_L66_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99856:Return_L76_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99856:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99856:FunctionDef_L78_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99856:FunctionDef_L78_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99856:Expr_L79_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99856:FunctionDef_L78_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99856:Assign_L82_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99856:FunctionDef_L78_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99856:Assign_L83_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99856:FunctionDef_L78_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99856:Assign_L84_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99856:FunctionDef_L78_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99856:Assign_L85_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99856:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99856:FunctionDef_L87_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99856:FunctionDef_L87_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99856:Try_L88_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99856:Try_L88_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99856:Return_L89_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99856:Try_L88_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99856:Return_L91_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99856:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99856:FunctionDef_L93_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99856:FunctionDef_L93_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99856:If_L94_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99856:If_L94_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99856:Try_L95_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99856:Try_L95_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99856:Return_L96_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99856:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99856:FunctionDef_L101_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99856:FunctionDef_L101_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99856:Assign_L102_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99856:FunctionDef_L101_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99856:If_L103_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99856:FunctionDef_L101_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99856:Return_L105_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99856:ClassDef_L108_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99856:FunctionDef_L110_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99856:FunctionDef_L110_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99856:Assign_L111_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99856:ClassDef_L108_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99856:FunctionDef_L113_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99856:FunctionDef_L113_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99856:If_L114_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99856:ClassDef_L108_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99856:FunctionDef_L118_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99856:FunctionDef_L118_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99856:Return_L119_C8"}] |
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import re
from normalizing import normalize
_match_pattern_tokenizer = re.compile('(\*|\?)')
def eq(str1, str2, ignore=[], caseless=True, spaceless=True):
str1 = normalize(str1, ignore, caseless, spaceless)
str2 = normalize(str2, ignore, caseless, spaceless)
return str1 == str2
def eq_any(str_, str_list, ignore=[], caseless=True, spaceless=True):
str_ = normalize(str_, ignore, caseless, spaceless)
for s in str_list:
if str_ == normalize(s, ignore, caseless, spaceless):
return True
return False
def matches(string, pattern, ignore=[], caseless=True, spaceless=True):
string = normalize(string, ignore, caseless, spaceless)
pattern = normalize(pattern, ignore, caseless, spaceless)
regexp = _get_match_regexp(pattern)
return re.match(regexp, string, re.DOTALL) is not None
def _get_match_regexp(pattern):
regexp = []
for token in _match_pattern_tokenizer.split(pattern):
if token == '*':
regexp.append('.*')
elif token == '?':
regexp.append('.')
else:
regexp.append(re.escape(token))
return '^%s$' % ''.join(regexp)
def matches_any(string, patterns, ignore=[], caseless=True, spaceless=True):
for pattern in patterns:
if matches(string, pattern, ignore, caseless, spaceless):
return True
return False
| ajibawa-2023/Python-Code-Large/train/row_99857 | 32 | 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_99857:Import_L16_C0", "label": "re import re", "type": "import", "loc": [16, 16], "level": 0, "parent": null, "vector": [1, 0, 0.2667, 0.0167, 0, 0.66, 0.0, 540, 0, 1, 0, 0, 540, 0, 0], "semantic": {"name": "re", "arg_names": [], "import_names": ["re"], "rhs_call_name": "", "annotation": ""}, "snippet": "import re"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99857:ImportFrom_L18_C0", "label": "from normalizing import normalize", "type": "import", "loc": [18, 18], "level": 0, "parent": null, "vector": [1, 0, 0.3, 0.0167, 0, 0.66, 0.1429, 901, 0, 1, 0, 0, 901, 0, 0], "semantic": {"name": "normalizing", "arg_names": [], "import_names": ["normalize"], "rhs_call_name": "", "annotation": ""}, "snippet": "from normalizing import normalize"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99857:Assign_L21_C0", "label": "_match_pattern_tokenizer = compile()", "type": "assigned_variable", "loc": [21, 21], "level": 0, "parent": null, "vector": [14, 0, 0.35, 0.0167, 0, 0.66, 0.2857, 824, 3, 1, 0, 0, 821, 10, 1], "semantic": {"name": "_match_pattern_tokenizer", "arg_names": [], "import_names": [], "rhs_call_name": "compile", "annotation": ""}, "snippet": "_match_pattern_tokenizer = re.compile('(\\*|\\?)')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99857:FunctionDef_L24_C0", "label": "eq", "type": "function", "loc": [24, 27], "level": 0, "parent": null, "vector": [2, 0, 0.425, 0.0667, 0, 0.66, 0.4286, 500, 0, 5, 1, 0, 0, 0, 2], "semantic": {"name": "eq", "arg_names": ["str1", "str2", "ignore", "caseless", "spaceless"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def eq(str1, str2, ignore=[], caseless=True, spaceless=True):\n str1 = normalize(str1, ignore, caseless, spaceless)\n str2 = normalize(str2, ignore, caseless, spaceless)\n return str1 == str2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99857:Assign_L25_C4", "label": "str1 = normalize()", "type": "assigned_variable", "loc": [25, 25], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99857:FunctionDef_L24_C0", "vector": [14, 1, 0.4167, 0.0167, 1, 0.02, 0.0, 39, 3, 4, 0, 0, 257, 10, 1], "semantic": {"name": "str1", "arg_names": [], "import_names": [], "rhs_call_name": "normalize", "annotation": ""}, "snippet": " str1 = normalize(str1, ignore, caseless, spaceless)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99857:Assign_L26_C4", "label": "str2 = normalize()", "type": "assigned_variable", "loc": [26, 26], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99857:FunctionDef_L24_C0", "vector": [14, 1, 0.4333, 0.0167, 1, 0.02, 0.5, 32, 3, 4, 0, 0, 257, 10, 1], "semantic": {"name": "str2", "arg_names": [], "import_names": [], "rhs_call_name": "normalize", "annotation": ""}, "snippet": " str2 = normalize(str2, ignore, caseless, spaceless)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99857:Return_L27_C4", "label": "return", "type": "return", "loc": [27, 27], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99857:FunctionDef_L24_C0", "vector": [13, 1, 0.45, 0.0167, 1, 0.02, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return str1 == str2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99857:FunctionDef_L30_C0", "label": "eq_any", "type": "function", "loc": [30, 35], "level": 0, "parent": null, "vector": [2, 0, 0.5417, 0.1, 0, 0.66, 0.5714, 882, 0, 5, 1, 0, 0, 0, 2], "semantic": {"name": "eq_any", "arg_names": ["str_", "str_list", "ignore", "caseless", "spaceless"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def eq_any(str_, str_list, ignore=[], caseless=True, spaceless=True):\n str_ = normalize(str_, ignore, caseless, spaceless)\n for s in str_list:\n if str_ == normalize(s, ignore, caseless, spaceless):\n return True\n return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99857:Assign_L31_C4", "label": "str_ = normalize()", "type": "assigned_variable", "loc": [31, 31], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99857:FunctionDef_L30_C0", "vector": [14, 1, 0.5167, 0.0167, 1, 0.98, 0.0, 398, 3, 4, 0, 0, 257, 10, 1], "semantic": {"name": "str_", "arg_names": [], "import_names": [], "rhs_call_name": "normalize", "annotation": ""}, "snippet": " str_ = normalize(str_, ignore, caseless, spaceless)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99857:For_L32_C4", "label": "for s", "type": "for", "loc": [32, 34], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99857:FunctionDef_L30_C0", "vector": [6, 1, 0.55, 0.05, 1, 0.98, 0.5, 553, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "s", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for s in str_list:\n if str_ == normalize(s, ignore, caseless, spaceless):\n return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99857:If_L33_C8", "label": "if", "type": "if", "loc": [33, 34], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99857:For_L32_C4", "vector": [4, 2, 0.5583, 0.0333, 2, 0.2, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if str_ == normalize(s, ignore, caseless, spaceless):\n return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99857:Return_L34_C12", "label": "return", "type": "return", "loc": [34, 34], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99857:If_L33_C8", "vector": [13, 3, 0.5667, 0.0167, 3, 0.16, 0.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99857:Return_L35_C4", "label": "return", "type": "return", "loc": [35, 35], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99857:FunctionDef_L30_C0", "vector": [13, 1, 0.5833, 0.0167, 1, 0.98, 1.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99857:FunctionDef_L38_C0", "label": "matches", "type": "function", "loc": [38, 42], "level": 0, "parent": null, "vector": [2, 0, 0.6667, 0.0833, 0, 0.66, 0.7143, 684, 0, 5, 1, 0, 0, 0, 4], "semantic": {"name": "matches", "arg_names": ["string", "pattern", "ignore", "caseless", "spaceless"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def matches(string, pattern, ignore=[], caseless=True, spaceless=True):\n string = normalize(string, ignore, caseless, spaceless)\n pattern = normalize(pattern, ignore, caseless, spaceless)\n regexp = _get_match_regexp(pattern)\n return re.match(regexp, string, re.DOTALL) is not None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99857:Assign_L39_C4", "label": "string = normalize()", "type": "assigned_variable", "loc": [39, 39], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99857:FunctionDef_L38_C0", "vector": [14, 1, 0.65, 0.0167, 1, 0.45, 0.0, 890, 3, 4, 0, 0, 257, 10, 1], "semantic": {"name": "string", "arg_names": [], "import_names": [], "rhs_call_name": "normalize", "annotation": ""}, "snippet": " string = normalize(string, ignore, caseless, spaceless)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99857:Assign_L40_C4", "label": "pattern = normalize()", "type": "assigned_variable", "loc": [40, 40], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99857:FunctionDef_L38_C0", "vector": [14, 1, 0.6667, 0.0167, 1, 0.45, 0.3333, 561, 3, 4, 0, 0, 257, 10, 1], "semantic": {"name": "pattern", "arg_names": [], "import_names": [], "rhs_call_name": "normalize", "annotation": ""}, "snippet": " pattern = normalize(pattern, ignore, caseless, spaceless)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99857:Assign_L41_C4", "label": "regexp = _get_match_regexp()", "type": "assigned_variable", "loc": [41, 41], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99857:FunctionDef_L38_C0", "vector": [14, 1, 0.6833, 0.0167, 1, 0.45, 0.6667, 982, 3, 1, 0, 0, 421, 10, 1], "semantic": {"name": "regexp", "arg_names": [], "import_names": [], "rhs_call_name": "_get_match_regexp", "annotation": ""}, "snippet": " regexp = _get_match_regexp(pattern)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99857:Return_L42_C4", "label": "return", "type": "return", "loc": [42, 42], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99857:FunctionDef_L38_C0", "vector": [13, 1, 0.7, 0.0167, 1, 0.45, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return re.match(regexp, string, re.DOTALL) is not None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99857:FunctionDef_L44_C0", "label": "_get_match_regexp", "type": "function", "loc": [44, 53], "level": 0, "parent": null, "vector": [2, 0, 0.8083, 0.1667, 0, 0.66, 0.8571, 421, 0, 1, 1, 0, 0, 0, 6], "semantic": {"name": "_get_match_regexp", "arg_names": ["pattern"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def _get_match_regexp(pattern):\n regexp = []\n for token in _match_pattern_tokenizer.split(pattern):\n if token == '*':\n regexp.append('.*')\n elif token == '?':\n regexp.append('.')\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99857:Assign_L45_C4", "label": "regexp =", "type": "assigned_variable", "loc": [45, 45], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99857:FunctionDef_L44_C0", "vector": [14, 1, 0.75, 0.0167, 1, 0.43, 0.0, 982, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "regexp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " regexp = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99857:For_L46_C4", "label": "for token", "type": "for", "loc": [46, 52], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99857:FunctionDef_L44_C0", "vector": [6, 1, 0.8167, 0.1167, 1, 0.43, 0.5, 129, 3, 0, 0, 0, 0, 0, 5], "semantic": {"name": "token", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for token in _match_pattern_tokenizer.split(pattern):\n if token == '*':\n regexp.append('.*')\n elif token == '?':\n regexp.append('.')\n else:\n regexp.append(re.escape(token))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99857:If_L47_C8", "label": "if", "type": "if", "loc": [47, 52], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99857:For_L46_C4", "vector": [4, 2, 0.825, 0.1, 2, 0.89, 0.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if token == '*':\n regexp.append('.*')\n elif token == '?':\n regexp.append('.')\n else:\n regexp.append(re.escape(token))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99857:Expr_L48_C12", "label": "append()", "type": "expression", "loc": [48, 48], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99857:If_L47_C8", "vector": [8, 3, 0.8, 0.0167, 3, 0.04, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " regexp.append('.*')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99857:If_L49_C8", "label": "if", "type": "if", "loc": [49, 52], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99857:If_L47_C8", "vector": [4, 3, 0.8417, 0.0667, 3, 0.04, 1.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif token == '?':\n regexp.append('.')\n else:\n regexp.append(re.escape(token))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99857:Expr_L50_C12", "label": "append()", "type": "expression", "loc": [50, 50], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99857:If_L49_C8", "vector": [8, 4, 0.8333, 0.0167, 4, 0.45, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " regexp.append('.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99857:Expr_L52_C12", "label": "append()", "type": "expression", "loc": [52, 52], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99857:If_L49_C8", "vector": [8, 4, 0.8667, 0.0167, 4, 0.45, 1.0, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " regexp.append(re.escape(token))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99857:Return_L53_C4", "label": "return", "type": "return", "loc": [53, 53], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99857:FunctionDef_L44_C0", "vector": [13, 1, 0.8833, 0.0167, 1, 0.43, 1.0, 0, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return '^%s$' % ''.join(regexp)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99857:FunctionDef_L56_C0", "label": "matches_any", "type": "function", "loc": [56, 60], "level": 0, "parent": null, "vector": [2, 0, 0.9667, 0.0833, 0, 0.66, 1.0, 888, 0, 5, 1, 0, 0, 0, 1], "semantic": {"name": "matches_any", "arg_names": ["string", "patterns", "ignore", "caseless", "spaceless"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def matches_any(string, patterns, ignore=[], caseless=True, spaceless=True):\n for pattern in patterns:\n if matches(string, pattern, ignore, caseless, spaceless):\n return True\n return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99857:For_L57_C4", "label": "for pattern", "type": "for", "loc": [57, 59], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99857:FunctionDef_L56_C0", "vector": [6, 1, 0.9667, 0.05, 1, 0.35, 0.0, 561, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "pattern", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for pattern in patterns:\n if matches(string, pattern, ignore, caseless, spaceless):\n return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99857:If_L58_C8", "label": "if", "type": "if", "loc": [58, 59], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99857:For_L57_C4", "vector": [4, 2, 0.975, 0.0333, 2, 0.43, 0.0, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if matches(string, pattern, ignore, caseless, spaceless):\n return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99857:Return_L59_C12", "label": "return", "type": "return", "loc": [59, 59], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99857:If_L58_C8", "vector": [13, 3, 0.9833, 0.0167, 3, 0.25, 0.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99857:Return_L60_C4", "label": "return", "type": "return", "loc": [60, 60], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99857:FunctionDef_L56_C0", "vector": [13, 1, 1.0, 0.0167, 1, 0.35, 1.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return False"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99857:FunctionDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99857:Assign_L25_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99857:FunctionDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99857:Assign_L26_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99857:FunctionDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99857:Return_L27_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99857:FunctionDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99857:Assign_L31_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99857:FunctionDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99857:For_L32_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99857:For_L32_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99857:If_L33_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99857:If_L33_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99857:Return_L34_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99857:FunctionDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99857:Return_L35_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99857:FunctionDef_L38_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99857:Assign_L39_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99857:FunctionDef_L38_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99857:Assign_L40_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99857:FunctionDef_L38_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99857:Assign_L41_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99857:FunctionDef_L38_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99857:Return_L42_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99857:FunctionDef_L44_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99857:Assign_L45_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99857:FunctionDef_L44_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99857:For_L46_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99857:For_L46_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99857:If_L47_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99857:If_L47_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99857:Expr_L48_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99857:If_L47_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99857:If_L49_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99857:If_L49_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99857:Expr_L50_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99857:If_L49_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99857:Expr_L52_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99857:FunctionDef_L44_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99857:Return_L53_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99857:FunctionDef_L56_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99857:For_L57_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99857:For_L57_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99857:If_L58_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99857:If_L58_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99857:Return_L59_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99857:FunctionDef_L56_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99857:Return_L60_C4"}] |
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import sys
from xml.sax.saxutils import XMLGenerator
from xml.sax.xmlreader import AttributesImpl
from abstractxmlwriter import AbstractXmlWriter
class XmlWriter(AbstractXmlWriter):
def __init__(self, path):
self.path = path
self._output = open(path, 'wb')
self._writer = XMLGenerator(self._output, encoding='UTF-8')
self._writer.startDocument()
self.closed = False
def _start(self, name, attrs):
self._writer.startElement(name, AttributesImpl(attrs))
def _content(self, content):
self._writer.characters(content)
def _end(self, name):
self._writer.endElement(name)
# Workaround for http://ironpython.codeplex.com/workitem/29474
if sys.platform == 'cli':
def _escape(self, content):
return AbstractXmlWriter._escape(self, content).encode('UTF-8')
| ajibawa-2023/Python-Code-Large/train/row_99858 | 20 | 43 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99858:Import_L15_C0", "label": "sys import sys", "type": "import", "loc": [15, 15], "level": 0, "parent": null, "vector": [1, 0, 0.3488, 0.0233, 0, 0.66, 0.0, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sys"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99858:ImportFrom_L16_C0", "label": "from xml.sax.saxutils import XMLGenerator", "type": "import", "loc": [16, 16], "level": 0, "parent": null, "vector": [1, 0, 0.3721, 0.0233, 0, 0.66, 0.25, 759, 0, 1, 0, 0, 759, 0, 0], "semantic": {"name": "xml.sax.saxutils", "arg_names": [], "import_names": ["XMLGenerator"], "rhs_call_name": "", "annotation": ""}, "snippet": "from xml.sax.saxutils import XMLGenerator"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99858:ImportFrom_L17_C0", "label": "from xml.sax.xmlreader import AttributesImpl", "type": "import", "loc": [17, 17], "level": 0, "parent": null, "vector": [1, 0, 0.3953, 0.0233, 0, 0.66, 0.5, 415, 0, 1, 0, 0, 415, 0, 0], "semantic": {"name": "xml.sax.xmlreader", "arg_names": [], "import_names": ["AttributesImpl"], "rhs_call_name": "", "annotation": ""}, "snippet": "from xml.sax.xmlreader import AttributesImpl"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99858:ImportFrom_L19_C0", "label": "from abstractxmlwriter import AbstractXmlWriter", "type": "import", "loc": [19, 19], "level": 0, "parent": null, "vector": [1, 0, 0.4419, 0.0233, 0, 0.66, 0.75, 993, 0, 1, 0, 0, 993, 0, 0], "semantic": {"name": "abstractxmlwriter", "arg_names": [], "import_names": ["AbstractXmlWriter"], "rhs_call_name": "", "annotation": ""}, "snippet": "from abstractxmlwriter import AbstractXmlWriter"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99858:ClassDef_L22_C0", "label": "XmlWriter", "type": "class", "loc": [22, 43], "level": 0, "parent": null, "vector": [3, 0, 0.7558, 0.5116, 0, 0.66, 1.0, 730, 0, 5, 0, 0, 934, 0, 9], "semantic": {"name": "XmlWriter", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class XmlWriter(AbstractXmlWriter):\n\n def __init__(self, path):\n self.path = path\n self._output = open(path, 'wb')\n self._writer = XMLGenerator(self._output, encoding='UTF-8')\n self._writer.startDocument()\n self.closed = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99858:FunctionDef_L24_C4", "label": "__init__", "type": "function", "loc": [24, 29], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99858:ClassDef_L22_C0", "vector": [2, 1, 0.6163, 0.1395, 1, 0.94, 0.0, 555, 0, 2, 0, 0, 0, 0, 3], "semantic": {"name": "__init__", "arg_names": ["self", "path"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, path):\n self.path = path\n self._output = open(path, 'wb')\n self._writer = XMLGenerator(self._output, encoding='UTF-8')\n self._writer.startDocument()\n self.closed = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99858:Assign_L25_C8", "label": "self.path =", "type": "assigned_variable", "loc": [25, 25], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99858:FunctionDef_L24_C4", "vector": [14, 2, 0.5814, 0.0233, 2, 0.85, 0.0, 425, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.path", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.path = path"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99858:Assign_L26_C8", "label": "self._output = open()", "type": "assigned_variable", "loc": [26, 26], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99858:FunctionDef_L24_C4", "vector": [14, 2, 0.6047, 0.0233, 2, 0.85, 0.25, 867, 3, 2, 0, 0, 693, 10, 1], "semantic": {"name": "self._output", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": " self._output = open(path, 'wb')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99858:Assign_L27_C8", "label": "self._writer = XMLGenerator()", "type": "assigned_variable", "loc": [27, 27], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99858:FunctionDef_L24_C4", "vector": [14, 2, 0.6279, 0.0233, 2, 0.85, 0.5, 446, 3, 2, 0, 0, 259, 10, 1], "semantic": {"name": "self._writer", "arg_names": [], "import_names": [], "rhs_call_name": "XMLGenerator", "annotation": ""}, "snippet": " self._writer = XMLGenerator(self._output, encoding='UTF-8')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99858:Expr_L28_C8", "label": "startDocument()", "type": "expression", "loc": [28, 28], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99858:FunctionDef_L24_C4", "vector": [8, 2, 0.6512, 0.0233, 2, 0.85, 0.75, 326, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "startDocument", "arg_names": [], "import_names": [], "rhs_call_name": "startDocument", "annotation": ""}, "snippet": " self._writer.startDocument()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99858:Assign_L29_C8", "label": "self.closed =", "type": "assigned_variable", "loc": [29, 29], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99858:FunctionDef_L24_C4", "vector": [14, 2, 0.6744, 0.0233, 2, 0.85, 1.0, 494, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.closed", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.closed = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99858:FunctionDef_L31_C4", "label": "_start", "type": "function", "loc": [31, 32], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99858:ClassDef_L22_C0", "vector": [2, 1, 0.7326, 0.0465, 1, 0.94, 0.25, 212, 0, 3, 0, 0, 0, 0, 2], "semantic": {"name": "_start", "arg_names": ["self", "name", "attrs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _start(self, name, attrs):\n self._writer.startElement(name, AttributesImpl(attrs))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99858:Expr_L32_C8", "label": "startElement()", "type": "expression", "loc": [32, 32], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99858:FunctionDef_L31_C4", "vector": [8, 2, 0.7442, 0.0233, 2, 0.48, 0.0, 862, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "startElement", "arg_names": [], "import_names": [], "rhs_call_name": "startElement", "annotation": ""}, "snippet": " self._writer.startElement(name, AttributesImpl(attrs))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99858:FunctionDef_L34_C4", "label": "_content", "type": "function", "loc": [34, 35], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99858:ClassDef_L22_C0", "vector": [2, 1, 0.8023, 0.0465, 1, 0.94, 0.5, 26, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "_content", "arg_names": ["self", "content"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _content(self, content):\n self._writer.characters(content)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99858:Expr_L35_C8", "label": "characters()", "type": "expression", "loc": [35, 35], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99858:FunctionDef_L34_C4", "vector": [8, 2, 0.814, 0.0233, 2, 0.63, 0.0, 731, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "characters", "arg_names": [], "import_names": [], "rhs_call_name": "characters", "annotation": ""}, "snippet": " self._writer.characters(content)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99858:FunctionDef_L37_C4", "label": "_end", "type": "function", "loc": [37, 38], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99858:ClassDef_L22_C0", "vector": [2, 1, 0.8721, 0.0465, 1, 0.94, 0.75, 964, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "_end", "arg_names": ["self", "name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _end(self, name):\n self._writer.endElement(name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99858:Expr_L38_C8", "label": "endElement()", "type": "expression", "loc": [38, 38], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99858:FunctionDef_L37_C4", "vector": [8, 2, 0.8837, 0.0233, 2, 0.37, 0.0, 563, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "endElement", "arg_names": [], "import_names": [], "rhs_call_name": "endElement", "annotation": ""}, "snippet": " self._writer.endElement(name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99858:If_L41_C4", "label": "if", "type": "if", "loc": [41, 43], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99858:ClassDef_L22_C0", "vector": [4, 1, 0.9767, 0.0698, 1, 0.94, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if sys.platform == 'cli':\n def _escape(self, content):\n return AbstractXmlWriter._escape(self, content).encode('UTF-8')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99858:FunctionDef_L42_C8", "label": "_escape", "type": "function", "loc": [42, 43], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99858:If_L41_C4", "vector": [2, 2, 0.9884, 0.0465, 2, 0.5, 0.0, 328, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "_escape", "arg_names": ["self", "content"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _escape(self, content):\n return AbstractXmlWriter._escape(self, content).encode('UTF-8')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99858:Return_L43_C12", "label": "return", "type": "return", "loc": [43, 43], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99858:FunctionDef_L42_C8", "vector": [13, 3, 1.0, 0.0233, 3, 0.73, 0.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return AbstractXmlWriter._escape(self, content).encode('UTF-8')"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99858:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99858:FunctionDef_L24_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99858:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99858:Assign_L25_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99858:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99858:Assign_L26_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99858:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99858:Assign_L27_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99858:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99858:Expr_L28_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99858:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99858:Assign_L29_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99858:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99858:FunctionDef_L31_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99858:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99858:Expr_L32_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99858:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99858:FunctionDef_L34_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99858:FunctionDef_L34_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99858:Expr_L35_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99858:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99858:FunctionDef_L37_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99858:FunctionDef_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99858:Expr_L38_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99858:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99858:If_L41_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99858:If_L41_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99858:FunctionDef_L42_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99858:FunctionDef_L42_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99858:Return_L43_C12"}] |
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
RESERVED_KEYWORDS = [ 'for', 'while', 'break', 'continue', 'end',
'if', 'else', 'elif', 'else if', 'return' ]
class Reserved:
ROBOT_LIBRARY_SCOPE = 'GLOBAL'
def get_keyword_names(self):
return RESERVED_KEYWORDS
def run_keyword(self, name, args):
raise Exception("'%s' is a reserved keyword" % name.title())
| ajibawa-2023/Python-Code-Large/train/row_99860 | 6 | 29 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99860:Assign_L16_C0", "label": "RESERVED_KEYWORDS =", "type": "assigned_variable", "loc": [16, 17], "level": 0, "parent": null, "vector": [14, 0, 0.569, 0.069, 0, 0.66, 0.0, 112, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "RESERVED_KEYWORDS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "RESERVED_KEYWORDS = [ 'for', 'while', 'break', 'continue', 'end',\n 'if', 'else', 'elif', 'else if', 'return' ]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99860:ClassDef_L20_C0", "label": "Reserved", "type": "class", "loc": [20, 28], "level": 0, "parent": null, "vector": [3, 0, 0.8276, 0.3103, 0, 0.66, 1.0, 466, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "Reserved", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Reserved:\n\n ROBOT_LIBRARY_SCOPE = 'GLOBAL'\n\n def get_keyword_names(self):\n return RESERVED_KEYWORDS\n\n def run_keyword(self, name, args):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99860:Assign_L22_C4", "label": "ROBOT_LIBRARY_SCOPE =", "type": "assigned_variable", "loc": [22, 22], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99860:ClassDef_L20_C0", "vector": [14, 1, 0.7586, 0.0345, 1, 0.0, 0.0, 305, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "ROBOT_LIBRARY_SCOPE", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ROBOT_LIBRARY_SCOPE = 'GLOBAL'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99860:FunctionDef_L24_C4", "label": "get_keyword_names", "type": "function", "loc": [24, 25], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99860:ClassDef_L20_C0", "vector": [2, 1, 0.8448, 0.069, 1, 0.0, 0.5, 768, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "get_keyword_names", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_keyword_names(self):\n return RESERVED_KEYWORDS"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99860:Return_L25_C8", "label": "return", "type": "return", "loc": [25, 25], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99860:FunctionDef_L24_C4", "vector": [13, 2, 0.8621, 0.0345, 2, 0.72, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return RESERVED_KEYWORDS"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99860:FunctionDef_L27_C4", "label": "run_keyword", "type": "function", "loc": [27, 28], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99860:ClassDef_L20_C0", "vector": [2, 1, 0.9483, 0.069, 1, 0.0, 1.0, 458, 0, 3, 0, 0, 0, 0, 2], "semantic": {"name": "run_keyword", "arg_names": ["self", "name", "args"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def run_keyword(self, name, args):\n raise Exception(\"'%s' is a reserved keyword\" % name.title())"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99860:ClassDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99860:Assign_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99860:ClassDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99860:FunctionDef_L24_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99860:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99860:Return_L25_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99860:ClassDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99860:FunctionDef_L27_C4"}] |
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
def none_shall_pass(who):
if who is not None:
raise AssertionError('None shall pass!')
print '*HTML* <object width="480" height="385"><param name="movie" value="http://www.youtube.com/v/dhRUe-gz690&hl=en_US&fs=1&rel=0&color1=0x234900&color2=0x4e9e00"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/dhRUe-gz690&hl=en_US&fs=1&rel=0&color1=0x234900&color2=0x4e9e00" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object>'
| ajibawa-2023/Python-Code-Large/train/row_99861 | 3 | 19 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99861:FunctionDef_L16_C0", "label": "none_shall_pass", "type": "function", "loc": [16, 19], "level": 0, "parent": null, "vector": [2, 0, 0.9211, 0.2105, 0, 0.66, 0.0, 93, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "none_shall_pass", "arg_names": ["who"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def none_shall_pass(who):\n if who is not None:\n raise AssertionError('None shall pass!')\n print('*HTML* <object width=\"480\" height=\"385\"><param name=\"movie\" value=\"http://www.youtube.com/v/dhRUe-gz690&hl=en_US&fs=1&rel=0&color1=0x234900&color2=0x4e9e00\"></param><param name=\"allowFullScreen\" value=\"true\"></param><param name=\"allowscriptaccess\" value=\"always\"></param><embed src=\"http://www.youtube.com/v/dhRUe-gz690&hl=en_US&fs=1&rel=0&color1=0x234900&color2=0x4e9e00\" type=\"application/x-shockwave-flash\" allowscriptaccess=\"always\" allowfullscreen=\"true\" width=\"480\" height=\"385\"></embed></object>')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99861:If_L17_C4", "label": "if", "type": "if", "loc": [17, 18], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99861:FunctionDef_L16_C0", "vector": [4, 1, 0.9211, 0.1053, 1, 0.47, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if who is not None:\n raise AssertionError('None shall pass!')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99861:Expr_L19_C4", "label": "print()", "type": "expression", "loc": [19, 19], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99861:FunctionDef_L16_C0", "vector": [8, 1, 1.0, 0.0526, 1, 0.47, 1.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('*HTML* <object width=\"480\" height=\"385\"><param name=\"movie\" value=\"http://www.youtube.com/v/dhRUe-gz690&hl=en_US&fs=1&rel=0&color1=0x234900&color2=0x4e9e00\"></param><param name=\"allowFullScreen\" value=\"true\"></param><param name=\"allowscriptaccess\" value=\"always\"></param><embed src=\"http://www.youtube.com/v/dhRUe-gz690&hl=en_US&fs=1&rel=0&color1=0x234900&color2=0x4e9e00\" type=\"application/x-shockwave-flash\" allowscriptaccess=\"always\" allowfullscreen=\"true\" width=\"480\" height=\"385\"></embed></object>')"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99861:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99861:If_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99861:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99861:Expr_L19_C4"}] |
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""A test library providing dialogs for interacting with users.
`Dialogs` is Robot Framework's standard library that provides means
for pausing the test execution and getting input from users. The
dialogs are slightly different depending on are tests run on Python or
Jython but they provide the same functionality.
Note: Dialogs library cannot be used with timeouts on Windows with Python.
"""
__all__ = ['execute_manual_step', 'get_value_from_user',
'get_selection_from_user', 'pause_execution']
import sys
try:
from robot.version import get_version as _get_version
except ImportError:
__version__ = 'unknown'
else:
__version__ = _get_version()
DIALOG_TITLE = 'Robot Framework'
def pause_execution(message='Test execution paused. Press OK to continue.'):
"""Pauses the test execution and shows dialog with the text `message`. """
MessageDialog(message)
def execute_manual_step(message, default_error=''):
"""Pauses the test execution until user sets the keyword status.
`message` is the instruction shown in the dialog. User can select
PASS or FAIL, and in the latter case an additional dialog is
opened for defining the error message. `default_error` is the
possible default value shown in the error message dialog.
"""
if not PassFailDialog(message).result:
msg = get_value_from_user('Give error message:', default_error)
raise AssertionError(msg)
def get_value_from_user(message, default_value=''):
"""Pauses the test execution and asks user to input a value.
`message` is the instruction shown in the dialog. `default_value` is the
possible default value shown in the input field. Selecting 'Cancel' fails
the keyword.
"""
return _validate_user_input(InputDialog(message, default_value).result)
def get_selection_from_user(message, *values):
"""Pauses the test execution and asks user to select value
`message` is the instruction shown in the dialog. and `values` are
the options given to the user. Selecting 'Cancel' fails the keyword.
This keyword was added into Robot Framework 2.1.2.
"""
return _validate_user_input(SelectionDialog(message, values).result)
def _validate_user_input(value):
if value is None:
raise ValueError('No value provided by user')
return value
if not sys.platform.startswith('java'):
from Tkinter import (Tk, Toplevel, Frame, Listbox, Label, Button,
BOTH, END, LEFT)
import tkMessageBox
import tkSimpleDialog
from threading import currentThread
def prevent_execution_with_timeouts(method):
def check_timeout(*args):
if 'linux' not in sys.platform \
and currentThread().getName() != 'MainThread':
raise RuntimeError('Dialogs library is not supported with '
'timeouts on Python on this platform.')
return method(*args)
return check_timeout
class _AbstractTkDialog(Toplevel):
@prevent_execution_with_timeouts
def __init__(self, title):
parent = Tk()
parent.withdraw()
Toplevel.__init__(self, parent)
self._init_dialog(parent, title)
self._create_body()
self._create_buttons()
self.result = None
self._initial_focus.focus_set()
self.wait_window(self)
def _init_dialog(self, parent, title):
self.title(title)
self.grab_set()
self.protocol("WM_DELETE_WINDOW", self._right_clicked)
self.geometry("+%d+%d" % (parent.winfo_rootx()+150,
parent.winfo_rooty()+150))
def _create_body(self):
frame = Frame(self)
self._initial_focus = self.create_components(frame)
frame.pack(padx=5, pady=5, expand=1, fill=BOTH)
def _create_buttons(self):
frame = Frame(self)
self._create_button(frame, self._left_button, self._left_clicked)
self._create_button(frame, self._right_button, self._right_clicked)
self.bind("<Escape>", self._right_clicked)
frame.pack()
def _create_button(self, parent, label, command):
w = Button(parent, text=label, width=10, command=command)
w.pack(side=LEFT, padx=5, pady=5)
def _left_clicked(self, event=None):
if not self.validate():
self._initial_focus.focus_set()
return
self.withdraw()
self.apply()
self.destroy()
def _right_clicked(self, event=None):
self.destroy()
def create_components(self, parent):
raise NotImplementedError()
def validate(self):
raise NotImplementedError()
def apply(self):
raise NotImplementedError()
class MessageDialog(object):
@prevent_execution_with_timeouts
def __init__(self, message):
Tk().withdraw()
tkMessageBox.showinfo(DIALOG_TITLE, message)
class InputDialog(object):
@prevent_execution_with_timeouts
def __init__(self, message, default):
Tk().withdraw()
self.result = tkSimpleDialog.askstring(DIALOG_TITLE, message,
initialvalue=default)
class SelectionDialog(_AbstractTkDialog):
_left_button = 'OK'
_right_button = 'Cancel'
def __init__(self, message, values):
self._message = message
self._values = values
_AbstractTkDialog.__init__(self, "Select one option")
def create_components(self, parent):
Label(parent, text=self._message).pack(fill=BOTH)
self._listbox = Listbox(parent)
self._listbox.pack(fill=BOTH)
for item in self._values:
self._listbox.insert(END, item)
return self._listbox
def validate(self):
return bool(self._listbox.curselection())
def apply(self):
self.result = self._listbox.get(self._listbox.curselection())
class PassFailDialog(_AbstractTkDialog):
_left_button = 'PASS'
_right_button = 'FAIL'
def __init__(self, message):
self._message = message
_AbstractTkDialog.__init__(self, DIALOG_TITLE)
def create_components(self, parent):
label = Label(parent, text=self._message)
label.pack(fill=BOTH)
return label
def validate(self):
return True
def apply(self):
self.result = True
else:
import time
from javax.swing import JOptionPane
from javax.swing.JOptionPane import PLAIN_MESSAGE, UNINITIALIZED_VALUE, \
YES_NO_OPTION, OK_CANCEL_OPTION, DEFAULT_OPTION
class _AbstractSwingDialog:
def __init__(self, message):
self.result = self._show_dialog(message)
def _show_dialog(self, message):
self._init_dialog(message)
self._show_dialog_and_wait_it_to_be_closed()
return self._get_value()
def _show_dialog_and_wait_it_to_be_closed(self):
dialog = self._pane.createDialog(None, DIALOG_TITLE)
dialog.setModal(0);
dialog.show()
while dialog.isShowing():
time.sleep(0.2)
dialog.dispose()
def _get_value(self):
value = self._pane.getInputValue()
if value == UNINITIALIZED_VALUE:
return None
return value
class MessageDialog(_AbstractSwingDialog):
def _init_dialog(self, message):
self._pane = JOptionPane(message, PLAIN_MESSAGE, DEFAULT_OPTION)
class InputDialog(_AbstractSwingDialog):
def __init__(self, message, default):
self._default = default
_AbstractSwingDialog.__init__(self, message)
def _init_dialog(self, message):
self._pane = JOptionPane(message, PLAIN_MESSAGE, OK_CANCEL_OPTION)
self._pane.setWantsInput(True)
self._pane.setInitialSelectionValue(self._default)
class SelectionDialog(_AbstractSwingDialog):
def __init__(self, message, options):
self._options = options
_AbstractSwingDialog.__init__(self, message)
def _init_dialog(self, message):
self._pane = JOptionPane(message, PLAIN_MESSAGE, OK_CANCEL_OPTION)
self._pane.setWantsInput(True)
self._pane.setSelectionValues(self._options)
class PassFailDialog(_AbstractSwingDialog):
def _init_dialog(self, message):
self._buttons = ['PASS', 'FAIL']
self._pane = JOptionPane(message, PLAIN_MESSAGE, YES_NO_OPTION,
None, self._buttons, 'PASS')
def _get_value(self):
value = self._pane.getValue()
if value in self._buttons and self._buttons.index(value) == 0:
return True
return False
| ajibawa-2023/Python-Code-Large/train/row_99863 | 165 | 295 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99863:Expr_L16_C0", "label": "expression", "type": "expression", "loc": [16, 24], "level": 0, "parent": null, "vector": [8, 0, 0.0678, 0.0305, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\"\"\"A test library providing dialogs for interacting with users.\n\n`Dialogs` is Robot Framework's standard library that provides means\nfor pausing the test execution and getting input from users. The\ndialogs are slightly different depending on are tests run on Python or\nJython but they provide the same functionality.\n\nNote: Dialogs library cannot be used with timeouts on Windows with Python."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:Assign_L26_C0", "label": "__all__ =", "type": "assigned_variable", "loc": [26, 27], "level": 0, "parent": null, "vector": [14, 0, 0.0898, 0.0068, 0, 0.66, 0.1, 272, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "__all__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "__all__ = ['execute_manual_step', 'get_value_from_user',\n 'get_selection_from_user', 'pause_execution']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:Import_L29_C0", "label": "sys import sys", "type": "import", "loc": [29, 29], "level": 0, "parent": null, "vector": [1, 0, 0.0983, 0.0034, 0, 0.66, 0.2, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sys"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:Try_L31_C0", "label": "try", "type": "try", "loc": [31, 36], "level": 0, "parent": null, "vector": [7, 0, 0.1136, 0.0203, 0, 0.66, 0.3, 0, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "try:\n from robot.version import get_version as _get_version\nexcept ImportError:\n __version__ = 'unknown'\nelse:\n __version__ = _get_version()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:ImportFrom_L32_C4", "label": "from robot.version import _get_version", "type": "import", "loc": [32, 32], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:Try_L31_C0", "vector": [1, 1, 0.1085, 0.0034, 1, 0.24, 0.0, 622, 0, 1, 0, 0, 622, 0, 0], "semantic": {"name": "robot.version", "arg_names": [], "import_names": ["_get_version"], "rhs_call_name": "", "annotation": ""}, "snippet": " from robot.version import get_version as _get_version"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:Assign_L34_C4", "label": "__version__ =", "type": "assigned_variable", "loc": [34, 34], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:Try_L31_C0", "vector": [14, 1, 0.1153, 0.0034, 1, 0.24, 0.0, 162, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__version__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " __version__ = 'unknown'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:Assign_L36_C4", "label": "__version__ = _get_version()", "type": "assigned_variable", "loc": [36, 36], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:Try_L31_C0", "vector": [14, 1, 0.122, 0.0034, 1, 0.24, 1.0, 162, 3, 0, 0, 0, 602, 10, 1], "semantic": {"name": "__version__", "arg_names": [], "import_names": [], "rhs_call_name": "_get_version", "annotation": ""}, "snippet": " __version__ = _get_version()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:Assign_L39_C0", "label": "DIALOG_TITLE =", "type": "assigned_variable", "loc": [39, 39], "level": 0, "parent": null, "vector": [14, 0, 0.1322, 0.0034, 0, 0.66, 0.4, 963, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DIALOG_TITLE", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DIALOG_TITLE = 'Robot Framework'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L42_C0", "label": "pause_execution", "type": "function", "loc": [42, 44], "level": 0, "parent": null, "vector": [2, 0, 0.1458, 0.0102, 0, 0.66, 0.5, 937, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "pause_execution", "arg_names": ["message"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def pause_execution(message='Test execution paused. Press OK to continue.'):\n \"\"\"Pauses the test execution and shows dialog with the text `message`. \"\"\"\n MessageDialog(message)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:Expr_L43_C4", "label": "expression", "type": "expression", "loc": [43, 43], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L42_C0", "vector": [8, 1, 0.1458, 0.0034, 1, 0.37, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Pauses the test execution and shows dialog with the text `message`. \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:Expr_L44_C4", "label": "MessageDialog()", "type": "expression", "loc": [44, 44], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L42_C0", "vector": [8, 1, 0.1492, 0.0034, 1, 0.37, 1.0, 934, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "MessageDialog", "arg_names": [], "import_names": [], "rhs_call_name": "MessageDialog", "annotation": ""}, "snippet": " MessageDialog(message)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L46_C0", "label": "execute_manual_step", "type": "function", "loc": [46, 56], "level": 0, "parent": null, "vector": [2, 0, 0.1729, 0.0373, 0, 0.66, 0.6, 866, 0, 2, 0, 0, 0, 0, 3], "semantic": {"name": "execute_manual_step", "arg_names": ["message", "default_error"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def execute_manual_step(message, default_error=''):\n \"\"\"Pauses the test execution until user sets the keyword status.\n\n `message` is the instruction shown in the dialog. User can select\n PASS or FAIL, and in the latter case an additional dialog is\n opened for defining the error message. `default_error` is the\n possible default value shown in the error message dialog.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:Expr_L47_C4", "label": "expression", "type": "expression", "loc": [47, 53], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L46_C0", "vector": [8, 1, 0.1695, 0.0237, 1, 0.21, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Pauses the test execution until user sets the keyword status.\n\n `message` is the instruction shown in the dialog. User can select\n PASS or FAIL, and in the latter case an additional dialog is\n opened for defining the error message. `default_error` is the\n possible default value shown in the error message dialog.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:If_L54_C4", "label": "if", "type": "if", "loc": [54, 56], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L46_C0", "vector": [4, 1, 0.1864, 0.0102, 1, 0.21, 1.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not PassFailDialog(message).result:\n msg = get_value_from_user('Give error message:', default_error)\n raise AssertionError(msg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:Assign_L55_C8", "label": "msg = get_value_from_user()", "type": "assigned_variable", "loc": [55, 55], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:If_L54_C4", "vector": [14, 2, 0.1864, 0.0034, 2, 0.86, 0.0, 712, 3, 2, 0, 0, 786, 10, 1], "semantic": {"name": "msg", "arg_names": [], "import_names": [], "rhs_call_name": "get_value_from_user", "annotation": ""}, "snippet": " msg = get_value_from_user('Give error message:', default_error)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L58_C0", "label": "get_value_from_user", "type": "function", "loc": [58, 65], "level": 0, "parent": null, "vector": [2, 0, 0.2085, 0.0271, 0, 0.66, 0.7, 786, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "get_value_from_user", "arg_names": ["message", "default_value"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def get_value_from_user(message, default_value=''):\n \"\"\"Pauses the test execution and asks user to input a value.\n\n `message` is the instruction shown in the dialog. `default_value` is the\n possible default value shown in the input field. Selecting 'Cancel' fails\n the keyword.\n \"\"\"\n return _validate_user_input(InputDialog(message, default_value).result)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:Expr_L59_C4", "label": "expression", "type": "expression", "loc": [59, 64], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L58_C0", "vector": [8, 1, 0.2085, 0.0203, 1, 0.78, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Pauses the test execution and asks user to input a value.\n\n `message` is the instruction shown in the dialog. `default_value` is the\n possible default value shown in the input field. Selecting 'Cancel' fails\n the keyword.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:Return_L65_C4", "label": "return", "type": "return", "loc": [65, 65], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L58_C0", "vector": [13, 1, 0.2203, 0.0034, 1, 0.78, 1.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return _validate_user_input(InputDialog(message, default_value).result)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L67_C0", "label": "get_selection_from_user", "type": "function", "loc": [67, 75], "level": 0, "parent": null, "vector": [2, 0, 0.2407, 0.0305, 0, 0.66, 0.8, 439, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "get_selection_from_user", "arg_names": ["message", "values"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def get_selection_from_user(message, *values):\n \"\"\"Pauses the test execution and asks user to select value\n\n `message` is the instruction shown in the dialog. and `values` are\n the options given to the user. Selecting 'Cancel' fails the keyword.\n\n This keyword was added into Robot Framework 2.1.2.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:Expr_L68_C4", "label": "expression", "type": "expression", "loc": [68, 74], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L67_C0", "vector": [8, 1, 0.2407, 0.0237, 1, 0.61, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Pauses the test execution and asks user to select value\n\n `message` is the instruction shown in the dialog. and `values` are\n the options given to the user. Selecting 'Cancel' fails the keyword.\n\n This keyword was added into Robot Framework 2.1.2.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:Return_L75_C4", "label": "return", "type": "return", "loc": [75, 75], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L67_C0", "vector": [13, 1, 0.2542, 0.0034, 1, 0.61, 1.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return _validate_user_input(SelectionDialog(message, values).result)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L77_C0", "label": "_validate_user_input", "type": "function", "loc": [77, 80], "level": 0, "parent": null, "vector": [2, 0, 0.2661, 0.0136, 0, 0.66, 0.9, 866, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "_validate_user_input", "arg_names": ["value"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def _validate_user_input(value):\n if value is None:\n raise ValueError('No value provided by user')\n return value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:If_L78_C4", "label": "if", "type": "if", "loc": [78, 79], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L77_C0", "vector": [4, 1, 0.2661, 0.0068, 1, 0.81, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if value is None:\n raise ValueError('No value provided by user')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:Return_L80_C4", "label": "return", "type": "return", "loc": [80, 80], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L77_C0", "vector": [13, 1, 0.2712, 0.0034, 1, 0.81, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:If_L83_C0", "label": "if", "type": "if", "loc": [83, 295], "level": 0, "parent": null, "vector": [4, 0, 0.6407, 0.722, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 80], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if not sys.platform.startswith('java'):\n\n from Tkinter import (Tk, Toplevel, Frame, Listbox, Label, Button,\n BOTH, END, LEFT)\n import tkMessageBox\n import tkSimpleDialog\n from threading import currentThread\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:ImportFrom_L85_C4", "label": "from Tkinter import Tk, Toplevel, Frame\u2026", "type": "import", "loc": [85, 86], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:If_L83_C0", "vector": [1, 1, 0.2898, 0.0068, 1, 0.06, 0.0, 368, 0, 9, 0, 0, 368, 0, 0], "semantic": {"name": "Tkinter", "arg_names": [], "import_names": ["Tk", "Toplevel", "Frame", "Listbox", "Label", "Button", "BOTH", "END", "LEFT"], "rhs_call_name": "", "annotation": ""}, "snippet": " from Tkinter import (Tk, Toplevel, Frame, Listbox, Label, Button,\n BOTH, END, LEFT)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:Import_L87_C4", "label": "tkMessageBox import tkMessageBox", "type": "import", "loc": [87, 87], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:If_L83_C0", "vector": [1, 1, 0.2949, 0.0034, 1, 0.06, 0.0588, 507, 0, 1, 0, 0, 507, 0, 0], "semantic": {"name": "tkMessageBox", "arg_names": [], "import_names": ["tkMessageBox"], "rhs_call_name": "", "annotation": ""}, "snippet": " import tkMessageBox"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:Import_L88_C4", "label": "tkSimpleDialog import tkSimpleDialog", "type": "import", "loc": [88, 88], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:If_L83_C0", "vector": [1, 1, 0.2983, 0.0034, 1, 0.06, 0.1176, 774, 0, 1, 0, 0, 774, 0, 0], "semantic": {"name": "tkSimpleDialog", "arg_names": [], "import_names": ["tkSimpleDialog"], "rhs_call_name": "", "annotation": ""}, "snippet": " import tkSimpleDialog"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:ImportFrom_L89_C4", "label": "from threading import currentThread", "type": "import", "loc": [89, 89], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:If_L83_C0", "vector": [1, 1, 0.3017, 0.0034, 1, 0.06, 0.1765, 83, 0, 1, 0, 0, 83, 0, 0], "semantic": {"name": "threading", "arg_names": [], "import_names": ["currentThread"], "rhs_call_name": "", "annotation": ""}, "snippet": " from threading import currentThread"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L92_C4", "label": "prevent_execution_with_timeouts", "type": "function", "loc": [92, 99], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:If_L83_C0", "vector": [2, 1, 0.3237, 0.0271, 1, 0.06, 0.2353, 707, 0, 1, 1, 0, 0, 0, 4], "semantic": {"name": "prevent_execution_with_timeouts", "arg_names": ["method"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def prevent_execution_with_timeouts(method):\n def check_timeout(*args):\n if 'linux' not in sys.platform \\\n and currentThread().getName() != 'MainThread':\n raise RuntimeError('Dialogs library is not supported with '\n 'timeouts on Python on this platform.')\n return method(*args)\n return check_timeout"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L93_C8", "label": "check_timeout", "type": "function", "loc": [93, 98], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L92_C4", "vector": [2, 2, 0.3237, 0.0203, 2, 0.67, 0.0, 307, 0, 1, 1, 0, 0, 0, 4], "semantic": {"name": "check_timeout", "arg_names": ["args"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def check_timeout(*args):\n if 'linux' not in sys.platform \\\n and currentThread().getName() != 'MainThread':\n raise RuntimeError('Dialogs library is not supported with '\n 'timeouts on Python on this platform.')\n return method(*args)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:If_L94_C12", "label": "if", "type": "if", "loc": [94, 97], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L93_C8", "vector": [4, 3, 0.3237, 0.0136, 3, 0.88, 0.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if 'linux' not in sys.platform \\\n and currentThread().getName() != 'MainThread':\n raise RuntimeError('Dialogs library is not supported with '\n 'timeouts on Python on this platform.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:Return_L98_C12", "label": "return", "type": "return", "loc": [98, 98], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L93_C8", "vector": [13, 3, 0.3322, 0.0034, 3, 0.88, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return method(*args)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:Return_L99_C8", "label": "return", "type": "return", "loc": [99, 99], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L92_C4", "vector": [13, 2, 0.3356, 0.0034, 2, 0.67, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return check_timeout"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:ClassDef_L102_C4", "label": "_AbstractTkDialog", "type": "class", "loc": [102, 157], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:If_L83_C0", "vector": [3, 1, 0.439, 0.1898, 1, 0.06, 0.2941, 741, 0, 10, 0, 0, 450, 0, 33], "semantic": {"name": "_AbstractTkDialog", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " class _AbstractTkDialog(Toplevel):\n\n @prevent_execution_with_timeouts\n def __init__(self, title):\n parent = Tk()\n parent.withdraw()\n Toplevel.__init__(self, parent)\n self._init_dialog(parent, title)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L105_C8", "label": "__init__", "type": "function", "loc": [105, 114], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:ClassDef_L102_C4", "vector": [2, 2, 0.3712, 0.0339, 2, 0.69, 0.0, 555, 0, 2, 0, 0, 0, 0, 8], "semantic": {"name": "__init__", "arg_names": ["self", "title"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, title):\n parent = Tk()\n parent.withdraw()\n Toplevel.__init__(self, parent)\n self._init_dialog(parent, title)\n self._create_body()\n self._create_buttons()\n self.result = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:Assign_L106_C12", "label": "parent = Tk()", "type": "assigned_variable", "loc": [106, 106], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L105_C8", "vector": [14, 3, 0.3593, 0.0034, 3, 0.82, 0.0, 80, 3, 0, 0, 0, 309, 10, 1], "semantic": {"name": "parent", "arg_names": [], "import_names": [], "rhs_call_name": "Tk", "annotation": ""}, "snippet": " parent = Tk()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:Expr_L107_C12", "label": "withdraw()", "type": "expression", "loc": [107, 107], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L105_C8", "vector": [8, 3, 0.3627, 0.0034, 3, 0.82, 0.125, 309, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "withdraw", "arg_names": [], "import_names": [], "rhs_call_name": "withdraw", "annotation": ""}, "snippet": " parent.withdraw()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:Expr_L108_C12", "label": "__init__()", "type": "expression", "loc": [108, 108], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L105_C8", "vector": [8, 3, 0.3661, 0.0034, 3, 0.82, 0.25, 555, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " Toplevel.__init__(self, parent)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:Expr_L109_C12", "label": "_init_dialog()", "type": "expression", "loc": [109, 109], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L105_C8", "vector": [8, 3, 0.3695, 0.0034, 3, 0.82, 0.375, 619, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "_init_dialog", "arg_names": [], "import_names": [], "rhs_call_name": "_init_dialog", "annotation": ""}, "snippet": " self._init_dialog(parent, title)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:Expr_L110_C12", "label": "_create_body()", "type": "expression", "loc": [110, 110], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L105_C8", "vector": [8, 3, 0.3729, 0.0034, 3, 0.82, 0.5, 973, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_create_body", "arg_names": [], "import_names": [], "rhs_call_name": "_create_body", "annotation": ""}, "snippet": " self._create_body()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:Expr_L111_C12", "label": "_create_buttons()", "type": "expression", "loc": [111, 111], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L105_C8", "vector": [8, 3, 0.3763, 0.0034, 3, 0.82, 0.625, 164, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_create_buttons", "arg_names": [], "import_names": [], "rhs_call_name": "_create_buttons", "annotation": ""}, "snippet": " self._create_buttons()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:Assign_L112_C12", "label": "self.result =", "type": "assigned_variable", "loc": [112, 112], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L105_C8", "vector": [14, 3, 0.3797, 0.0034, 3, 0.82, 0.75, 341, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.result", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.result = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:Expr_L113_C12", "label": "focus_set()", "type": "expression", "loc": [113, 113], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L105_C8", "vector": [8, 3, 0.3831, 0.0034, 3, 0.82, 0.875, 278, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "focus_set", "arg_names": [], "import_names": [], "rhs_call_name": "focus_set", "annotation": ""}, "snippet": " self._initial_focus.focus_set()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:Expr_L114_C12", "label": "wait_window()", "type": "expression", "loc": [114, 114], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L105_C8", "vector": [8, 3, 0.3864, 0.0034, 3, 0.82, 1.0, 751, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "wait_window", "arg_names": [], "import_names": [], "rhs_call_name": "wait_window", "annotation": ""}, "snippet": " self.wait_window(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L116_C8", "label": "_init_dialog", "type": "function", "loc": [116, 121], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:ClassDef_L102_C4", "vector": [2, 2, 0.4017, 0.0203, 2, 0.69, 0.1111, 619, 0, 3, 0, 0, 0, 0, 6], "semantic": {"name": "_init_dialog", "arg_names": ["self", "parent", "title"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _init_dialog(self, parent, title):\n self.title(title)\n self.grab_set()\n self.protocol(\"WM_DELETE_WINDOW\", self._right_clicked)\n self.geometry(\"+%d+%d\" % (parent.winfo_rootx()+150,\n parent.winfo_rooty()+150))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:Expr_L117_C12", "label": "title()", "type": "expression", "loc": [117, 117], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L116_C8", "vector": [8, 3, 0.3966, 0.0034, 3, 0.31, 0.0, 48, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "title", "arg_names": [], "import_names": [], "rhs_call_name": "title", "annotation": ""}, "snippet": " self.title(title)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:Expr_L118_C12", "label": "grab_set()", "type": "expression", "loc": [118, 118], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L116_C8", "vector": [8, 3, 0.4, 0.0034, 3, 0.31, 0.3333, 82, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "grab_set", "arg_names": [], "import_names": [], "rhs_call_name": "grab_set", "annotation": ""}, "snippet": " self.grab_set()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:Expr_L119_C12", "label": "protocol()", "type": "expression", "loc": [119, 119], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L116_C8", "vector": [8, 3, 0.4034, 0.0034, 3, 0.31, 0.6667, 393, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "protocol", "arg_names": [], "import_names": [], "rhs_call_name": "protocol", "annotation": ""}, "snippet": " self.protocol(\"WM_DELETE_WINDOW\", self._right_clicked)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:Expr_L120_C12", "label": "geometry()", "type": "expression", "loc": [120, 121], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L116_C8", "vector": [8, 3, 0.4085, 0.0068, 3, 0.31, 1.0, 486, 3, 1, 0, 0, 0, 0, 3], "semantic": {"name": "geometry", "arg_names": [], "import_names": [], "rhs_call_name": "geometry", "annotation": ""}, "snippet": " self.geometry(\"+%d+%d\" % (parent.winfo_rootx()+150,\n parent.winfo_rooty()+150))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L123_C8", "label": "_create_body", "type": "function", "loc": [123, 126], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:ClassDef_L102_C4", "vector": [2, 2, 0.422, 0.0136, 2, 0.69, 0.2222, 973, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "_create_body", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _create_body(self):\n frame = Frame(self)\n self._initial_focus = self.create_components(frame)\n frame.pack(padx=5, pady=5, expand=1, fill=BOTH)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:Assign_L124_C12", "label": "frame = Frame()", "type": "assigned_variable", "loc": [124, 124], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L123_C8", "vector": [14, 3, 0.4203, 0.0034, 3, 0.32, 0.0, 313, 3, 1, 0, 0, 342, 10, 1], "semantic": {"name": "frame", "arg_names": [], "import_names": [], "rhs_call_name": "Frame", "annotation": ""}, "snippet": " frame = Frame(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:Assign_L125_C12", "label": "self._initial_focus = create_components()", "type": "assigned_variable", "loc": [125, 125], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L123_C8", "vector": [14, 3, 0.4237, 0.0034, 3, 0.32, 0.5, 639, 3, 1, 0, 0, 158, 10, 1], "semantic": {"name": "self._initial_focus", "arg_names": [], "import_names": [], "rhs_call_name": "create_components", "annotation": ""}, "snippet": " self._initial_focus = self.create_components(frame)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:Expr_L126_C12", "label": "pack()", "type": "expression", "loc": [126, 126], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L123_C8", "vector": [8, 3, 0.4271, 0.0034, 3, 0.32, 1.0, 742, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "pack", "arg_names": [], "import_names": [], "rhs_call_name": "pack", "annotation": ""}, "snippet": " frame.pack(padx=5, pady=5, expand=1, fill=BOTH)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L128_C8", "label": "_create_buttons", "type": "function", "loc": [128, 133], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:ClassDef_L102_C4", "vector": [2, 2, 0.4424, 0.0203, 2, 0.69, 0.3333, 164, 0, 1, 0, 0, 0, 0, 5], "semantic": {"name": "_create_buttons", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _create_buttons(self):\n frame = Frame(self)\n self._create_button(frame, self._left_button, self._left_clicked)\n self._create_button(frame, self._right_button, self._right_clicked)\n self.bind(\"<Escape>\", self._right_clicked)\n frame.pack()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:Assign_L129_C12", "label": "frame = Frame()", "type": "assigned_variable", "loc": [129, 129], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L128_C8", "vector": [14, 3, 0.4373, 0.0034, 3, 0.37, 0.0, 313, 3, 1, 0, 0, 342, 10, 1], "semantic": {"name": "frame", "arg_names": [], "import_names": [], "rhs_call_name": "Frame", "annotation": ""}, "snippet": " frame = Frame(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:Expr_L130_C12", "label": "_create_button()", "type": "expression", "loc": [130, 130], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L128_C8", "vector": [8, 3, 0.4407, 0.0034, 3, 0.37, 0.25, 597, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "_create_button", "arg_names": [], "import_names": [], "rhs_call_name": "_create_button", "annotation": ""}, "snippet": " self._create_button(frame, self._left_button, self._left_clicked)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:Expr_L131_C12", "label": "_create_button()", "type": "expression", "loc": [131, 131], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L128_C8", "vector": [8, 3, 0.4441, 0.0034, 3, 0.37, 0.5, 597, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "_create_button", "arg_names": [], "import_names": [], "rhs_call_name": "_create_button", "annotation": ""}, "snippet": " self._create_button(frame, self._right_button, self._right_clicked)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:Expr_L132_C12", "label": "bind()", "type": "expression", "loc": [132, 132], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L128_C8", "vector": [8, 3, 0.4475, 0.0034, 3, 0.37, 0.75, 640, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "bind", "arg_names": [], "import_names": [], "rhs_call_name": "bind", "annotation": ""}, "snippet": " self.bind(\"<Escape>\", self._right_clicked)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:Expr_L133_C12", "label": "pack()", "type": "expression", "loc": [133, 133], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L128_C8", "vector": [8, 3, 0.4508, 0.0034, 3, 0.37, 1.0, 742, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "pack", "arg_names": [], "import_names": [], "rhs_call_name": "pack", "annotation": ""}, "snippet": " frame.pack()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L135_C8", "label": "_create_button", "type": "function", "loc": [135, 137], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:ClassDef_L102_C4", "vector": [2, 2, 0.461, 0.0102, 2, 0.69, 0.4444, 597, 0, 4, 0, 0, 0, 0, 2], "semantic": {"name": "_create_button", "arg_names": ["self", "parent", "label", "command"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _create_button(self, parent, label, command):\n w = Button(parent, text=label, width=10, command=command)\n w.pack(side=LEFT, padx=5, pady=5)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:Assign_L136_C12", "label": "w = Button()", "type": "assigned_variable", "loc": [136, 136], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L135_C8", "vector": [14, 3, 0.461, 0.0034, 3, 0.1, 0.0, 549, 3, 4, 0, 0, 608, 10, 1], "semantic": {"name": "w", "arg_names": [], "import_names": [], "rhs_call_name": "Button", "annotation": ""}, "snippet": " w = Button(parent, text=label, width=10, command=command)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:Expr_L137_C12", "label": "pack()", "type": "expression", "loc": [137, 137], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L135_C8", "vector": [8, 3, 0.4644, 0.0034, 3, 0.1, 1.0, 742, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "pack", "arg_names": [], "import_names": [], "rhs_call_name": "pack", "annotation": ""}, "snippet": " w.pack(side=LEFT, padx=5, pady=5)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L139_C8", "label": "_left_clicked", "type": "function", "loc": [139, 145], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:ClassDef_L102_C4", "vector": [2, 2, 0.4814, 0.0237, 2, 0.69, 0.5556, 657, 0, 2, 0, 0, 0, 0, 5], "semantic": {"name": "_left_clicked", "arg_names": ["self", "event"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _left_clicked(self, event=None):\n if not self.validate():\n self._initial_focus.focus_set()\n return\n self.withdraw()\n self.apply()\n self.destroy()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:If_L140_C12", "label": "if", "type": "if", "loc": [140, 142], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L139_C8", "vector": [4, 3, 0.478, 0.0102, 3, 0.66, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not self.validate():\n self._initial_focus.focus_set()\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:Expr_L141_C16", "label": "focus_set()", "type": "expression", "loc": [141, 141], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:If_L140_C12", "vector": [8, 4, 0.478, 0.0034, 4, 0.72, 0.0, 278, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "focus_set", "arg_names": [], "import_names": [], "rhs_call_name": "focus_set", "annotation": ""}, "snippet": " self._initial_focus.focus_set()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:Return_L142_C16", "label": "return", "type": "return", "loc": [142, 142], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:If_L140_C12", "vector": [13, 4, 0.4814, 0.0034, 4, 0.72, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:Expr_L143_C12", "label": "withdraw()", "type": "expression", "loc": [143, 143], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L139_C8", "vector": [8, 3, 0.4847, 0.0034, 3, 0.66, 0.3333, 309, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "withdraw", "arg_names": [], "import_names": [], "rhs_call_name": "withdraw", "annotation": ""}, "snippet": " self.withdraw()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:Expr_L144_C12", "label": "apply()", "type": "expression", "loc": [144, 144], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L139_C8", "vector": [8, 3, 0.4881, 0.0034, 3, 0.66, 0.6667, 524, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "apply", "arg_names": [], "import_names": [], "rhs_call_name": "apply", "annotation": ""}, "snippet": " self.apply()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:Expr_L145_C12", "label": "destroy()", "type": "expression", "loc": [145, 145], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L139_C8", "vector": [8, 3, 0.4915, 0.0034, 3, 0.66, 1.0, 388, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "destroy", "arg_names": [], "import_names": [], "rhs_call_name": "destroy", "annotation": ""}, "snippet": " self.destroy()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L147_C8", "label": "_right_clicked", "type": "function", "loc": [147, 148], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:ClassDef_L102_C4", "vector": [2, 2, 0.5, 0.0068, 2, 0.69, 0.6667, 904, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "_right_clicked", "arg_names": ["self", "event"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _right_clicked(self, event=None):\n self.destroy()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:Expr_L148_C12", "label": "destroy()", "type": "expression", "loc": [148, 148], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L147_C8", "vector": [8, 3, 0.5017, 0.0034, 3, 0.82, 0.0, 388, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "destroy", "arg_names": [], "import_names": [], "rhs_call_name": "destroy", "annotation": ""}, "snippet": " self.destroy()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L150_C8", "label": "create_components", "type": "function", "loc": [150, 151], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:ClassDef_L102_C4", "vector": [2, 2, 0.5102, 0.0068, 2, 0.69, 0.7778, 158, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "create_components", "arg_names": ["self", "parent"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def create_components(self, parent):\n raise NotImplementedError()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L153_C8", "label": "validate", "type": "function", "loc": [153, 154], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:ClassDef_L102_C4", "vector": [2, 2, 0.5203, 0.0068, 2, 0.69, 0.8889, 628, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "validate", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def validate(self):\n raise NotImplementedError()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L156_C8", "label": "apply", "type": "function", "loc": [156, 157], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:ClassDef_L102_C4", "vector": [2, 2, 0.5305, 0.0068, 2, 0.69, 1.0, 524, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "apply", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def apply(self):\n raise NotImplementedError()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:ClassDef_L160_C4", "label": "MessageDialog", "type": "class", "loc": [160, 165], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:If_L83_C0", "vector": [3, 1, 0.5508, 0.0203, 1, 0.06, 0.3529, 934, 0, 1, 0, 0, 186, 0, 3], "semantic": {"name": "MessageDialog", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " class MessageDialog(object):\n\n @prevent_execution_with_timeouts\n def __init__(self, message):\n Tk().withdraw()\n tkMessageBox.showinfo(DIALOG_TITLE, message)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L163_C8", "label": "__init__", "type": "function", "loc": [163, 165], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:ClassDef_L160_C4", "vector": [2, 2, 0.5559, 0.0102, 2, 0.9, 0.0, 555, 0, 2, 0, 0, 0, 0, 3], "semantic": {"name": "__init__", "arg_names": ["self", "message"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, message):\n Tk().withdraw()\n tkMessageBox.showinfo(DIALOG_TITLE, message)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:Expr_L164_C12", "label": "withdraw()", "type": "expression", "loc": [164, 164], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L163_C8", "vector": [8, 3, 0.5559, 0.0034, 3, 0.68, 0.0, 309, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "withdraw", "arg_names": [], "import_names": [], "rhs_call_name": "withdraw", "annotation": ""}, "snippet": " Tk().withdraw()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:Expr_L165_C12", "label": "showinfo()", "type": "expression", "loc": [165, 165], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L163_C8", "vector": [8, 3, 0.5593, 0.0034, 3, 0.68, 1.0, 330, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "showinfo", "arg_names": [], "import_names": [], "rhs_call_name": "showinfo", "annotation": ""}, "snippet": " tkMessageBox.showinfo(DIALOG_TITLE, message)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:ClassDef_L168_C4", "label": "InputDialog", "type": "class", "loc": [168, 174], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:If_L83_C0", "vector": [3, 1, 0.5797, 0.0237, 1, 0.06, 0.4118, 841, 0, 1, 0, 0, 186, 0, 3], "semantic": {"name": "InputDialog", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " class InputDialog(object):\n\n @prevent_execution_with_timeouts\n def __init__(self, message, default):\n Tk().withdraw()\n self.result = tkSimpleDialog.askstring(DIALOG_TITLE, message,\n initialvalue=default)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L171_C8", "label": "__init__", "type": "function", "loc": [171, 174], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:ClassDef_L168_C4", "vector": [2, 2, 0.5847, 0.0136, 2, 0.94, 0.0, 555, 0, 3, 0, 0, 0, 0, 3], "semantic": {"name": "__init__", "arg_names": ["self", "message", "default"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, message, default):\n Tk().withdraw()\n self.result = tkSimpleDialog.askstring(DIALOG_TITLE, message,\n initialvalue=default)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:Expr_L172_C12", "label": "withdraw()", "type": "expression", "loc": [172, 172], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L171_C8", "vector": [8, 3, 0.5831, 0.0034, 3, 0.04, 0.0, 309, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "withdraw", "arg_names": [], "import_names": [], "rhs_call_name": "withdraw", "annotation": ""}, "snippet": " Tk().withdraw()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:Assign_L173_C12", "label": "self.result = askstring()", "type": "assigned_variable", "loc": [173, 174], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L171_C8", "vector": [14, 3, 0.5881, 0.0068, 3, 0.04, 1.0, 341, 3, 3, 0, 0, 241, 10, 1], "semantic": {"name": "self.result", "arg_names": [], "import_names": [], "rhs_call_name": "askstring", "annotation": ""}, "snippet": " self.result = tkSimpleDialog.askstring(DIALOG_TITLE, message,\n initialvalue=default)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:ClassDef_L177_C4", "label": "SelectionDialog", "type": "class", "loc": [177, 198], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:If_L83_C0", "vector": [3, 1, 0.6356, 0.0746, 1, 0.06, 0.4706, 806, 0, 4, 0, 0, 741, 0, 10], "semantic": {"name": "SelectionDialog", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " class SelectionDialog(_AbstractTkDialog):\n _left_button = 'OK'\n _right_button = 'Cancel'\n\n def __init__(self, message, values):\n self._message = message\n self._values = values\n _AbstractTkDialog.__init__(self, \"Select one option\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:Assign_L178_C8", "label": "_left_button =", "type": "assigned_variable", "loc": [178, 178], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:ClassDef_L177_C4", "vector": [14, 2, 0.6034, 0.0034, 2, 0.54, 0.0, 901, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "_left_button", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " _left_button = 'OK'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:Assign_L179_C8", "label": "_right_button =", "type": "assigned_variable", "loc": [179, 179], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:ClassDef_L177_C4", "vector": [14, 2, 0.6068, 0.0034, 2, 0.54, 0.2, 294, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "_right_button", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " _right_button = 'Cancel'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L181_C8", "label": "__init__", "type": "function", "loc": [181, 184], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:ClassDef_L177_C4", "vector": [2, 2, 0.6186, 0.0136, 2, 0.54, 0.4, 555, 0, 3, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": ["self", "message", "values"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, message, values):\n self._message = message\n self._values = values\n _AbstractTkDialog.__init__(self, \"Select one option\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:Assign_L182_C12", "label": "self._message =", "type": "assigned_variable", "loc": [182, 182], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L181_C8", "vector": [14, 3, 0.6169, 0.0034, 3, 0.01, 0.0, 771, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._message", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._message = message"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:Assign_L183_C12", "label": "self._values =", "type": "assigned_variable", "loc": [183, 183], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L181_C8", "vector": [14, 3, 0.6203, 0.0034, 3, 0.01, 0.5, 349, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._values", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._values = values"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:Expr_L184_C12", "label": "__init__()", "type": "expression", "loc": [184, 184], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L181_C8", "vector": [8, 3, 0.6237, 0.0034, 3, 0.01, 1.0, 555, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " _AbstractTkDialog.__init__(self, \"Select one option\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L186_C8", "label": "create_components", "type": "function", "loc": [186, 192], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:ClassDef_L177_C4", "vector": [2, 2, 0.6407, 0.0237, 2, 0.54, 0.6, 158, 0, 2, 1, 0, 0, 0, 5], "semantic": {"name": "create_components", "arg_names": ["self", "parent"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def create_components(self, parent):\n Label(parent, text=self._message).pack(fill=BOTH)\n self._listbox = Listbox(parent)\n self._listbox.pack(fill=BOTH)\n for item in self._values:\n self._listbox.insert(END, item)\n return self._listbox"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:Expr_L187_C12", "label": "pack()", "type": "expression", "loc": [187, 187], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L186_C8", "vector": [8, 3, 0.6339, 0.0034, 3, 0.11, 0.0, 742, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "pack", "arg_names": [], "import_names": [], "rhs_call_name": "pack", "annotation": ""}, "snippet": " Label(parent, text=self._message).pack(fill=BOTH)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:Assign_L188_C12", "label": "self._listbox = Listbox()", "type": "assigned_variable", "loc": [188, 188], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L186_C8", "vector": [14, 3, 0.6373, 0.0034, 3, 0.11, 0.25, 170, 3, 1, 0, 0, 834, 10, 1], "semantic": {"name": "self._listbox", "arg_names": [], "import_names": [], "rhs_call_name": "Listbox", "annotation": ""}, "snippet": " self._listbox = Listbox(parent)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:Expr_L189_C12", "label": "pack()", "type": "expression", "loc": [189, 189], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L186_C8", "vector": [8, 3, 0.6407, 0.0034, 3, 0.11, 0.5, 742, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "pack", "arg_names": [], "import_names": [], "rhs_call_name": "pack", "annotation": ""}, "snippet": " self._listbox.pack(fill=BOTH)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:For_L190_C12", "label": "for item", "type": "for", "loc": [190, 191], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L186_C8", "vector": [6, 3, 0.6458, 0.0068, 3, 0.11, 0.75, 434, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "item", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for item in self._values:\n self._listbox.insert(END, item)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:Expr_L191_C16", "label": "insert()", "type": "expression", "loc": [191, 191], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:For_L190_C12", "vector": [8, 4, 0.6475, 0.0034, 4, 0.03, 0.0, 368, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "insert", "arg_names": [], "import_names": [], "rhs_call_name": "insert", "annotation": ""}, "snippet": " self._listbox.insert(END, item)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:Return_L192_C12", "label": "return", "type": "return", "loc": [192, 192], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L186_C8", "vector": [13, 3, 0.6508, 0.0034, 3, 0.11, 1.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._listbox"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L194_C8", "label": "validate", "type": "function", "loc": [194, 195], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:ClassDef_L177_C4", "vector": [2, 2, 0.6593, 0.0068, 2, 0.54, 0.8, 628, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "validate", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def validate(self):\n return bool(self._listbox.curselection())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:Return_L195_C12", "label": "return", "type": "return", "loc": [195, 195], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L194_C8", "vector": [13, 3, 0.661, 0.0034, 3, 0.11, 0.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return bool(self._listbox.curselection())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L197_C8", "label": "apply", "type": "function", "loc": [197, 198], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:ClassDef_L177_C4", "vector": [2, 2, 0.6695, 0.0068, 2, 0.54, 1.0, 524, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "apply", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def apply(self):\n self.result = self._listbox.get(self._listbox.curselection())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:Assign_L198_C12", "label": "self.result = get()", "type": "assigned_variable", "loc": [198, 198], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L197_C8", "vector": [14, 3, 0.6712, 0.0034, 3, 0.23, 0.0, 341, 3, 1, 0, 0, 607, 10, 2], "semantic": {"name": "self.result", "arg_names": [], "import_names": [], "rhs_call_name": "get", "annotation": ""}, "snippet": " self.result = self._listbox.get(self._listbox.curselection())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:ClassDef_L201_C4", "label": "PassFailDialog", "type": "class", "loc": [201, 218], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:If_L83_C0", "vector": [3, 1, 0.7102, 0.061, 1, 0.06, 0.5294, 882, 0, 4, 0, 0, 741, 0, 3], "semantic": {"name": "PassFailDialog", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " class PassFailDialog(_AbstractTkDialog):\n _left_button = 'PASS'\n _right_button = 'FAIL'\n\n def __init__(self, message):\n self._message = message\n _AbstractTkDialog.__init__(self, DIALOG_TITLE)\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:Assign_L202_C8", "label": "_left_button =", "type": "assigned_variable", "loc": [202, 202], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:ClassDef_L201_C4", "vector": [14, 2, 0.6847, 0.0034, 2, 0.27, 0.0, 901, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "_left_button", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " _left_button = 'PASS'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:Assign_L203_C8", "label": "_right_button =", "type": "assigned_variable", "loc": [203, 203], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:ClassDef_L201_C4", "vector": [14, 2, 0.6881, 0.0034, 2, 0.27, 0.2, 294, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "_right_button", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " _right_button = 'FAIL'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L205_C8", "label": "__init__", "type": "function", "loc": [205, 207], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:ClassDef_L201_C4", "vector": [2, 2, 0.6983, 0.0102, 2, 0.27, 0.4, 555, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": ["self", "message"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, message):\n self._message = message\n _AbstractTkDialog.__init__(self, DIALOG_TITLE)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:Assign_L206_C12", "label": "self._message =", "type": "assigned_variable", "loc": [206, 206], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L205_C8", "vector": [14, 3, 0.6983, 0.0034, 3, 0.02, 0.0, 771, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._message", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._message = message"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:Expr_L207_C12", "label": "__init__()", "type": "expression", "loc": [207, 207], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L205_C8", "vector": [8, 3, 0.7017, 0.0034, 3, 0.02, 1.0, 555, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " _AbstractTkDialog.__init__(self, DIALOG_TITLE)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L209_C8", "label": "create_components", "type": "function", "loc": [209, 212], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:ClassDef_L201_C4", "vector": [2, 2, 0.7136, 0.0136, 2, 0.27, 0.6, 158, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "create_components", "arg_names": ["self", "parent"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def create_components(self, parent):\n label = Label(parent, text=self._message)\n label.pack(fill=BOTH)\n return label"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:Assign_L210_C12", "label": "label = Label()", "type": "assigned_variable", "loc": [210, 210], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L209_C8", "vector": [14, 3, 0.7119, 0.0034, 3, 0.45, 0.0, 811, 3, 2, 0, 0, 413, 10, 1], "semantic": {"name": "label", "arg_names": [], "import_names": [], "rhs_call_name": "Label", "annotation": ""}, "snippet": " label = Label(parent, text=self._message)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:Expr_L211_C12", "label": "pack()", "type": "expression", "loc": [211, 211], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L209_C8", "vector": [8, 3, 0.7153, 0.0034, 3, 0.45, 0.5, 742, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "pack", "arg_names": [], "import_names": [], "rhs_call_name": "pack", "annotation": ""}, "snippet": " label.pack(fill=BOTH)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:Return_L212_C12", "label": "return", "type": "return", "loc": [212, 212], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L209_C8", "vector": [13, 3, 0.7186, 0.0034, 3, 0.45, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return label"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L214_C8", "label": "validate", "type": "function", "loc": [214, 215], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:ClassDef_L201_C4", "vector": [2, 2, 0.7271, 0.0068, 2, 0.27, 0.8, 628, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "validate", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def validate(self):\n return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:Return_L215_C12", "label": "return", "type": "return", "loc": [215, 215], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L214_C8", "vector": [13, 3, 0.7288, 0.0034, 3, 0.27, 0.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L217_C8", "label": "apply", "type": "function", "loc": [217, 218], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:ClassDef_L201_C4", "vector": [2, 2, 0.7373, 0.0068, 2, 0.27, 1.0, 524, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "apply", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def apply(self):\n self.result = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:Assign_L218_C12", "label": "self.result =", "type": "assigned_variable", "loc": [218, 218], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L217_C8", "vector": [14, 3, 0.739, 0.0034, 3, 0.05, 0.0, 341, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.result", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.result = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:Import_L223_C4", "label": "time import time", "type": "import", "loc": [223, 223], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:If_L83_C0", "vector": [1, 1, 0.7559, 0.0034, 1, 0.06, 0.5882, 654, 0, 1, 0, 0, 654, 0, 0], "semantic": {"name": "time", "arg_names": [], "import_names": ["time"], "rhs_call_name": "", "annotation": ""}, "snippet": " import time"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:ImportFrom_L224_C4", "label": "from javax.swing import JOptionPane", "type": "import", "loc": [224, 224], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:If_L83_C0", "vector": [1, 1, 0.7593, 0.0034, 1, 0.06, 0.6471, 828, 0, 1, 0, 0, 828, 0, 0], "semantic": {"name": "javax.swing", "arg_names": [], "import_names": ["JOptionPane"], "rhs_call_name": "", "annotation": ""}, "snippet": " from javax.swing import JOptionPane"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:ImportFrom_L225_C4", "label": "from javax.swing.JOptionPane import PLAIN_MESSAGE, UNINITIALIZED_VALUE, YES_NO_OPTION\u2026", "type": "import", "loc": [225, 226], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:If_L83_C0", "vector": [1, 1, 0.7644, 0.0068, 1, 0.06, 0.7059, 954, 0, 5, 0, 0, 954, 0, 0], "semantic": {"name": "javax.swing.JOptionPane", "arg_names": [], "import_names": ["PLAIN_MESSAGE", "UNINITIALIZED_VALUE", "YES_NO_OPTION", "OK_CANCEL_OPTION", "DEFAULT_OPTION"], "rhs_call_name": "", "annotation": ""}, "snippet": " from javax.swing.JOptionPane import PLAIN_MESSAGE, UNINITIALIZED_VALUE, \\\n YES_NO_OPTION, OK_CANCEL_OPTION, DEFAULT_OPTION"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:ClassDef_L229_C4", "label": "_AbstractSwingDialog", "type": "class", "loc": [229, 251], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:If_L83_C0", "vector": [3, 1, 0.8136, 0.078, 1, 0.06, 0.7647, 932, 0, 4, 0, 0, 0, 0, 11], "semantic": {"name": "_AbstractSwingDialog", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " class _AbstractSwingDialog:\n\n def __init__(self, message):\n self.result = self._show_dialog(message)\n\n def _show_dialog(self, message):\n self._init_dialog(message)\n self._show_dialog_and_wait_it_to_be_closed()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L231_C8", "label": "__init__", "type": "function", "loc": [231, 232], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:ClassDef_L229_C4", "vector": [2, 2, 0.7847, 0.0068, 2, 0.46, 0.0, 555, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": ["self", "message"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, message):\n self.result = self._show_dialog(message)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:Assign_L232_C12", "label": "self.result = _show_dialog()", "type": "assigned_variable", "loc": [232, 232], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L231_C8", "vector": [14, 3, 0.7864, 0.0034, 3, 0.93, 0.0, 341, 3, 1, 0, 0, 42, 10, 1], "semantic": {"name": "self.result", "arg_names": [], "import_names": [], "rhs_call_name": "_show_dialog", "annotation": ""}, "snippet": " self.result = self._show_dialog(message)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L234_C8", "label": "_show_dialog", "type": "function", "loc": [234, 237], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:ClassDef_L229_C4", "vector": [2, 2, 0.7983, 0.0136, 2, 0.46, 0.3333, 42, 0, 2, 1, 0, 0, 0, 3], "semantic": {"name": "_show_dialog", "arg_names": ["self", "message"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _show_dialog(self, message):\n self._init_dialog(message)\n self._show_dialog_and_wait_it_to_be_closed()\n return self._get_value()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:Expr_L235_C12", "label": "_init_dialog()", "type": "expression", "loc": [235, 235], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L234_C8", "vector": [8, 3, 0.7966, 0.0034, 3, 0.24, 0.0, 619, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_init_dialog", "arg_names": [], "import_names": [], "rhs_call_name": "_init_dialog", "annotation": ""}, "snippet": " self._init_dialog(message)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:Expr_L236_C12", "label": "_show_dialog_and_wait_it_to_be_closed()", "type": "expression", "loc": [236, 236], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L234_C8", "vector": [8, 3, 0.8, 0.0034, 3, 0.24, 0.5, 474, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_show_dialog_and_wait_it_to_be_closed", "arg_names": [], "import_names": [], "rhs_call_name": "_show_dialog_and_wait_it_to_be_closed", "annotation": ""}, "snippet": " self._show_dialog_and_wait_it_to_be_closed()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:Return_L237_C12", "label": "return", "type": "return", "loc": [237, 237], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L234_C8", "vector": [13, 3, 0.8034, 0.0034, 3, 0.24, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._get_value()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L239_C8", "label": "_show_dialog_and_wait_it_to_be_closed", "type": "function", "loc": [239, 245], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:ClassDef_L229_C4", "vector": [2, 2, 0.8203, 0.0237, 2, 0.46, 0.6667, 474, 0, 1, 0, 0, 0, 0, 6], "semantic": {"name": "_show_dialog_and_wait_it_to_be_closed", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _show_dialog_and_wait_it_to_be_closed(self):\n dialog = self._pane.createDialog(None, DIALOG_TITLE)\n dialog.setModal(0);\n dialog.show()\n while dialog.isShowing():\n time.sleep(0.2)\n dialog.dispose()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:Assign_L240_C12", "label": "dialog = createDialog()", "type": "assigned_variable", "loc": [240, 240], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L239_C8", "vector": [14, 3, 0.8136, 0.0034, 3, 0.84, 0.0, 709, 3, 2, 0, 0, 890, 10, 1], "semantic": {"name": "dialog", "arg_names": [], "import_names": [], "rhs_call_name": "createDialog", "annotation": ""}, "snippet": " dialog = self._pane.createDialog(None, DIALOG_TITLE)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:Expr_L241_C12", "label": "setModal()", "type": "expression", "loc": [241, 241], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L239_C8", "vector": [8, 3, 0.8169, 0.0034, 3, 0.84, 0.25, 277, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setModal", "arg_names": [], "import_names": [], "rhs_call_name": "setModal", "annotation": ""}, "snippet": " dialog.setModal(0);"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:Expr_L242_C12", "label": "show()", "type": "expression", "loc": [242, 242], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L239_C8", "vector": [8, 3, 0.8203, 0.0034, 3, 0.84, 0.5, 497, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "show", "arg_names": [], "import_names": [], "rhs_call_name": "show", "annotation": ""}, "snippet": " dialog.show()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:While_L243_C12", "label": "while", "type": "while", "loc": [243, 244], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L239_C8", "vector": [5, 3, 0.8254, 0.0068, 3, 0.84, 0.75, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while dialog.isShowing():\n time.sleep(0.2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:Expr_L244_C16", "label": "sleep()", "type": "expression", "loc": [244, 244], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:While_L243_C12", "vector": [8, 4, 0.8271, 0.0034, 4, 0.27, 0.0, 476, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " time.sleep(0.2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:Expr_L245_C12", "label": "dispose()", "type": "expression", "loc": [245, 245], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L239_C8", "vector": [8, 3, 0.8305, 0.0034, 3, 0.84, 1.0, 428, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "dispose", "arg_names": [], "import_names": [], "rhs_call_name": "dispose", "annotation": ""}, "snippet": " dialog.dispose()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L247_C8", "label": "_get_value", "type": "function", "loc": [247, 251], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:ClassDef_L229_C4", "vector": [2, 2, 0.8441, 0.0169, 2, 0.46, 1.0, 479, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "_get_value", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _get_value(self):\n value = self._pane.getInputValue()\n if value == UNINITIALIZED_VALUE:\n return None\n return value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:Assign_L248_C12", "label": "value = getInputValue()", "type": "assigned_variable", "loc": [248, 248], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L247_C8", "vector": [14, 3, 0.8407, 0.0034, 3, 0.4, 0.0, 441, 3, 0, 0, 0, 264, 10, 1], "semantic": {"name": "value", "arg_names": [], "import_names": [], "rhs_call_name": "getInputValue", "annotation": ""}, "snippet": " value = self._pane.getInputValue()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:If_L249_C12", "label": "if", "type": "if", "loc": [249, 250], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L247_C8", "vector": [4, 3, 0.8458, 0.0068, 3, 0.4, 0.5, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if value == UNINITIALIZED_VALUE:\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:Return_L250_C16", "label": "return", "type": "return", "loc": [250, 250], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:If_L249_C12", "vector": [13, 4, 0.8475, 0.0034, 4, 0.31, 0.0, 0, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:Return_L251_C12", "label": "return", "type": "return", "loc": [251, 251], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L247_C8", "vector": [13, 3, 0.8508, 0.0034, 3, 0.4, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:ClassDef_L254_C4", "label": "MessageDialog", "type": "class", "loc": [254, 257], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:If_L83_C0", "vector": [3, 1, 0.8661, 0.0136, 1, 0.06, 0.8235, 934, 0, 1, 0, 0, 932, 0, 1], "semantic": {"name": "MessageDialog", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " class MessageDialog(_AbstractSwingDialog):\n\n def _init_dialog(self, message):\n self._pane = JOptionPane(message, PLAIN_MESSAGE, DEFAULT_OPTION)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L256_C8", "label": "_init_dialog", "type": "function", "loc": [256, 257], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:ClassDef_L254_C4", "vector": [2, 2, 0.8695, 0.0068, 2, 0.97, 0.0, 619, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "_init_dialog", "arg_names": ["self", "message"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _init_dialog(self, message):\n self._pane = JOptionPane(message, PLAIN_MESSAGE, DEFAULT_OPTION)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:Assign_L257_C12", "label": "self._pane = JOptionPane()", "type": "assigned_variable", "loc": [257, 257], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L256_C8", "vector": [14, 3, 0.8712, 0.0034, 3, 0.3, 0.0, 640, 3, 3, 0, 0, 721, 10, 1], "semantic": {"name": "self._pane", "arg_names": [], "import_names": [], "rhs_call_name": "JOptionPane", "annotation": ""}, "snippet": " self._pane = JOptionPane(message, PLAIN_MESSAGE, DEFAULT_OPTION)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:ClassDef_L260_C4", "label": "InputDialog", "type": "class", "loc": [260, 269], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:If_L83_C0", "vector": [3, 1, 0.8966, 0.0339, 1, 0.06, 0.8824, 841, 0, 2, 0, 0, 932, 0, 4], "semantic": {"name": "InputDialog", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " class InputDialog(_AbstractSwingDialog):\n\n def __init__(self, message, default):\n self._default = default\n _AbstractSwingDialog.__init__(self, message)\n\n def _init_dialog(self, message):\n self._pane = JOptionPane(message, PLAIN_MESSAGE, OK_CANCEL_OPTION)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L262_C8", "label": "__init__", "type": "function", "loc": [262, 264], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:ClassDef_L260_C4", "vector": [2, 2, 0.8915, 0.0102, 2, 0.22, 0.0, 555, 0, 3, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": ["self", "message", "default"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, message, default):\n self._default = default\n _AbstractSwingDialog.__init__(self, message)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:Assign_L263_C12", "label": "self._default =", "type": "assigned_variable", "loc": [263, 263], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L262_C8", "vector": [14, 3, 0.8915, 0.0034, 3, 0.96, 0.0, 498, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._default", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._default = default"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:Expr_L264_C12", "label": "__init__()", "type": "expression", "loc": [264, 264], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L262_C8", "vector": [8, 3, 0.8949, 0.0034, 3, 0.96, 1.0, 555, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " _AbstractSwingDialog.__init__(self, message)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L266_C8", "label": "_init_dialog", "type": "function", "loc": [266, 269], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:ClassDef_L260_C4", "vector": [2, 2, 0.9068, 0.0136, 2, 0.22, 1.0, 619, 0, 2, 0, 0, 0, 0, 3], "semantic": {"name": "_init_dialog", "arg_names": ["self", "message"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _init_dialog(self, message):\n self._pane = JOptionPane(message, PLAIN_MESSAGE, OK_CANCEL_OPTION)\n self._pane.setWantsInput(True)\n self._pane.setInitialSelectionValue(self._default)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:Assign_L267_C12", "label": "self._pane = JOptionPane()", "type": "assigned_variable", "loc": [267, 267], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L266_C8", "vector": [14, 3, 0.9051, 0.0034, 3, 0.99, 0.0, 640, 3, 3, 0, 0, 721, 10, 1], "semantic": {"name": "self._pane", "arg_names": [], "import_names": [], "rhs_call_name": "JOptionPane", "annotation": ""}, "snippet": " self._pane = JOptionPane(message, PLAIN_MESSAGE, OK_CANCEL_OPTION)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:Expr_L268_C12", "label": "setWantsInput()", "type": "expression", "loc": [268, 268], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L266_C8", "vector": [8, 3, 0.9085, 0.0034, 3, 0.99, 0.5, 442, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setWantsInput", "arg_names": [], "import_names": [], "rhs_call_name": "setWantsInput", "annotation": ""}, "snippet": " self._pane.setWantsInput(True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:Expr_L269_C12", "label": "setInitialSelectionValue()", "type": "expression", "loc": [269, 269], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L266_C8", "vector": [8, 3, 0.9119, 0.0034, 3, 0.99, 1.0, 25, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setInitialSelectionValue", "arg_names": [], "import_names": [], "rhs_call_name": "setInitialSelectionValue", "annotation": ""}, "snippet": " self._pane.setInitialSelectionValue(self._default)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:ClassDef_L272_C4", "label": "SelectionDialog", "type": "class", "loc": [272, 281], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:If_L83_C0", "vector": [3, 1, 0.9373, 0.0339, 1, 0.06, 0.9412, 806, 0, 2, 0, 0, 932, 0, 4], "semantic": {"name": "SelectionDialog", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " class SelectionDialog(_AbstractSwingDialog):\n\n def __init__(self, message, options):\n self._options = options\n _AbstractSwingDialog.__init__(self, message)\n\n def _init_dialog(self, message):\n self._pane = JOptionPane(message, PLAIN_MESSAGE, OK_CANCEL_OPTION)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L274_C8", "label": "__init__", "type": "function", "loc": [274, 276], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:ClassDef_L272_C4", "vector": [2, 2, 0.9322, 0.0102, 2, 0.21, 0.0, 555, 0, 3, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": ["self", "message", "options"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, message, options):\n self._options = options\n _AbstractSwingDialog.__init__(self, message)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:Assign_L275_C12", "label": "self._options =", "type": "assigned_variable", "loc": [275, 275], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L274_C8", "vector": [14, 3, 0.9322, 0.0034, 3, 0.01, 0.0, 920, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._options", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._options = options"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:Expr_L276_C12", "label": "__init__()", "type": "expression", "loc": [276, 276], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L274_C8", "vector": [8, 3, 0.9356, 0.0034, 3, 0.01, 1.0, 555, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " _AbstractSwingDialog.__init__(self, message)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L278_C8", "label": "_init_dialog", "type": "function", "loc": [278, 281], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:ClassDef_L272_C4", "vector": [2, 2, 0.9475, 0.0136, 2, 0.21, 1.0, 619, 0, 2, 0, 0, 0, 0, 3], "semantic": {"name": "_init_dialog", "arg_names": ["self", "message"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _init_dialog(self, message):\n self._pane = JOptionPane(message, PLAIN_MESSAGE, OK_CANCEL_OPTION)\n self._pane.setWantsInput(True)\n self._pane.setSelectionValues(self._options)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:Assign_L279_C12", "label": "self._pane = JOptionPane()", "type": "assigned_variable", "loc": [279, 279], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L278_C8", "vector": [14, 3, 0.9458, 0.0034, 3, 0.05, 0.0, 640, 3, 3, 0, 0, 721, 10, 1], "semantic": {"name": "self._pane", "arg_names": [], "import_names": [], "rhs_call_name": "JOptionPane", "annotation": ""}, "snippet": " self._pane = JOptionPane(message, PLAIN_MESSAGE, OK_CANCEL_OPTION)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:Expr_L280_C12", "label": "setWantsInput()", "type": "expression", "loc": [280, 280], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L278_C8", "vector": [8, 3, 0.9492, 0.0034, 3, 0.05, 0.5, 442, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setWantsInput", "arg_names": [], "import_names": [], "rhs_call_name": "setWantsInput", "annotation": ""}, "snippet": " self._pane.setWantsInput(True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:Expr_L281_C12", "label": "setSelectionValues()", "type": "expression", "loc": [281, 281], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L278_C8", "vector": [8, 3, 0.9525, 0.0034, 3, 0.05, 1.0, 348, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setSelectionValues", "arg_names": [], "import_names": [], "rhs_call_name": "setSelectionValues", "annotation": ""}, "snippet": " self._pane.setSelectionValues(self._options)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:ClassDef_L284_C4", "label": "PassFailDialog", "type": "class", "loc": [284, 295], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:If_L83_C0", "vector": [3, 1, 0.9814, 0.0407, 1, 0.06, 1.0, 882, 0, 2, 0, 0, 932, 0, 3], "semantic": {"name": "PassFailDialog", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " class PassFailDialog(_AbstractSwingDialog):\n\n def _init_dialog(self, message):\n self._buttons = ['PASS', 'FAIL']\n self._pane = JOptionPane(message, PLAIN_MESSAGE, YES_NO_OPTION,\n None, self._buttons, 'PASS')\n\n def _get_value(self):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L286_C8", "label": "_init_dialog", "type": "function", "loc": [286, 289], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:ClassDef_L284_C4", "vector": [2, 2, 0.9746, 0.0136, 2, 0.14, 0.0, 619, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "_init_dialog", "arg_names": ["self", "message"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _init_dialog(self, message):\n self._buttons = ['PASS', 'FAIL']\n self._pane = JOptionPane(message, PLAIN_MESSAGE, YES_NO_OPTION,\n None, self._buttons, 'PASS')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:Assign_L287_C12", "label": "self._buttons =", "type": "assigned_variable", "loc": [287, 287], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L286_C8", "vector": [14, 3, 0.9729, 0.0034, 3, 0.51, 0.0, 813, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self._buttons", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._buttons = ['PASS', 'FAIL']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:Assign_L288_C12", "label": "self._pane = JOptionPane()", "type": "assigned_variable", "loc": [288, 289], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L286_C8", "vector": [14, 3, 0.978, 0.0068, 3, 0.51, 1.0, 640, 3, 6, 0, 0, 721, 10, 1], "semantic": {"name": "self._pane", "arg_names": [], "import_names": [], "rhs_call_name": "JOptionPane", "annotation": ""}, "snippet": " self._pane = JOptionPane(message, PLAIN_MESSAGE, YES_NO_OPTION,\n None, self._buttons, 'PASS')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L291_C8", "label": "_get_value", "type": "function", "loc": [291, 295], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:ClassDef_L284_C4", "vector": [2, 2, 0.9932, 0.0169, 2, 0.14, 1.0, 479, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "_get_value", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _get_value(self):\n value = self._pane.getValue()\n if value in self._buttons and self._buttons.index(value) == 0:\n return True\n return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:Assign_L292_C12", "label": "value = getValue()", "type": "assigned_variable", "loc": [292, 292], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L291_C8", "vector": [14, 3, 0.9898, 0.0034, 3, 0.6, 0.0, 441, 3, 0, 0, 0, 804, 10, 1], "semantic": {"name": "value", "arg_names": [], "import_names": [], "rhs_call_name": "getValue", "annotation": ""}, "snippet": " value = self._pane.getValue()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:If_L293_C12", "label": "if", "type": "if", "loc": [293, 294], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L291_C8", "vector": [4, 3, 0.9949, 0.0068, 3, 0.6, 0.5, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if value in self._buttons and self._buttons.index(value) == 0:\n return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:Return_L294_C16", "label": "return", "type": "return", "loc": [294, 294], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:If_L293_C12", "vector": [13, 4, 0.9966, 0.0034, 4, 0.11, 0.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99863:Return_L295_C12", "label": "return", "type": "return", "loc": [295, 295], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L291_C8", "vector": [13, 3, 1.0, 0.0034, 3, 0.6, 1.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return False"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99863:Try_L31_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:ImportFrom_L32_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:Try_L31_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:Assign_L34_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:Try_L31_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:Assign_L36_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L42_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:Expr_L43_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L42_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:Expr_L44_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:Expr_L47_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:If_L54_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:If_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:Assign_L55_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L58_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:Expr_L59_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L58_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:Return_L65_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L67_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:Expr_L68_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L67_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:Return_L75_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L77_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:If_L78_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L77_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:Return_L80_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:If_L83_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:ImportFrom_L85_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:If_L83_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:Import_L87_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:If_L83_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:Import_L88_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:If_L83_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:ImportFrom_L89_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:If_L83_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L92_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L92_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L93_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L93_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:If_L94_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L93_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:Return_L98_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L92_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:Return_L99_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:If_L83_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:ClassDef_L102_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:ClassDef_L102_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L105_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L105_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:Assign_L106_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L105_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:Expr_L107_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L105_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:Expr_L108_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L105_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:Expr_L109_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L105_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:Expr_L110_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L105_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:Expr_L111_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L105_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:Assign_L112_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L105_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:Expr_L113_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L105_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:Expr_L114_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:ClassDef_L102_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L116_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L116_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:Expr_L117_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L116_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:Expr_L118_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L116_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:Expr_L119_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L116_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:Expr_L120_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:ClassDef_L102_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L123_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L123_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:Assign_L124_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L123_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:Assign_L125_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L123_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:Expr_L126_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:ClassDef_L102_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L128_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L128_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:Assign_L129_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L128_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:Expr_L130_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L128_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:Expr_L131_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L128_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:Expr_L132_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L128_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:Expr_L133_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:ClassDef_L102_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L135_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L135_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:Assign_L136_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L135_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:Expr_L137_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:ClassDef_L102_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L139_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L139_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:If_L140_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:If_L140_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:Expr_L141_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:If_L140_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:Return_L142_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L139_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:Expr_L143_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L139_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:Expr_L144_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L139_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:Expr_L145_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:ClassDef_L102_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L147_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L147_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:Expr_L148_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:ClassDef_L102_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L150_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:ClassDef_L102_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L153_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:ClassDef_L102_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L156_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:If_L83_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:ClassDef_L160_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:ClassDef_L160_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L163_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L163_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:Expr_L164_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L163_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:Expr_L165_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:If_L83_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:ClassDef_L168_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:ClassDef_L168_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L171_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L171_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:Expr_L172_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L171_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:Assign_L173_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:If_L83_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:ClassDef_L177_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:ClassDef_L177_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:Assign_L178_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:ClassDef_L177_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:Assign_L179_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:ClassDef_L177_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L181_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L181_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:Assign_L182_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L181_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:Assign_L183_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L181_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:Expr_L184_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:ClassDef_L177_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L186_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L186_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:Expr_L187_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L186_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:Assign_L188_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L186_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:Expr_L189_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L186_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:For_L190_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:For_L190_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:Expr_L191_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L186_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:Return_L192_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:ClassDef_L177_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L194_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L194_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:Return_L195_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:ClassDef_L177_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L197_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L197_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:Assign_L198_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:If_L83_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:ClassDef_L201_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:ClassDef_L201_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:Assign_L202_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:ClassDef_L201_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:Assign_L203_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:ClassDef_L201_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L205_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L205_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:Assign_L206_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L205_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:Expr_L207_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:ClassDef_L201_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L209_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L209_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:Assign_L210_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L209_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:Expr_L211_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L209_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:Return_L212_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:ClassDef_L201_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L214_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L214_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:Return_L215_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:ClassDef_L201_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L217_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L217_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:Assign_L218_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:If_L83_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:Import_L223_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:If_L83_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:ImportFrom_L224_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:If_L83_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:ImportFrom_L225_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:If_L83_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:ClassDef_L229_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:ClassDef_L229_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L231_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L231_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:Assign_L232_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:ClassDef_L229_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L234_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L234_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:Expr_L235_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L234_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:Expr_L236_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L234_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:Return_L237_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:ClassDef_L229_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L239_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L239_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:Assign_L240_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L239_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:Expr_L241_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L239_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:Expr_L242_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L239_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:While_L243_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:While_L243_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:Expr_L244_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L239_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:Expr_L245_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:ClassDef_L229_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L247_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L247_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:Assign_L248_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L247_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:If_L249_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:If_L249_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:Return_L250_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L247_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:Return_L251_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:If_L83_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:ClassDef_L254_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:ClassDef_L254_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L256_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L256_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:Assign_L257_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:If_L83_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:ClassDef_L260_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:ClassDef_L260_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L262_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L262_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:Assign_L263_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L262_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:Expr_L264_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:ClassDef_L260_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L266_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L266_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:Assign_L267_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L266_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:Expr_L268_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L266_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:Expr_L269_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:If_L83_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:ClassDef_L272_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:ClassDef_L272_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L274_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L274_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:Assign_L275_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L274_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:Expr_L276_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:ClassDef_L272_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L278_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L278_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:Assign_L279_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L278_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:Expr_L280_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L278_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:Expr_L281_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:If_L83_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:ClassDef_L284_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:ClassDef_L284_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L286_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L286_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:Assign_L287_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L286_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:Assign_L288_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:ClassDef_L284_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L291_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L291_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:Assign_L292_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L291_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:If_L293_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:If_L293_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:Return_L294_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99863:FunctionDef_L291_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99863:Return_L295_C12"}] |
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import telnetlib
import time
import re
import inspect
from robot.version import get_version
from robot import utils
class Telnet:
"""A test library providing communication over Telnet connections.
`Telnet` is Robot Framework's standard library that makes it
possible to connect to Telnet servers and execute commands on the
opened connections.
See `Open Connection` and `Switch Connection` for details on how
to handle multiple simultaneous connections. The responses are
expected to be ASCII encoded and all non-ASCII characters are
silently ignored.
"""
ROBOT_LIBRARY_SCOPE = 'TEST_SUITE'
ROBOT_LIBRARY_VERSION = get_version()
def __init__(self, timeout=3.0, newline='CRLF', prompt=None, prompt_is_regexp=False):
"""Telnet library can be imported with optional arguments.
Initialization parameters are used as default values when new
connections are opened with `Open Connection` keyword. They can also be
set after opening the connection using the `Set Timeout`, `Set Newline` and
`Set Prompt` keywords. See these keywords for more information.
Examples (use only one of these):
| *Setting* | *Value* | *Value* | *Value* | *Value* | *Value* | *Comment* |
| Library | Telnet | | | | | # default values |
| Library | Telnet | 0.5 | | | | # set only timeout |
| Library | Telnet | | LF | | | # set only newline |
| Library | Telnet | 2.0 | LF | | | # set timeout and newline |
| Library | Telnet | 2.0 | CRLF | $ | | # set also prompt |
| Library | Telnet | 2.0 | LF | ($|~) | True | # set prompt with simple regexp |
"""
self._timeout = timeout == '' and 3.0 or timeout
self._newline = newline == '' and 'CRLF' or newline
self._prompt = (prompt, prompt_is_regexp)
self._cache = utils.ConnectionCache()
self._conn = None
self._conn_kws = self._lib_kws = None
def get_keyword_names(self):
return self._get_library_keywords() + self._get_connection_keywords()
def _get_library_keywords(self):
if self._lib_kws is None:
self._lib_kws = [ name for name in dir(self)
if not name.startswith('_') and name != 'get_keyword_names'
and inspect.ismethod(getattr(self, name)) ]
return self._lib_kws
def _get_connection_keywords(self):
if self._conn_kws is None:
conn = self._get_connection()
excluded = [ name for name in dir(telnetlib.Telnet())
if name not in ['write', 'read', 'read_until'] ]
self._conn_kws = [ name for name in dir(conn)
if not name.startswith('_') and name not in excluded
and inspect.ismethod(getattr(conn, name)) ]
return self._conn_kws
def __getattr__(self, name):
if name not in self._get_connection_keywords():
raise AttributeError(name)
# If no connection is initialized, get attributes from a non-active
# connection. This makes it possible for Robot to create keyword
# handlers when it imports the library.
conn = self._conn is None and self._get_connection() or self._conn
return getattr(conn, name)
def open_connection(self, host, alias=None, port=23, timeout=None,
newline=None, prompt=None, prompt_is_regexp=False):
"""Opens a new Telnet connection to the given host and port.
Possible already opened connections are cached.
Returns the index of this connection, which can be used later
to switch back to the connection. The index starts from 1 and
is reset back to it when the `Close All Connections` keyword
is used.
The optional `alias` is a name for the connection, and it can
be used for switching between connections, similarly as the
index. See `Switch Connection` for more details about that.
The `timeout`, `newline`, `prompt` and `prompt_is_regexp` arguments get
default values when the library is taken into use, but setting them
here overrides those values for this connection. See `importing` for
more information.
"""
if timeout is None or timeout == '':
timeout = self._timeout
if newline is None:
newline = self._newline
if prompt is None:
prompt, prompt_is_regexp = self._prompt
print '*INFO* Opening connection to %s:%s with prompt: %s' \
% (host, port, self._prompt)
self._conn = self._get_connection(host, port, timeout, newline,
prompt, prompt_is_regexp)
return self._cache.register(self._conn, alias)
def _get_connection(self, *args):
"""Can be overridden to use a custom connection."""
return TelnetConnection(*args)
def switch_connection(self, index_or_alias):
"""Switches between active connections using an index or alias.
The index is got from `Open Connection` keyword, and an alias
can be given to it.
Returns the index of previously active connection.
Example:
| Open Connection | myhost.net | | |
| Login | john | secret | |
| Write | some command | | |
| Open Connection | yourhost.com | 2nd conn | |
| Login | root | password | |
| Write | another cmd | | |
| ${old index}= | Switch Connection | 1 | # index |
| Write | something | | |
| Switch Connection | 2nd conn | # alias | |
| Write | whatever | | |
| Switch Connection | ${old index} | # back to original again |
| [Teardown] | Close All Connections | |
The example above expects that there were no other open
connections when opening the first one, because it used index
'1' when switching to the connection later. If you are not
sure about that, you can store the index into a variable as
shown below.
| ${id} = | Open Connection | myhost.net |
| # Do something ... | | |
| Switch Connection | ${id} | |
"""
old_index = self._cache.current_index
self._conn = self._cache.switch(index_or_alias)
return old_index
def close_all_connections(self):
"""Closes all open connections and empties the connection cache.
After this keyword, new indexes got from the `Open Connection`
keyword are reset to 1.
This keyword should be used in a test or suite teardown to
make sure all connections are closed.
"""
self._conn = self._cache.close_all()
class TelnetConnection(telnetlib.Telnet):
def __init__(self, host=None, port=23, timeout=3.0, newline='CRLF',
prompt=None, prompt_is_regexp=False):
port = port == '' and 23 or int(port)
telnetlib.Telnet.__init__(self, host, port)
self.set_timeout(timeout)
self.set_newline(newline)
self.set_prompt(prompt, prompt_is_regexp)
self._default_log_level = 'INFO'
self.set_option_negotiation_callback(self._negotiate_echo_on)
def set_timeout(self, timeout):
"""Sets the timeout used in read operations to the given value.
`timeout` is given in Robot Framework's time format
(e.g. 1 minute 20 seconds) that is explained in the User Guide.
Read operations that expect some output to appear (`Read
Until`, `Read Until Regexp`, `Read Until Prompt`) use this
timeout and fail if the expected output has not appeared when
this timeout expires.
The old timeout is returned and can be used to restore it later.
Example:
| ${tout} = | Set Timeout | 2 minute 30 seconds |
| Do Something |
| Set Timeout | ${tout} |
"""
old = getattr(self, '_timeout', 3.0)
self._timeout = utils.timestr_to_secs(timeout)
return utils.secs_to_timestr(old)
def set_newline(self, newline):
"""Sets the newline used by the `Write` keyword.
Newline can be given either in escaped format using '\\n' and
'\\r', or with special 'LF' and 'CR' syntax.
Examples:
| Set Newline | \\n |
| Set Newline | CRLF |
Correct newline to use depends on the system and the default
value is 'CRLF'.
The old newline is returned and can be used to restore it later.
See `Set Prompt` or `Set Timeout` for an example.
"""
old = getattr(self, '_newline', 'CRLF')
self._newline = newline.upper().replace('LF','\n').replace('CR','\r')
return old
def close_connection(self, loglevel=None):
"""Closes the current Telnet connection and returns any remaining output.
See `Read` for more information on `loglevel`.
"""
telnetlib.Telnet.close(self)
ret = self.read_all().decode('ASCII', 'ignore')
self._log(ret, loglevel)
return ret
def login(self, username, password, login_prompt='login: ',
password_prompt='Password: '):
"""Logs in to the Telnet server with the given user information.
The login keyword reads from the connection until login_prompt
is encountered and then types the user name. Then it reads
until password_prompt is encountered and types the
password. The rest of the output (if any) is also read, and
all the text that has been read is returned as a single
string.
If a prompt has been set to this connection, either with `Open
Connection` or `Set Prompt`, this keyword reads the output
until the prompt is found. Otherwise, the keyword sleeps for a
second and reads everything that is available.
"""
ret = self.read_until(login_prompt, 'TRACE').decode('ASCII', 'ignore')
self.write_bare(username + self._newline)
ret += username + '\n'
ret += self.read_until(password_prompt, 'TRACE').decode('ASCII', 'ignore')
self.write_bare(password + self._newline)
ret += '*' * len(password) + '\n'
if self._prompt_is_set():
try:
ret += self.read_until_prompt('TRACE')
except AssertionError:
self._verify_login(ret)
raise
else:
ret += self._verify_login(ret)
self._log(ret)
return ret
def _verify_login(self, ret):
# It is necessary to wait for the 'login incorrect' message to appear.
time.sleep(1)
while True:
try:
ret += self.read_until('\n', 'TRACE').decode('ASCII', 'ignore')
except AssertionError:
return ret
else:
if 'Login incorrect' in ret:
self._log(ret)
raise AssertionError("Login incorrect")
def write(self, text, loglevel=None):
"""Writes the given text over the connection and appends a newline.
Consumes the written text (until the appended newline) from
the output and returns it. The given text must not contain
newlines.
Note: This keyword does not return the possible output of the
executed command. To get the output, one of the `Read XXX`
keywords must be used.
See `Read` for more information on `loglevel`.
"""
if self._newline in text:
raise RuntimeError("Write cannot be used with string containing "
"newlines. Use 'Write Bare' instead.")
text += self._newline
self.write_bare(text)
# Can't read until 'text' because long lines are cut strangely in the output
return self.read_until(self._newline, loglevel)
def write_bare(self, text):
"""Writes the given text over the connection without appending a newline.
Does not consume the written text.
"""
try:
text = str(text)
except UnicodeError:
raise ValueError('Only ASCII characters are allowed in Telnet. '
'Got: %s' % text)
telnetlib.Telnet.write(self, text)
def write_until_expected_output(self, text, expected, timeout,
retry_interval, loglevel=None):
"""Writes the given text repeatedly, until `expected` appears in the output.
`text` is written without appending a
newline. `retry_interval` defines the time waited before
writing `text` again. `text` is consumed from the output
before `expected` is tried to be read.
If `expected` does not appear in the output within `timeout`,
this keyword fails.
See `Read` for more information on `loglevel`.
Example:
| Write Until Expected Output | ps -ef| grep myprocess\\n | myprocess |
| ... | 5s | 0.5s |
This writes the 'ps -ef | grep myprocess\\n', until
'myprocess' appears on the output. The command is written
every 0.5 seconds and the keyword ,fails if 'myprocess' does
not appear in the output in 5 seconds.
"""
timeout = utils.timestr_to_secs(timeout)
retry_interval = utils.timestr_to_secs(retry_interval)
starttime = time.time()
while time.time() - starttime < timeout:
self.write_bare(text)
self.read_until(text, loglevel)
ret = telnetlib.Telnet.read_until(self, expected,
retry_interval).decode('ASCII', 'ignore')
self._log(ret, loglevel)
if ret.endswith(expected):
return ret
raise AssertionError("No match found for '%s' in %s"
% (expected, utils.secs_to_timestr(timeout)))
def read(self, loglevel=None):
"""Reads and returns/logs everything that is currently available in the output.
The read message is always returned and logged. The default
log level is either 'INFO', or the level set with `Set Default
Log Level`. `loglevel` can be used to override the default
log level, and the available levels are TRACE, DEBUG, INFO,
and WARN.
"""
ret = self.read_very_eager().decode('ASCII', 'ignore')
self._log(ret, loglevel)
return ret
def read_until(self, expected, loglevel=None):
"""Reads from the current output, until expected is encountered.
Text up to and including the match is returned. If no match is
found, the keyword fails.
See `Read` for more information on `loglevel`.
"""
ret = telnetlib.Telnet.read_until(self, expected,
self._timeout).decode('ASCII', 'ignore')
self._log(ret, loglevel)
if not ret.endswith(expected):
raise AssertionError("No match found for '%s' in %s"
% (expected, utils.secs_to_timestr(self._timeout)))
return ret
def read_until_regexp(self, *expected):
"""Reads from the current output, until a match to a regexp in expected.
Expected is a list of regular expression patterns as strings,
or compiled regular expressions. The keyword returns the text
up to and including the first match to any of the regular
expressions.
If the last argument in `*expected` is a valid log level, it
is used as `loglevel` in the keyword `Read`.
Examples:
| Read Until Regexp | (#|$) |
| Read Until Regexp | first_regexp | second_regexp |
| Read Until Regexp | some regexp | DEBUG |
"""
expected = list(expected)
if self._is_valid_log_level(expected[-1]):
loglevel = expected[-1]
expected = expected[:-1]
else:
loglevel = 'INFO'
try:
index, _, ret = self.expect(expected, self._timeout)
except TypeError:
index, ret = -1, ''
ret = ret.decode('ASCII', 'ignore')
self._log(ret, loglevel)
if index == -1:
expected = [ exp if isinstance(exp, basestring) else exp.pattern
for exp in expected ]
raise AssertionError("No match found for %s in %s"
% (utils.seq2str(expected, lastsep=' or '),
utils.secs_to_timestr(self._timeout)))
return ret
def read_until_prompt(self, loglevel=None):
"""Reads from the current output, until a prompt is found.
The prompt must have been set, either in the library import or
at login time, or by using the `Set Prompt` keyword.
See `Read` for more information on `loglevel`.
"""
if not self._prompt_is_set():
raise RuntimeError('Prompt is not set')
prompt, regexp = self._prompt
if regexp:
return self.read_until_regexp(prompt, loglevel)
return self.read_until(prompt, loglevel)
def execute_command(self, command, loglevel=None):
"""Executes given command and reads and returns everything until prompt.
This is a convenience keyword; following two are functionally
identical:
| ${out} = | Execute Command | Some command |
| Write | Some command |
| ${out} = | Read Until Prompt |
This keyword expects a prompt to be set, see `Read Until
Prompt` for details.
See `Read` for more information on `loglevel`.
"""
self.write(command, loglevel)
return self.read_until_prompt(loglevel)
def set_prompt(self, prompt, prompt_is_regexp=False):
"""Sets the prompt used in this connection to `prompt`.
If `prompt_is_regexp` is a non-empty string, the given prompt is
considered to be a regular expression.
The old prompt is returned and can be used to restore it later.
Example:
| ${prompt} | ${regexp} = | Set Prompt | $ |
| Do Something |
| Set Prompt | ${prompt} | ${regexp} |
"""
old = hasattr(self, '_prompt') and self._prompt or (None, False)
if prompt_is_regexp:
self._prompt = (re.compile(prompt), True)
else:
self._prompt = (prompt, False)
if old[1]:
return old[0].pattern, True
return old
def _prompt_is_set(self):
return self._prompt[0] is not None
def set_default_log_level(self, level):
"""Sets the default log level used by all read keywords.
The possible values are TRACE, DEBUG, INFO and WARN. The default is
INFO. The old value is returned and can be used to restore it later,
similarly as with `Set Timeout`.
"""
self._is_valid_log_level(level, raise_if_invalid=True)
old = self._default_log_level
self._default_log_level = level.upper()
return old
def _log(self, msg, level=None):
self._is_valid_log_level(level, raise_if_invalid=True)
msg = msg.strip()
if level is None:
level = self._default_log_level
if msg != '':
print '*%s* %s' % (level.upper(), msg)
def _is_valid_log_level(self, level, raise_if_invalid=False):
if level is None:
return True
if isinstance(level, basestring) and \
level.upper() in ['TRACE', 'DEBUG', 'INFO', 'WARN']:
return True
if not raise_if_invalid:
return False
raise AssertionError("Invalid log level '%s'" % level)
def _negotiate_echo_on(self, sock, cmd, opt):
# This is supposed to turn server side echoing on and turn other options off.
if opt == telnetlib.ECHO and cmd in (telnetlib.WILL, telnetlib.WONT):
self.sock.sendall(telnetlib.IAC + telnetlib.DO + opt)
elif opt != telnetlib.NOOPT:
if cmd in (telnetlib.DO, telnetlib.DONT):
self.sock.sendall(telnetlib.IAC + telnetlib.WONT + opt)
elif cmd in (telnetlib.WILL, telnetlib.WONT):
self.sock.sendall(telnetlib.IAC + telnetlib.DONT + opt)
| ajibawa-2023/Python-Code-Large/train/row_99864 | 195 | 520 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99864:Import_L16_C0", "label": "telnetlib import telnetlib", "type": "import", "loc": [16, 16], "level": 0, "parent": null, "vector": [1, 0, 0.0308, 0.0019, 0, 0.66, 0.0, 248, 0, 1, 0, 0, 248, 0, 0], "semantic": {"name": "telnetlib", "arg_names": [], "import_names": ["telnetlib"], "rhs_call_name": "", "annotation": ""}, "snippet": "import telnetlib"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:Import_L17_C0", "label": "time import time", "type": "import", "loc": [17, 17], "level": 0, "parent": null, "vector": [1, 0, 0.0327, 0.0019, 0, 0.66, 0.1429, 654, 0, 1, 0, 0, 654, 0, 0], "semantic": {"name": "time", "arg_names": [], "import_names": ["time"], "rhs_call_name": "", "annotation": ""}, "snippet": "import time"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:Import_L18_C0", "label": "re import re", "type": "import", "loc": [18, 18], "level": 0, "parent": null, "vector": [1, 0, 0.0346, 0.0019, 0, 0.66, 0.2857, 540, 0, 1, 0, 0, 540, 0, 0], "semantic": {"name": "re", "arg_names": [], "import_names": ["re"], "rhs_call_name": "", "annotation": ""}, "snippet": "import re"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:Import_L19_C0", "label": "inspect import inspect", "type": "import", "loc": [19, 19], "level": 0, "parent": null, "vector": [1, 0, 0.0365, 0.0019, 0, 0.66, 0.4286, 878, 0, 1, 0, 0, 878, 0, 0], "semantic": {"name": "inspect", "arg_names": [], "import_names": ["inspect"], "rhs_call_name": "", "annotation": ""}, "snippet": "import inspect"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:ImportFrom_L21_C0", "label": "from robot.version import get_version", "type": "import", "loc": [21, 21], "level": 0, "parent": null, "vector": [1, 0, 0.0404, 0.0019, 0, 0.66, 0.5714, 622, 0, 1, 0, 0, 622, 0, 0], "semantic": {"name": "robot.version", "arg_names": [], "import_names": ["get_version"], "rhs_call_name": "", "annotation": ""}, "snippet": "from robot.version import get_version"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:ImportFrom_L22_C0", "label": "from robot import utils", "type": "import", "loc": [22, 22], "level": 0, "parent": null, "vector": [1, 0, 0.0423, 0.0019, 0, 0.66, 0.7143, 735, 0, 1, 0, 0, 735, 0, 0], "semantic": {"name": "robot", "arg_names": [], "import_names": ["utils"], "rhs_call_name": "", "annotation": ""}, "snippet": "from robot import utils"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:ClassDef_L25_C0", "label": "Telnet", "type": "class", "loc": [25, 175], "level": 0, "parent": null, "vector": [3, 0, 0.1923, 0.2904, 0, 0.66, 0.8571, 321, 0, 9, 0, 0, 0, 0, 24], "semantic": {"name": "Telnet", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Telnet:\n\n \"\"\"A test library providing communication over Telnet connections.\n\n `Telnet` is Robot Framework's standard library that makes it\n possible to connect to Telnet servers and execute commands on the\n opened connections.\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:Expr_L27_C4", "label": "expression", "type": "expression", "loc": [27, 37], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:ClassDef_L25_C0", "vector": [8, 1, 0.0615, 0.0212, 1, 0.47, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"A test library providing communication over Telnet connections.\n\n `Telnet` is Robot Framework's standard library that makes it\n possible to connect to Telnet servers and execute commands on the\n opened connections.\n\n See `Open Connection` and `Switch Connection` for details on how\n to handle multiple simultaneous connections. The responses are"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:Assign_L39_C4", "label": "ROBOT_LIBRARY_SCOPE =", "type": "assigned_variable", "loc": [39, 39], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:ClassDef_L25_C0", "vector": [14, 1, 0.075, 0.0019, 1, 0.47, 0.0909, 305, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "ROBOT_LIBRARY_SCOPE", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ROBOT_LIBRARY_SCOPE = 'TEST_SUITE'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:Assign_L40_C4", "label": "ROBOT_LIBRARY_VERSION = get_version()", "type": "assigned_variable", "loc": [40, 40], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:ClassDef_L25_C0", "vector": [14, 1, 0.0769, 0.0019, 1, 0.47, 0.1818, 466, 3, 0, 0, 0, 75, 10, 1], "semantic": {"name": "ROBOT_LIBRARY_VERSION", "arg_names": [], "import_names": [], "rhs_call_name": "get_version", "annotation": ""}, "snippet": " ROBOT_LIBRARY_VERSION = get_version()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L42_C4", "label": "__init__", "type": "function", "loc": [42, 65], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:ClassDef_L25_C0", "vector": [2, 1, 0.1029, 0.0462, 1, 0.47, 0.2727, 555, 0, 5, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": ["self", "timeout", "newline", "prompt", "prompt_is_regexp"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, timeout=3.0, newline='CRLF', prompt=None, prompt_is_regexp=False):\n \"\"\"Telnet library can be imported with optional arguments.\n\n Initialization parameters are used as default values when new\n connections are opened with `Open Connection` keyword. They can also be\n set after opening the connection using the `Set Timeout`, `Set Newline` and\n `Set Prompt` keywords. See these keywords for more information.\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:Expr_L43_C8", "label": "expression", "type": "expression", "loc": [43, 59], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L42_C4", "vector": [8, 2, 0.0981, 0.0327, 2, 0.11, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Telnet library can be imported with optional arguments.\n\n Initialization parameters are used as default values when new\n connections are opened with `Open Connection` keyword. They can also be\n set after opening the connection using the `Set Timeout`, `Set Newline` and\n `Set Prompt` keywords. See these keywords for more information.\n\n Examples (use only one of these):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:Assign_L60_C8", "label": "self._timeout =", "type": "assigned_variable", "loc": [60, 60], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L42_C4", "vector": [14, 2, 0.1154, 0.0019, 2, 0.11, 0.1667, 347, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._timeout", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._timeout = timeout == '' and 3.0 or timeout"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:Assign_L61_C8", "label": "self._newline =", "type": "assigned_variable", "loc": [61, 61], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L42_C4", "vector": [14, 2, 0.1173, 0.0019, 2, 0.11, 0.3333, 758, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._newline", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._newline = newline == '' and 'CRLF' or newline"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:Assign_L62_C8", "label": "self._prompt =", "type": "assigned_variable", "loc": [62, 62], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L42_C4", "vector": [14, 2, 0.1192, 0.0019, 2, 0.11, 0.5, 332, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "self._prompt", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._prompt = (prompt, prompt_is_regexp)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:Assign_L63_C8", "label": "self._cache = ConnectionCache()", "type": "assigned_variable", "loc": [63, 63], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L42_C4", "vector": [14, 2, 0.1212, 0.0019, 2, 0.11, 0.6667, 723, 3, 0, 0, 0, 797, 10, 1], "semantic": {"name": "self._cache", "arg_names": [], "import_names": [], "rhs_call_name": "ConnectionCache", "annotation": ""}, "snippet": " self._cache = utils.ConnectionCache()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:Assign_L64_C8", "label": "self._conn =", "type": "assigned_variable", "loc": [64, 64], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L42_C4", "vector": [14, 2, 0.1231, 0.0019, 2, 0.11, 0.8333, 146, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self._conn", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._conn = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:Assign_L65_C8", "label": "self._conn_kws =", "type": "assigned_variable", "loc": [65, 65], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L42_C4", "vector": [14, 2, 0.125, 0.0019, 2, 0.11, 1.0, 46, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self._conn_kws", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._conn_kws = self._lib_kws = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L67_C4", "label": "get_keyword_names", "type": "function", "loc": [67, 68], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:ClassDef_L25_C0", "vector": [2, 1, 0.1298, 0.0038, 1, 0.47, 0.3636, 768, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "get_keyword_names", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_keyword_names(self):\n return self._get_library_keywords() + self._get_connection_keywords()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:Return_L68_C8", "label": "return", "type": "return", "loc": [68, 68], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L67_C4", "vector": [13, 2, 0.1308, 0.0019, 2, 0.2, 0.0, 0, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._get_library_keywords() + self._get_connection_keywords()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L70_C4", "label": "_get_library_keywords", "type": "function", "loc": [70, 75], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:ClassDef_L25_C0", "vector": [2, 1, 0.1394, 0.0115, 1, 0.47, 0.4545, 420, 0, 1, 1, 0, 0, 0, 4], "semantic": {"name": "_get_library_keywords", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _get_library_keywords(self):\n if self._lib_kws is None:\n self._lib_kws = [ name for name in dir(self)\n if not name.startswith('_') and name != 'get_keyword_names'\n and inspect.ismethod(getattr(self, name)) ]\n return self._lib_kws"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:If_L71_C8", "label": "if", "type": "if", "loc": [71, 74], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L70_C4", "vector": [4, 2, 0.1394, 0.0077, 2, 0.73, 0.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self._lib_kws is None:\n self._lib_kws = [ name for name in dir(self)\n if not name.startswith('_') and name != 'get_keyword_names'\n and inspect.ismethod(getattr(self, name)) ]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:Assign_L72_C12", "label": "self._lib_kws =", "type": "assigned_variable", "loc": [72, 74], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:If_L71_C8", "vector": [14, 3, 0.1404, 0.0058, 3, 0.93, 0.0, 277, 5, 0, 0, 0, 0, 0, 4], "semantic": {"name": "self._lib_kws", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._lib_kws = [ name for name in dir(self)\n if not name.startswith('_') and name != 'get_keyword_names'\n and inspect.ismethod(getattr(self, name)) ]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:Return_L75_C8", "label": "return", "type": "return", "loc": [75, 75], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L70_C4", "vector": [13, 2, 0.1442, 0.0019, 2, 0.73, 1.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._lib_kws"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L77_C4", "label": "_get_connection_keywords", "type": "function", "loc": [77, 85], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:ClassDef_L25_C0", "vector": [2, 1, 0.1558, 0.0173, 1, 0.47, 0.5455, 596, 0, 1, 1, 0, 0, 0, 7], "semantic": {"name": "_get_connection_keywords", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _get_connection_keywords(self):\n if self._conn_kws is None:\n conn = self._get_connection()\n excluded = [ name for name in dir(telnetlib.Telnet())\n if name not in ['write', 'read', 'read_until'] ]\n self._conn_kws = [ name for name in dir(conn)\n if not name.startswith('_') and name not in excluded\n and inspect.ismethod(getattr(conn, name)) ]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:If_L78_C8", "label": "if", "type": "if", "loc": [78, 84], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L77_C4", "vector": [4, 2, 0.1558, 0.0135, 2, 0.21, 0.0, 0, 0, 0, 0, 0, 0, 0, 7], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self._conn_kws is None:\n conn = self._get_connection()\n excluded = [ name for name in dir(telnetlib.Telnet())\n if name not in ['write', 'read', 'read_until'] ]\n self._conn_kws = [ name for name in dir(conn)\n if not name.startswith('_') and name not in excluded\n and inspect.ismethod(getattr(conn, name)) ]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:Assign_L79_C12", "label": "conn = _get_connection()", "type": "assigned_variable", "loc": [79, 79], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:If_L78_C8", "vector": [14, 3, 0.1519, 0.0019, 3, 0.4, 0.0, 345, 3, 0, 0, 0, 191, 10, 1], "semantic": {"name": "conn", "arg_names": [], "import_names": [], "rhs_call_name": "_get_connection", "annotation": ""}, "snippet": " conn = self._get_connection()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:Assign_L80_C12", "label": "excluded =", "type": "assigned_variable", "loc": [80, 81], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:If_L78_C8", "vector": [14, 3, 0.1548, 0.0038, 3, 0.4, 0.5, 44, 5, 0, 0, 0, 0, 0, 2], "semantic": {"name": "excluded", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " excluded = [ name for name in dir(telnetlib.Telnet())\n if name not in ['write', 'read', 'read_until'] ]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:Assign_L82_C12", "label": "self._conn_kws =", "type": "assigned_variable", "loc": [82, 84], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:If_L78_C8", "vector": [14, 3, 0.1596, 0.0058, 3, 0.4, 1.0, 46, 5, 0, 0, 0, 0, 0, 4], "semantic": {"name": "self._conn_kws", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._conn_kws = [ name for name in dir(conn)\n if not name.startswith('_') and name not in excluded\n and inspect.ismethod(getattr(conn, name)) ]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:Return_L85_C8", "label": "return", "type": "return", "loc": [85, 85], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L77_C4", "vector": [13, 2, 0.1635, 0.0019, 2, 0.21, 1.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._conn_kws"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L87_C4", "label": "__getattr__", "type": "function", "loc": [87, 94], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:ClassDef_L25_C0", "vector": [2, 1, 0.174, 0.0154, 1, 0.47, 0.6364, 210, 0, 2, 1, 0, 0, 0, 4], "semantic": {"name": "__getattr__", "arg_names": ["self", "name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __getattr__(self, name):\n if name not in self._get_connection_keywords():\n raise AttributeError(name)\n # If no connection is initialized, get attributes from a non-active\n # connection. This makes it possible for Robot to create keyword\n # handlers when it imports the library.\n conn = self._conn is None and self._get_connection() or self._conn\n return getattr(conn, name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:If_L88_C8", "label": "if", "type": "if", "loc": [88, 89], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L87_C4", "vector": [4, 2, 0.1702, 0.0038, 2, 0.75, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if name not in self._get_connection_keywords():\n raise AttributeError(name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:Assign_L93_C8", "label": "conn =", "type": "assigned_variable", "loc": [93, 93], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L87_C4", "vector": [14, 2, 0.1788, 0.0019, 2, 0.75, 0.5, 345, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "conn", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " conn = self._conn is None and self._get_connection() or self._conn"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:Return_L94_C8", "label": "return", "type": "return", "loc": [94, 94], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L87_C4", "vector": [13, 2, 0.1808, 0.0019, 2, 0.75, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return getattr(conn, name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L96_C4", "label": "open_connection", "type": "function", "loc": [96, 124], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:ClassDef_L25_C0", "vector": [2, 1, 0.2115, 0.0558, 1, 0.47, 0.7273, 225, 0, 8, 1, 0, 0, 0, 2], "semantic": {"name": "open_connection", "arg_names": ["self", "host", "alias", "port", "timeout", "newline", "prompt", "prompt_is_regexp"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def open_connection(self, host, alias=None, port=23, timeout=None,\n newline=None, prompt=None, prompt_is_regexp=False):\n \"\"\"Opens a new Telnet connection to the given host and port.\n\n Possible already opened connections are cached.\n\n Returns the index of this connection, which can be used later\n to switch back to the connection. The index starts from 1 and"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:Expr_L98_C8", "label": "expression", "type": "expression", "loc": [98, 115], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L96_C4", "vector": [8, 2, 0.2048, 0.0346, 2, 0.95, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Opens a new Telnet connection to the given host and port.\n\n Possible already opened connections are cached.\n\n Returns the index of this connection, which can be used later\n to switch back to the connection. The index starts from 1 and\n is reset back to it when the `Close All Connections` keyword\n is used."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:If_L116_C8", "label": "if", "type": "if", "loc": [116, 117], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L96_C4", "vector": [4, 2, 0.224, 0.0038, 2, 0.95, 0.2, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if timeout is None or timeout == '':\n timeout = self._timeout"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:Assign_L117_C12", "label": "timeout =", "type": "assigned_variable", "loc": [117, 117], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:If_L116_C8", "vector": [14, 3, 0.225, 0.0019, 3, 0.7, 0.0, 616, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "timeout", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " timeout = self._timeout"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:If_L118_C8", "label": "if", "type": "if", "loc": [118, 119], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L96_C4", "vector": [4, 2, 0.2279, 0.0038, 2, 0.95, 0.4, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if newline is None:\n newline = self._newline"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:Assign_L119_C12", "label": "newline =", "type": "assigned_variable", "loc": [119, 119], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:If_L118_C8", "vector": [14, 3, 0.2288, 0.0019, 3, 0.64, 0.0, 719, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "newline", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " newline = self._newline"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:If_L120_C8", "label": "if", "type": "if", "loc": [120, 121], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L96_C4", "vector": [4, 2, 0.2317, 0.0038, 2, 0.95, 0.6, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if prompt is None:\n prompt, prompt_is_regexp = self._prompt"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:Assign_L121_C12", "label": "prompt, prompt_is_regexp =", "type": "assigned_variable", "loc": [121, 121], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:If_L120_C8", "vector": [14, 3, 0.2327, 0.0019, 3, 0.86, 0.0, 82, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "prompt, prompt_is_regexp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " prompt, prompt_is_regexp = self._prompt"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:Assign_L122_C8", "label": "self._conn = _get_connection()", "type": "assigned_variable", "loc": [122, 123], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L96_C4", "vector": [14, 2, 0.2356, 0.0038, 2, 0.95, 0.8, 146, 3, 6, 0, 0, 191, 10, 1], "semantic": {"name": "self._conn", "arg_names": [], "import_names": [], "rhs_call_name": "_get_connection", "annotation": ""}, "snippet": " self._conn = self._get_connection(host, port, timeout, newline,\n prompt, prompt_is_regexp)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:Return_L124_C8", "label": "return", "type": "return", "loc": [124, 124], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L96_C4", "vector": [13, 2, 0.2385, 0.0019, 2, 0.95, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._cache.register(self._conn, alias)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L126_C4", "label": "_get_connection", "type": "function", "loc": [126, 128], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:ClassDef_L25_C0", "vector": [2, 1, 0.2442, 0.0058, 1, 0.47, 0.8182, 191, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "_get_connection", "arg_names": ["self", "args"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _get_connection(self, *args):\n \"\"\"Can be overridden to use a custom connection.\"\"\"\n return TelnetConnection(*args)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:Expr_L127_C8", "label": "expression", "type": "expression", "loc": [127, 127], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L126_C4", "vector": [8, 2, 0.2442, 0.0019, 2, 0.53, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Can be overridden to use a custom connection.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:Return_L128_C8", "label": "return", "type": "return", "loc": [128, 128], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L126_C4", "vector": [13, 2, 0.2462, 0.0019, 2, 0.53, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return TelnetConnection(*args)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L130_C4", "label": "switch_connection", "type": "function", "loc": [130, 164], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:ClassDef_L25_C0", "vector": [2, 1, 0.2827, 0.0673, 1, 0.47, 0.9091, 857, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "switch_connection", "arg_names": ["self", "index_or_alias"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def switch_connection(self, index_or_alias):\n \"\"\"Switches between active connections using an index or alias.\n\n The index is got from `Open Connection` keyword, and an alias\n can be given to it.\n\n Returns the index of previously active connection.\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:Expr_L131_C8", "label": "expression", "type": "expression", "loc": [131, 161], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L130_C4", "vector": [8, 2, 0.2808, 0.0596, 2, 0.95, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Switches between active connections using an index or alias.\n\n The index is got from `Open Connection` keyword, and an alias\n can be given to it.\n\n Returns the index of previously active connection.\n\n Example:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:Assign_L162_C8", "label": "old_index =", "type": "assigned_variable", "loc": [162, 162], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L130_C4", "vector": [14, 2, 0.3115, 0.0019, 2, 0.95, 0.3333, 937, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "old_index", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " old_index = self._cache.current_index"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:Assign_L163_C8", "label": "self._conn = switch()", "type": "assigned_variable", "loc": [163, 163], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L130_C4", "vector": [14, 2, 0.3135, 0.0019, 2, 0.95, 0.6667, 146, 3, 1, 0, 0, 748, 10, 1], "semantic": {"name": "self._conn", "arg_names": [], "import_names": [], "rhs_call_name": "switch", "annotation": ""}, "snippet": " self._conn = self._cache.switch(index_or_alias)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:Return_L164_C8", "label": "return", "type": "return", "loc": [164, 164], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L130_C4", "vector": [13, 2, 0.3154, 0.0019, 2, 0.95, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return old_index"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L166_C4", "label": "close_all_connections", "type": "function", "loc": [166, 175], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:ClassDef_L25_C0", "vector": [2, 1, 0.3279, 0.0192, 1, 0.47, 1.0, 212, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "close_all_connections", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def close_all_connections(self):\n \"\"\"Closes all open connections and empties the connection cache.\n\n After this keyword, new indexes got from the `Open Connection`\n keyword are reset to 1.\n\n This keyword should be used in a test or suite teardown to\n make sure all connections are closed."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:Expr_L167_C8", "label": "expression", "type": "expression", "loc": [167, 174], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L166_C4", "vector": [8, 2, 0.3279, 0.0154, 2, 0.74, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Closes all open connections and empties the connection cache.\n\n After this keyword, new indexes got from the `Open Connection`\n keyword are reset to 1.\n\n This keyword should be used in a test or suite teardown to\n make sure all connections are closed.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:Assign_L175_C8", "label": "self._conn = close_all()", "type": "assigned_variable", "loc": [175, 175], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L166_C4", "vector": [14, 2, 0.3365, 0.0019, 2, 0.74, 1.0, 146, 3, 0, 0, 0, 720, 10, 1], "semantic": {"name": "self._conn", "arg_names": [], "import_names": [], "rhs_call_name": "close_all", "annotation": ""}, "snippet": " self._conn = self._cache.close_all()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:ClassDef_L178_C0", "label": "TelnetConnection", "type": "class", "loc": [178, 520], "level": 0, "parent": null, "vector": [3, 0, 0.6712, 0.6596, 0, 0.66, 1.0, 171, 0, 20, 0, 0, 117, 0, 90], "semantic": {"name": "TelnetConnection", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class TelnetConnection(telnetlib.Telnet):\n\n def __init__(self, host=None, port=23, timeout=3.0, newline='CRLF',\n prompt=None, prompt_is_regexp=False):\n port = port == '' and 23 or int(port)\n telnetlib.Telnet.__init__(self, host, port)\n self.set_timeout(timeout)\n self.set_newline(newline)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L180_C4", "label": "__init__", "type": "function", "loc": [180, 188], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:ClassDef_L178_C0", "vector": [2, 1, 0.3538, 0.0173, 1, 0.78, 0.0, 555, 0, 7, 0, 0, 0, 0, 6], "semantic": {"name": "__init__", "arg_names": ["self", "host", "port", "timeout", "newline", "prompt", "prompt_is_regexp"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, host=None, port=23, timeout=3.0, newline='CRLF',\n prompt=None, prompt_is_regexp=False):\n port = port == '' and 23 or int(port)\n telnetlib.Telnet.__init__(self, host, port)\n self.set_timeout(timeout)\n self.set_newline(newline)\n self.set_prompt(prompt, prompt_is_regexp)\n self._default_log_level = 'INFO'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:Assign_L182_C8", "label": "port =", "type": "assigned_variable", "loc": [182, 182], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L180_C4", "vector": [14, 2, 0.35, 0.0019, 2, 0.85, 0.0, 308, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "port", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " port = port == '' and 23 or int(port)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:Expr_L183_C8", "label": "__init__()", "type": "expression", "loc": [183, 183], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L180_C4", "vector": [8, 2, 0.3519, 0.0019, 2, 0.85, 0.1667, 555, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " telnetlib.Telnet.__init__(self, host, port)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:Expr_L184_C8", "label": "set_timeout()", "type": "expression", "loc": [184, 184], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L180_C4", "vector": [8, 2, 0.3538, 0.0019, 2, 0.85, 0.3333, 91, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_timeout", "arg_names": [], "import_names": [], "rhs_call_name": "set_timeout", "annotation": ""}, "snippet": " self.set_timeout(timeout)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:Expr_L185_C8", "label": "set_newline()", "type": "expression", "loc": [185, 185], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L180_C4", "vector": [8, 2, 0.3558, 0.0019, 2, 0.85, 0.5, 554, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_newline", "arg_names": [], "import_names": [], "rhs_call_name": "set_newline", "annotation": ""}, "snippet": " self.set_newline(newline)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:Expr_L186_C8", "label": "set_prompt()", "type": "expression", "loc": [186, 186], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L180_C4", "vector": [8, 2, 0.3577, 0.0019, 2, 0.85, 0.6667, 768, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "set_prompt", "arg_names": [], "import_names": [], "rhs_call_name": "set_prompt", "annotation": ""}, "snippet": " self.set_prompt(prompt, prompt_is_regexp)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:Assign_L187_C8", "label": "self._default_log_level =", "type": "assigned_variable", "loc": [187, 187], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L180_C4", "vector": [14, 2, 0.3596, 0.0019, 2, 0.85, 0.8333, 371, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "self._default_log_level", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._default_log_level = 'INFO'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:Expr_L188_C8", "label": "set_option_negotiation_callback()", "type": "expression", "loc": [188, 188], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L180_C4", "vector": [8, 2, 0.3615, 0.0019, 2, 0.85, 1.0, 106, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_option_negotiation_callback", "arg_names": [], "import_names": [], "rhs_call_name": "set_option_negotiation_callback", "annotation": ""}, "snippet": " self.set_option_negotiation_callback(self._negotiate_echo_on)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L190_C4", "label": "set_timeout", "type": "function", "loc": [190, 210], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:ClassDef_L178_C0", "vector": [2, 1, 0.3846, 0.0404, 1, 0.78, 0.0526, 91, 0, 2, 1, 0, 0, 0, 3], "semantic": {"name": "set_timeout", "arg_names": ["self", "timeout"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def set_timeout(self, timeout):\n \"\"\"Sets the timeout used in read operations to the given value.\n\n `timeout` is given in Robot Framework's time format\n (e.g. 1 minute 20 seconds) that is explained in the User Guide.\n\n Read operations that expect some output to appear (`Read\n Until`, `Read Until Regexp`, `Read Until Prompt`) use this"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:Expr_L191_C8", "label": "expression", "type": "expression", "loc": [191, 207], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L190_C4", "vector": [8, 2, 0.3827, 0.0327, 2, 0.05, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Sets the timeout used in read operations to the given value.\n\n `timeout` is given in Robot Framework's time format\n (e.g. 1 minute 20 seconds) that is explained in the User Guide.\n\n Read operations that expect some output to appear (`Read\n Until`, `Read Until Regexp`, `Read Until Prompt`) use this\n timeout and fail if the expected output has not appeared when"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:Assign_L208_C8", "label": "old = getattr()", "type": "assigned_variable", "loc": [208, 208], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L190_C4", "vector": [14, 2, 0.4, 0.0019, 2, 0.05, 0.3333, 206, 3, 3, 0, 0, 121, 10, 1], "semantic": {"name": "old", "arg_names": [], "import_names": [], "rhs_call_name": "getattr", "annotation": ""}, "snippet": " old = getattr(self, '_timeout', 3.0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:Assign_L209_C8", "label": "self._timeout = timestr_to_secs()", "type": "assigned_variable", "loc": [209, 209], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L190_C4", "vector": [14, 2, 0.4019, 0.0019, 2, 0.05, 0.6667, 347, 3, 1, 0, 0, 329, 10, 1], "semantic": {"name": "self._timeout", "arg_names": [], "import_names": [], "rhs_call_name": "timestr_to_secs", "annotation": ""}, "snippet": " self._timeout = utils.timestr_to_secs(timeout)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:Return_L210_C8", "label": "return", "type": "return", "loc": [210, 210], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L190_C4", "vector": [13, 2, 0.4038, 0.0019, 2, 0.05, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return utils.secs_to_timestr(old)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L212_C4", "label": "set_newline", "type": "function", "loc": [212, 230], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:ClassDef_L178_C0", "vector": [2, 1, 0.425, 0.0365, 1, 0.78, 0.1053, 554, 0, 2, 1, 0, 0, 0, 4], "semantic": {"name": "set_newline", "arg_names": ["self", "newline"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def set_newline(self, newline):\n \"\"\"Sets the newline used by the `Write` keyword.\n\n Newline can be given either in escaped format using '\\\\n' and\n '\\\\r', or with special 'LF' and 'CR' syntax.\n\n Examples:\n | Set Newline | \\\\n |"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:Expr_L213_C8", "label": "expression", "type": "expression", "loc": [213, 227], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L212_C4", "vector": [8, 2, 0.4231, 0.0288, 2, 0.97, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Sets the newline used by the `Write` keyword.\n\n Newline can be given either in escaped format using '\\\\n' and\n '\\\\r', or with special 'LF' and 'CR' syntax.\n\n Examples:\n | Set Newline | \\\\n |\n | Set Newline | CRLF |"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:Assign_L228_C8", "label": "old = getattr()", "type": "assigned_variable", "loc": [228, 228], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L212_C4", "vector": [14, 2, 0.4385, 0.0019, 2, 0.97, 0.3333, 206, 3, 3, 0, 0, 121, 10, 1], "semantic": {"name": "old", "arg_names": [], "import_names": [], "rhs_call_name": "getattr", "annotation": ""}, "snippet": " old = getattr(self, '_newline', 'CRLF')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:Assign_L229_C8", "label": "self._newline = replace()", "type": "assigned_variable", "loc": [229, 229], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L212_C4", "vector": [14, 2, 0.4404, 0.0019, 2, 0.97, 0.6667, 758, 3, 2, 0, 0, 293, 10, 3], "semantic": {"name": "self._newline", "arg_names": [], "import_names": [], "rhs_call_name": "replace", "annotation": ""}, "snippet": " self._newline = newline.upper().replace('LF','\\n').replace('CR','\\r')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:Return_L230_C8", "label": "return", "type": "return", "loc": [230, 230], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L212_C4", "vector": [13, 2, 0.4423, 0.0019, 2, 0.97, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return old"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L232_C4", "label": "close_connection", "type": "function", "loc": [232, 240], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:ClassDef_L178_C0", "vector": [2, 1, 0.4538, 0.0173, 1, 0.78, 0.1579, 801, 0, 2, 1, 0, 0, 0, 4], "semantic": {"name": "close_connection", "arg_names": ["self", "loglevel"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def close_connection(self, loglevel=None):\n \"\"\"Closes the current Telnet connection and returns any remaining output.\n\n See `Read` for more information on `loglevel`.\n \"\"\"\n telnetlib.Telnet.close(self)\n ret = self.read_all().decode('ASCII', 'ignore')\n self._log(ret, loglevel)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:Expr_L233_C8", "label": "expression", "type": "expression", "loc": [233, 236], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L232_C4", "vector": [8, 2, 0.451, 0.0077, 2, 0.12, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Closes the current Telnet connection and returns any remaining output.\n\n See `Read` for more information on `loglevel`.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:Expr_L237_C8", "label": "close()", "type": "expression", "loc": [237, 237], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L232_C4", "vector": [8, 2, 0.4558, 0.0019, 2, 0.12, 0.25, 77, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": " telnetlib.Telnet.close(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:Assign_L238_C8", "label": "ret = decode()", "type": "assigned_variable", "loc": [238, 238], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L232_C4", "vector": [14, 2, 0.4577, 0.0019, 2, 0.12, 0.5, 501, 3, 2, 0, 0, 528, 10, 2], "semantic": {"name": "ret", "arg_names": [], "import_names": [], "rhs_call_name": "decode", "annotation": ""}, "snippet": " ret = self.read_all().decode('ASCII', 'ignore')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:Expr_L239_C8", "label": "_log()", "type": "expression", "loc": [239, 239], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L232_C4", "vector": [8, 2, 0.4596, 0.0019, 2, 0.12, 0.75, 191, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "_log", "arg_names": [], "import_names": [], "rhs_call_name": "_log", "annotation": ""}, "snippet": " self._log(ret, loglevel)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:Return_L240_C8", "label": "return", "type": "return", "loc": [240, 240], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L232_C4", "vector": [13, 2, 0.4615, 0.0019, 2, 0.12, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ret"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L242_C4", "label": "login", "type": "function", "loc": [242, 273], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:ClassDef_L178_C0", "vector": [2, 1, 0.4952, 0.0615, 1, 0.78, 0.2105, 724, 0, 5, 1, 0, 0, 0, 12], "semantic": {"name": "login", "arg_names": ["self", "username", "password", "login_prompt", "password_prompt"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def login(self, username, password, login_prompt='login: ',\n password_prompt='Password: '):\n \"\"\"Logs in to the Telnet server with the given user information.\n\n The login keyword reads from the connection until login_prompt\n is encountered and then types the user name. Then it reads\n until password_prompt is encountered and types the\n password. The rest of the output (if any) is also read, and"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:Expr_L244_C8", "label": "expression", "type": "expression", "loc": [244, 257], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L242_C4", "vector": [8, 2, 0.4817, 0.0269, 2, 0.64, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Logs in to the Telnet server with the given user information.\n\n The login keyword reads from the connection until login_prompt\n is encountered and then types the user name. Then it reads\n until password_prompt is encountered and types the\n password. The rest of the output (if any) is also read, and\n all the text that has been read is returned as a single\n string."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:Assign_L258_C8", "label": "ret = decode()", "type": "assigned_variable", "loc": [258, 258], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L242_C4", "vector": [14, 2, 0.4962, 0.0019, 2, 0.64, 0.1667, 501, 3, 2, 0, 0, 528, 10, 2], "semantic": {"name": "ret", "arg_names": [], "import_names": [], "rhs_call_name": "decode", "annotation": ""}, "snippet": " ret = self.read_until(login_prompt, 'TRACE').decode('ASCII', 'ignore')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:Expr_L259_C8", "label": "write_bare()", "type": "expression", "loc": [259, 259], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L242_C4", "vector": [8, 2, 0.4981, 0.0019, 2, 0.64, 0.3333, 576, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write_bare", "arg_names": [], "import_names": [], "rhs_call_name": "write_bare", "annotation": ""}, "snippet": " self.write_bare(username + self._newline)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:Expr_L262_C8", "label": "write_bare()", "type": "expression", "loc": [262, 262], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L242_C4", "vector": [8, 2, 0.5038, 0.0019, 2, 0.64, 0.5, 576, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write_bare", "arg_names": [], "import_names": [], "rhs_call_name": "write_bare", "annotation": ""}, "snippet": " self.write_bare(password + self._newline)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:If_L264_C8", "label": "if", "type": "if", "loc": [264, 271], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L242_C4", "vector": [4, 2, 0.5144, 0.0154, 2, 0.64, 0.6667, 0, 3, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self._prompt_is_set():\n try:\n ret += self.read_until_prompt('TRACE')\n except AssertionError:\n self._verify_login(ret)\n raise\n else:\n ret += self._verify_login(ret)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:Try_L265_C12", "label": "try", "type": "try", "loc": [265, 269], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:If_L264_C8", "vector": [7, 3, 0.5135, 0.0096, 3, 0.95, 0.0, 0, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n ret += self.read_until_prompt('TRACE')\n except AssertionError:\n self._verify_login(ret)\n raise"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:Expr_L268_C16", "label": "_verify_login()", "type": "expression", "loc": [268, 268], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:Try_L265_C12", "vector": [8, 4, 0.5154, 0.0019, 4, 0.4, 0.0, 106, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_verify_login", "arg_names": [], "import_names": [], "rhs_call_name": "_verify_login", "annotation": ""}, "snippet": " self._verify_login(ret)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:Expr_L272_C8", "label": "_log()", "type": "expression", "loc": [272, 272], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L242_C4", "vector": [8, 2, 0.5231, 0.0019, 2, 0.64, 0.8333, 191, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_log", "arg_names": [], "import_names": [], "rhs_call_name": "_log", "annotation": ""}, "snippet": " self._log(ret)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:Return_L273_C8", "label": "return", "type": "return", "loc": [273, 273], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L242_C4", "vector": [13, 2, 0.525, 0.0019, 2, 0.64, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ret"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L275_C4", "label": "_verify_login", "type": "function", "loc": [275, 286], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:ClassDef_L178_C0", "vector": [2, 1, 0.5394, 0.0231, 1, 0.78, 0.2632, 106, 0, 2, 1, 0, 0, 0, 5], "semantic": {"name": "_verify_login", "arg_names": ["self", "ret"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _verify_login(self, ret):\n # It is necessary to wait for the 'login incorrect' message to appear.\n time.sleep(1)\n while True:\n try:\n ret += self.read_until('\\n', 'TRACE').decode('ASCII', 'ignore')\n except AssertionError:\n return ret"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:Expr_L277_C8", "label": "sleep()", "type": "expression", "loc": [277, 277], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L275_C4", "vector": [8, 2, 0.5327, 0.0019, 2, 0.05, 0.0, 476, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " time.sleep(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:While_L278_C8", "label": "while", "type": "while", "loc": [278, 286], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L275_C4", "vector": [5, 2, 0.5423, 0.0173, 2, 0.05, 1.0, 0, 1, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while True:\n try:\n ret += self.read_until('\\n', 'TRACE').decode('ASCII', 'ignore')\n except AssertionError:\n return ret\n else:\n if 'Login incorrect' in ret:\n self._log(ret)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:Try_L279_C12", "label": "try", "type": "try", "loc": [279, 286], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:While_L278_C8", "vector": [7, 3, 0.5433, 0.0154, 3, 0.13, 0.0, 0, 0, 1, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n ret += self.read_until('\\n', 'TRACE').decode('ASCII', 'ignore')\n except AssertionError:\n return ret\n else:\n if 'Login incorrect' in ret:\n self._log(ret)\n raise AssertionError(\"Login incorrect\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:Return_L282_C16", "label": "return", "type": "return", "loc": [282, 282], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:Try_L279_C12", "vector": [13, 4, 0.5423, 0.0019, 4, 0.85, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ret"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:If_L284_C16", "label": "if", "type": "if", "loc": [284, 286], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:Try_L279_C12", "vector": [4, 4, 0.5481, 0.0058, 4, 0.85, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if 'Login incorrect' in ret:\n self._log(ret)\n raise AssertionError(\"Login incorrect\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:Expr_L285_C20", "label": "_log()", "type": "expression", "loc": [285, 285], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:If_L284_C16", "vector": [8, 5, 0.5481, 0.0019, 5, 0.01, 0.0, 191, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_log", "arg_names": [], "import_names": [], "rhs_call_name": "_log", "annotation": ""}, "snippet": " self._log(ret)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L288_C4", "label": "write", "type": "function", "loc": [288, 307], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:ClassDef_L178_C0", "vector": [2, 1, 0.5721, 0.0385, 1, 0.78, 0.3158, 837, 0, 3, 1, 0, 0, 0, 3], "semantic": {"name": "write", "arg_names": ["self", "text", "loglevel"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def write(self, text, loglevel=None):\n \"\"\"Writes the given text over the connection and appends a newline.\n\n Consumes the written text (until the appended newline) from\n the output and returns it. The given text must not contain\n newlines.\n\n Note: This keyword does not return the possible output of the"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:Expr_L289_C8", "label": "expression", "type": "expression", "loc": [289, 300], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L288_C4", "vector": [8, 2, 0.5663, 0.0231, 2, 0.63, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Writes the given text over the connection and appends a newline.\n\n Consumes the written text (until the appended newline) from\n the output and returns it. The given text must not contain\n newlines.\n\n Note: This keyword does not return the possible output of the\n executed command. To get the output, one of the `Read XXX`"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:If_L301_C8", "label": "if", "type": "if", "loc": [301, 303], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L288_C4", "vector": [4, 2, 0.5808, 0.0058, 2, 0.63, 0.3333, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self._newline in text:\n raise RuntimeError(\"Write cannot be used with string containing \"\n \"newlines. Use 'Write Bare' instead.\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:Expr_L305_C8", "label": "write_bare()", "type": "expression", "loc": [305, 305], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L288_C4", "vector": [8, 2, 0.5865, 0.0019, 2, 0.63, 0.6667, 576, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write_bare", "arg_names": [], "import_names": [], "rhs_call_name": "write_bare", "annotation": ""}, "snippet": " self.write_bare(text)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:Return_L307_C8", "label": "return", "type": "return", "loc": [307, 307], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L288_C4", "vector": [13, 2, 0.5904, 0.0019, 2, 0.63, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.read_until(self._newline, loglevel)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L309_C4", "label": "write_bare", "type": "function", "loc": [309, 319], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:ClassDef_L178_C0", "vector": [2, 1, 0.6038, 0.0212, 1, 0.78, 0.3684, 576, 0, 2, 0, 0, 0, 0, 3], "semantic": {"name": "write_bare", "arg_names": ["self", "text"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def write_bare(self, text):\n \"\"\"Writes the given text over the connection without appending a newline.\n\n Does not consume the written text.\n \"\"\"\n try:\n text = str(text)\n except UnicodeError:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:Expr_L310_C8", "label": "expression", "type": "expression", "loc": [310, 313], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L309_C4", "vector": [8, 2, 0.599, 0.0077, 2, 0.42, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Writes the given text over the connection without appending a newline.\n\n Does not consume the written text.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:Try_L314_C8", "label": "try", "type": "try", "loc": [314, 318], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L309_C4", "vector": [7, 2, 0.6077, 0.0096, 2, 0.42, 0.5, 0, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n text = str(text)\n except UnicodeError:\n raise ValueError('Only ASCII characters are allowed in Telnet. '\n 'Got: %s' % text)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:Assign_L315_C12", "label": "text = str()", "type": "assigned_variable", "loc": [315, 315], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:Try_L314_C8", "vector": [14, 3, 0.6058, 0.0019, 3, 0.75, 0.0, 439, 3, 1, 0, 0, 52, 10, 1], "semantic": {"name": "text", "arg_names": [], "import_names": [], "rhs_call_name": "str", "annotation": ""}, "snippet": " text = str(text)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:Expr_L319_C8", "label": "write()", "type": "expression", "loc": [319, 319], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L309_C4", "vector": [8, 2, 0.6135, 0.0019, 2, 0.42, 1.0, 837, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " telnetlib.Telnet.write(self, text)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L321_C4", "label": "write_until_expected_output", "type": "function", "loc": [321, 356], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:ClassDef_L178_C0", "vector": [2, 1, 0.651, 0.0692, 1, 0.78, 0.4211, 84, 0, 6, 1, 0, 0, 0, 12], "semantic": {"name": "write_until_expected_output", "arg_names": ["self", "text", "expected", "timeout", "retry_interval", "loglevel"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def write_until_expected_output(self, text, expected, timeout,\n retry_interval, loglevel=None):\n \"\"\"Writes the given text repeatedly, until `expected` appears in the output.\n\n `text` is written without appending a\n newline. `retry_interval` defines the time waited before\n writing `text` again. `text` is consumed from the output\n before `expected` is tried to be read."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:Expr_L323_C8", "label": "expression", "type": "expression", "loc": [323, 343], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L321_C4", "vector": [8, 2, 0.6404, 0.0404, 2, 0.52, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Writes the given text repeatedly, until `expected` appears in the output.\n\n `text` is written without appending a\n newline. `retry_interval` defines the time waited before\n writing `text` again. `text` is consumed from the output\n before `expected` is tried to be read.\n\n If `expected` does not appear in the output within `timeout`,"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:Assign_L344_C8", "label": "timeout = timestr_to_secs()", "type": "assigned_variable", "loc": [344, 344], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L321_C4", "vector": [14, 2, 0.6615, 0.0019, 2, 0.52, 0.25, 616, 3, 1, 0, 0, 329, 10, 1], "semantic": {"name": "timeout", "arg_names": [], "import_names": [], "rhs_call_name": "timestr_to_secs", "annotation": ""}, "snippet": " timeout = utils.timestr_to_secs(timeout)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:Assign_L345_C8", "label": "retry_interval = timestr_to_secs()", "type": "assigned_variable", "loc": [345, 345], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L321_C4", "vector": [14, 2, 0.6635, 0.0019, 2, 0.52, 0.5, 924, 3, 1, 0, 0, 329, 10, 1], "semantic": {"name": "retry_interval", "arg_names": [], "import_names": [], "rhs_call_name": "timestr_to_secs", "annotation": ""}, "snippet": " retry_interval = utils.timestr_to_secs(retry_interval)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:Assign_L346_C8", "label": "starttime = time()", "type": "assigned_variable", "loc": [346, 346], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L321_C4", "vector": [14, 2, 0.6654, 0.0019, 2, 0.52, 0.75, 864, 3, 0, 0, 0, 654, 10, 1], "semantic": {"name": "starttime", "arg_names": [], "import_names": [], "rhs_call_name": "time", "annotation": ""}, "snippet": " starttime = time.time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:While_L347_C8", "label": "while", "type": "while", "loc": [347, 354], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L321_C4", "vector": [5, 2, 0.674, 0.0154, 2, 0.52, 1.0, 0, 0, 0, 0, 0, 0, 0, 7], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while time.time() - starttime < timeout:\n self.write_bare(text)\n self.read_until(text, loglevel)\n ret = telnetlib.Telnet.read_until(self, expected,\n retry_interval).decode('ASCII', 'ignore')\n self._log(ret, loglevel)\n if ret.endswith(expected):\n return ret"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:Expr_L348_C12", "label": "write_bare()", "type": "expression", "loc": [348, 348], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:While_L347_C8", "vector": [8, 3, 0.6692, 0.0019, 3, 0.06, 0.0, 576, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write_bare", "arg_names": [], "import_names": [], "rhs_call_name": "write_bare", "annotation": ""}, "snippet": " self.write_bare(text)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:Expr_L349_C12", "label": "read_until()", "type": "expression", "loc": [349, 349], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:While_L347_C8", "vector": [8, 3, 0.6712, 0.0019, 3, 0.06, 0.25, 68, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "read_until", "arg_names": [], "import_names": [], "rhs_call_name": "read_until", "annotation": ""}, "snippet": " self.read_until(text, loglevel)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:Assign_L350_C12", "label": "ret = decode()", "type": "assigned_variable", "loc": [350, 351], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:While_L347_C8", "vector": [14, 3, 0.674, 0.0038, 3, 0.06, 0.5, 501, 3, 2, 0, 0, 528, 10, 2], "semantic": {"name": "ret", "arg_names": [], "import_names": [], "rhs_call_name": "decode", "annotation": ""}, "snippet": " ret = telnetlib.Telnet.read_until(self, expected,\n retry_interval).decode('ASCII', 'ignore')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:Expr_L352_C12", "label": "_log()", "type": "expression", "loc": [352, 352], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:While_L347_C8", "vector": [8, 3, 0.6769, 0.0019, 3, 0.06, 0.75, 191, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "_log", "arg_names": [], "import_names": [], "rhs_call_name": "_log", "annotation": ""}, "snippet": " self._log(ret, loglevel)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:If_L353_C12", "label": "if", "type": "if", "loc": [353, 354], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:While_L347_C8", "vector": [4, 3, 0.6798, 0.0038, 3, 0.06, 1.0, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if ret.endswith(expected):\n return ret"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:Return_L354_C16", "label": "return", "type": "return", "loc": [354, 354], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:If_L353_C12", "vector": [13, 4, 0.6808, 0.0019, 4, 0.97, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ret"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L358_C4", "label": "read", "type": "function", "loc": [358, 369], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:ClassDef_L178_C0", "vector": [2, 1, 0.699, 0.0231, 1, 0.78, 0.4737, 453, 0, 2, 1, 0, 0, 0, 3], "semantic": {"name": "read", "arg_names": ["self", "loglevel"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def read(self, loglevel=None):\n \"\"\"Reads and returns/logs everything that is currently available in the output.\n\n The read message is always returned and logged. The default\n log level is either 'INFO', or the level set with `Set Default\n Log Level`. `loglevel` can be used to override the default\n log level, and the available levels are TRACE, DEBUG, INFO,\n and WARN."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:Expr_L359_C8", "label": "expression", "type": "expression", "loc": [359, 366], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L358_C4", "vector": [8, 2, 0.6971, 0.0154, 2, 0.55, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Reads and returns/logs everything that is currently available in the output.\n\n The read message is always returned and logged. The default\n log level is either 'INFO', or the level set with `Set Default\n Log Level`. `loglevel` can be used to override the default\n log level, and the available levels are TRACE, DEBUG, INFO,\n and WARN.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:Assign_L367_C8", "label": "ret = decode()", "type": "assigned_variable", "loc": [367, 367], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L358_C4", "vector": [14, 2, 0.7058, 0.0019, 2, 0.55, 0.3333, 501, 3, 2, 0, 0, 528, 10, 2], "semantic": {"name": "ret", "arg_names": [], "import_names": [], "rhs_call_name": "decode", "annotation": ""}, "snippet": " ret = self.read_very_eager().decode('ASCII', 'ignore')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:Expr_L368_C8", "label": "_log()", "type": "expression", "loc": [368, 368], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L358_C4", "vector": [8, 2, 0.7077, 0.0019, 2, 0.55, 0.6667, 191, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "_log", "arg_names": [], "import_names": [], "rhs_call_name": "_log", "annotation": ""}, "snippet": " self._log(ret, loglevel)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:Return_L369_C8", "label": "return", "type": "return", "loc": [369, 369], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L358_C4", "vector": [13, 2, 0.7096, 0.0019, 2, 0.55, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ret"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L371_C4", "label": "read_until", "type": "function", "loc": [371, 385], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:ClassDef_L178_C0", "vector": [2, 1, 0.7269, 0.0288, 1, 0.78, 0.5263, 68, 0, 3, 1, 0, 0, 0, 6], "semantic": {"name": "read_until", "arg_names": ["self", "expected", "loglevel"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def read_until(self, expected, loglevel=None):\n \"\"\"Reads from the current output, until expected is encountered.\n\n Text up to and including the match is returned. If no match is\n found, the keyword fails.\n\n See `Read` for more information on `loglevel`.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:Expr_L372_C8", "label": "expression", "type": "expression", "loc": [372, 378], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L371_C4", "vector": [8, 2, 0.7212, 0.0135, 2, 0.04, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Reads from the current output, until expected is encountered.\n\n Text up to and including the match is returned. If no match is\n found, the keyword fails.\n\n See `Read` for more information on `loglevel`.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:Assign_L379_C8", "label": "ret = decode()", "type": "assigned_variable", "loc": [379, 380], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L371_C4", "vector": [14, 2, 0.7298, 0.0038, 2, 0.04, 0.25, 501, 3, 2, 0, 0, 528, 10, 2], "semantic": {"name": "ret", "arg_names": [], "import_names": [], "rhs_call_name": "decode", "annotation": ""}, "snippet": " ret = telnetlib.Telnet.read_until(self, expected,\n self._timeout).decode('ASCII', 'ignore')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:Expr_L381_C8", "label": "_log()", "type": "expression", "loc": [381, 381], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L371_C4", "vector": [8, 2, 0.7327, 0.0019, 2, 0.04, 0.5, 191, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "_log", "arg_names": [], "import_names": [], "rhs_call_name": "_log", "annotation": ""}, "snippet": " self._log(ret, loglevel)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:If_L382_C8", "label": "if", "type": "if", "loc": [382, 384], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L371_C4", "vector": [4, 2, 0.7365, 0.0058, 2, 0.04, 0.75, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not ret.endswith(expected):\n raise AssertionError(\"No match found for '%s' in %s\"\n % (expected, utils.secs_to_timestr(self._timeout)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:Return_L385_C8", "label": "return", "type": "return", "loc": [385, 385], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L371_C4", "vector": [13, 2, 0.7404, 0.0019, 2, 0.04, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ret"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L387_C4", "label": "read_until_regexp", "type": "function", "loc": [387, 421], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:ClassDef_L178_C0", "vector": [2, 1, 0.7769, 0.0673, 1, 0.78, 0.5789, 856, 0, 2, 1, 0, 0, 0, 9], "semantic": {"name": "read_until_regexp", "arg_names": ["self", "expected"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def read_until_regexp(self, *expected):\n \"\"\"Reads from the current output, until a match to a regexp in expected.\n\n Expected is a list of regular expression patterns as strings,\n or compiled regular expressions. The keyword returns the text\n up to and including the first match to any of the regular\n expressions.\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:Expr_L388_C8", "label": "expression", "type": "expression", "loc": [388, 402], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L387_C4", "vector": [8, 2, 0.7596, 0.0288, 2, 0.84, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Reads from the current output, until a match to a regexp in expected.\n\n Expected is a list of regular expression patterns as strings,\n or compiled regular expressions. The keyword returns the text\n up to and including the first match to any of the regular\n expressions.\n\n If the last argument in `*expected` is a valid log level, it"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:Assign_L403_C8", "label": "expected = list()", "type": "assigned_variable", "loc": [403, 403], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L387_C4", "vector": [14, 2, 0.775, 0.0019, 2, 0.84, 0.1429, 361, 3, 1, 0, 0, 430, 10, 1], "semantic": {"name": "expected", "arg_names": [], "import_names": [], "rhs_call_name": "list", "annotation": ""}, "snippet": " expected = list(expected)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:If_L404_C8", "label": "if", "type": "if", "loc": [404, 408], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L387_C4", "vector": [4, 2, 0.7808, 0.0096, 2, 0.84, 0.2857, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self._is_valid_log_level(expected[-1]):\n loglevel = expected[-1]\n expected = expected[:-1]\n else:\n loglevel = 'INFO'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:Assign_L405_C12", "label": "loglevel =", "type": "assigned_variable", "loc": [405, 405], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:If_L404_C8", "vector": [14, 3, 0.7788, 0.0019, 3, 0.07, 0.0, 414, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "loglevel", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " loglevel = expected[-1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:Assign_L406_C12", "label": "expected =", "type": "assigned_variable", "loc": [406, 406], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:If_L404_C8", "vector": [14, 3, 0.7808, 0.0019, 3, 0.07, 0.5, 361, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "expected", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " expected = expected[:-1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:Assign_L408_C12", "label": "loglevel =", "type": "assigned_variable", "loc": [408, 408], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:If_L404_C8", "vector": [14, 3, 0.7846, 0.0019, 3, 0.07, 1.0, 414, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "loglevel", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " loglevel = 'INFO'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:Try_L409_C8", "label": "try", "type": "try", "loc": [409, 412], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L387_C4", "vector": [7, 2, 0.7894, 0.0077, 2, 0.84, 0.4286, 0, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n index, _, ret = self.expect(expected, self._timeout)\n except TypeError:\n index, ret = -1, ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:Assign_L410_C12", "label": "index, _, ret = expect()", "type": "assigned_variable", "loc": [410, 410], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:Try_L409_C8", "vector": [14, 3, 0.7885, 0.0019, 3, 0.39, 0.0, 706, 3, 2, 0, 0, 754, 10, 1], "semantic": {"name": "index, _, ret", "arg_names": [], "import_names": [], "rhs_call_name": "expect", "annotation": ""}, "snippet": " index, _, ret = self.expect(expected, self._timeout)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:Assign_L412_C12", "label": "index, ret =", "type": "assigned_variable", "loc": [412, 412], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:Try_L409_C8", "vector": [14, 3, 0.7923, 0.0019, 3, 0.39, 0.0, 2, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "index, ret", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " index, ret = -1, ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:Assign_L413_C8", "label": "ret = decode()", "type": "assigned_variable", "loc": [413, 413], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L387_C4", "vector": [14, 2, 0.7942, 0.0019, 2, 0.84, 0.5714, 501, 3, 2, 0, 0, 528, 10, 1], "semantic": {"name": "ret", "arg_names": [], "import_names": [], "rhs_call_name": "decode", "annotation": ""}, "snippet": " ret = ret.decode('ASCII', 'ignore')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:Expr_L414_C8", "label": "_log()", "type": "expression", "loc": [414, 414], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L387_C4", "vector": [8, 2, 0.7962, 0.0019, 2, 0.84, 0.7143, 191, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "_log", "arg_names": [], "import_names": [], "rhs_call_name": "_log", "annotation": ""}, "snippet": " self._log(ret, loglevel)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:If_L415_C8", "label": "if", "type": "if", "loc": [415, 420], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L387_C4", "vector": [4, 2, 0.8029, 0.0115, 2, 0.84, 0.8571, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if index == -1:\n expected = [ exp if isinstance(exp, basestring) else exp.pattern\n for exp in expected ]\n raise AssertionError(\"No match found for %s in %s\"\n % (utils.seq2str(expected, lastsep=' or '),\n utils.secs_to_timestr(self._timeout)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:Assign_L416_C12", "label": "expected =", "type": "assigned_variable", "loc": [416, 417], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:If_L415_C8", "vector": [14, 3, 0.801, 0.0038, 3, 0.51, 0.0, 361, 5, 0, 0, 0, 0, 0, 1], "semantic": {"name": "expected", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " expected = [ exp if isinstance(exp, basestring) else exp.pattern\n for exp in expected ]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:Return_L421_C8", "label": "return", "type": "return", "loc": [421, 421], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L387_C4", "vector": [13, 2, 0.8096, 0.0019, 2, 0.84, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ret"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L423_C4", "label": "read_until_prompt", "type": "function", "loc": [423, 436], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:ClassDef_L178_C0", "vector": [2, 1, 0.826, 0.0269, 1, 0.78, 0.6316, 891, 0, 2, 1, 0, 0, 0, 4], "semantic": {"name": "read_until_prompt", "arg_names": ["self", "loglevel"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def read_until_prompt(self, loglevel=None):\n \"\"\"Reads from the current output, until a prompt is found.\n\n The prompt must have been set, either in the library import or\n at login time, or by using the `Set Prompt` keyword.\n\n See `Read` for more information on `loglevel`.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:Expr_L424_C8", "label": "expression", "type": "expression", "loc": [424, 430], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L423_C4", "vector": [8, 2, 0.8212, 0.0135, 2, 0.37, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Reads from the current output, until a prompt is found.\n\n The prompt must have been set, either in the library import or\n at login time, or by using the `Set Prompt` keyword.\n\n See `Read` for more information on `loglevel`.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:If_L431_C8", "label": "if", "type": "if", "loc": [431, 432], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L423_C4", "vector": [4, 2, 0.8298, 0.0038, 2, 0.37, 0.25, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not self._prompt_is_set():\n raise RuntimeError('Prompt is not set')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:Assign_L433_C8", "label": "prompt, regexp =", "type": "assigned_variable", "loc": [433, 433], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L423_C4", "vector": [14, 2, 0.8327, 0.0019, 2, 0.37, 0.5, 993, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "prompt, regexp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " prompt, regexp = self._prompt"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:If_L434_C8", "label": "if", "type": "if", "loc": [434, 435], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L423_C4", "vector": [4, 2, 0.8356, 0.0038, 2, 0.37, 0.75, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if regexp:\n return self.read_until_regexp(prompt, loglevel)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:Return_L435_C12", "label": "return", "type": "return", "loc": [435, 435], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:If_L434_C8", "vector": [13, 3, 0.8365, 0.0019, 3, 0.42, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.read_until_regexp(prompt, loglevel)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:Return_L436_C8", "label": "return", "type": "return", "loc": [436, 436], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L423_C4", "vector": [13, 2, 0.8385, 0.0019, 2, 0.37, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.read_until(prompt, loglevel)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L438_C4", "label": "execute_command", "type": "function", "loc": [438, 455], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:ClassDef_L178_C0", "vector": [2, 1, 0.8587, 0.0346, 1, 0.78, 0.6842, 192, 0, 3, 1, 0, 0, 0, 2], "semantic": {"name": "execute_command", "arg_names": ["self", "command", "loglevel"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def execute_command(self, command, loglevel=None):\n \"\"\"Executes given command and reads and returns everything until prompt.\n\n This is a convenience keyword; following two are functionally\n identical:\n\n | ${out} = | Execute Command | Some command |\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:Expr_L439_C8", "label": "expression", "type": "expression", "loc": [439, 453], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L438_C4", "vector": [8, 2, 0.8577, 0.0288, 2, 0.22, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Executes given command and reads and returns everything until prompt.\n\n This is a convenience keyword; following two are functionally\n identical:\n\n | ${out} = | Execute Command | Some command |\n\n | Write | Some command |"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:Expr_L454_C8", "label": "write()", "type": "expression", "loc": [454, 454], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L438_C4", "vector": [8, 2, 0.8731, 0.0019, 2, 0.22, 0.5, 837, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " self.write(command, loglevel)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:Return_L455_C8", "label": "return", "type": "return", "loc": [455, 455], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L438_C4", "vector": [13, 2, 0.875, 0.0019, 2, 0.22, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.read_until_prompt(loglevel)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L457_C4", "label": "set_prompt", "type": "function", "loc": [457, 477], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:ClassDef_L178_C0", "vector": [2, 1, 0.8981, 0.0404, 1, 0.78, 0.7368, 768, 0, 3, 1, 0, 0, 0, 2], "semantic": {"name": "set_prompt", "arg_names": ["self", "prompt", "prompt_is_regexp"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def set_prompt(self, prompt, prompt_is_regexp=False):\n \"\"\"Sets the prompt used in this connection to `prompt`.\n\n If `prompt_is_regexp` is a non-empty string, the given prompt is\n considered to be a regular expression.\n\n The old prompt is returned and can be used to restore it later.\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:Expr_L458_C8", "label": "expression", "type": "expression", "loc": [458, 469], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L457_C4", "vector": [8, 2, 0.8913, 0.0231, 2, 0.53, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Sets the prompt used in this connection to `prompt`.\n\n If `prompt_is_regexp` is a non-empty string, the given prompt is\n considered to be a regular expression.\n\n The old prompt is returned and can be used to restore it later.\n\n Example:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:Assign_L470_C8", "label": "old =", "type": "assigned_variable", "loc": [470, 470], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L457_C4", "vector": [14, 2, 0.9038, 0.0019, 2, 0.53, 0.25, 206, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "old", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " old = hasattr(self, '_prompt') and self._prompt or (None, False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:If_L471_C8", "label": "if", "type": "if", "loc": [471, 474], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L457_C4", "vector": [4, 2, 0.9087, 0.0077, 2, 0.53, 0.5, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if prompt_is_regexp:\n self._prompt = (re.compile(prompt), True)\n else:\n self._prompt = (prompt, False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:Assign_L472_C12", "label": "self._prompt =", "type": "assigned_variable", "loc": [472, 472], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:If_L471_C8", "vector": [14, 3, 0.9077, 0.0019, 3, 0.14, 0.0, 332, 0, 0, 0, 0, 0, 8, 1], "semantic": {"name": "self._prompt", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._prompt = (re.compile(prompt), True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:Assign_L474_C12", "label": "self._prompt =", "type": "assigned_variable", "loc": [474, 474], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:If_L471_C8", "vector": [14, 3, 0.9115, 0.0019, 3, 0.14, 1.0, 332, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "self._prompt", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._prompt = (prompt, False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:If_L475_C8", "label": "if", "type": "if", "loc": [475, 476], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L457_C4", "vector": [4, 2, 0.9144, 0.0038, 2, 0.53, 0.75, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if old[1]:\n return old[0].pattern, True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:Return_L476_C12", "label": "return", "type": "return", "loc": [476, 476], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:If_L475_C8", "vector": [13, 3, 0.9154, 0.0019, 3, 0.77, 0.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return old[0].pattern, True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:Return_L477_C8", "label": "return", "type": "return", "loc": [477, 477], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L457_C4", "vector": [13, 2, 0.9173, 0.0019, 2, 0.53, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return old"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L479_C4", "label": "_prompt_is_set", "type": "function", "loc": [479, 480], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:ClassDef_L178_C0", "vector": [2, 1, 0.9221, 0.0038, 1, 0.78, 0.7895, 303, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "_prompt_is_set", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _prompt_is_set(self):\n return self._prompt[0] is not None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:Return_L480_C8", "label": "return", "type": "return", "loc": [480, 480], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L479_C4", "vector": [13, 2, 0.9231, 0.0019, 2, 0.14, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._prompt[0] is not None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L482_C4", "label": "set_default_log_level", "type": "function", "loc": [482, 492], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:ClassDef_L178_C0", "vector": [2, 1, 0.9365, 0.0212, 1, 0.78, 0.8421, 105, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "set_default_log_level", "arg_names": ["self", "level"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def set_default_log_level(self, level):\n \"\"\"Sets the default log level used by all read keywords.\n\n The possible values are TRACE, DEBUG, INFO and WARN. The default is\n INFO. The old value is returned and can be used to restore it later,\n similarly as with `Set Timeout`.\n \"\"\"\n self._is_valid_log_level(level, raise_if_invalid=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:Expr_L483_C8", "label": "expression", "type": "expression", "loc": [483, 488], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L482_C4", "vector": [8, 2, 0.9337, 0.0115, 2, 0.36, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Sets the default log level used by all read keywords.\n\n The possible values are TRACE, DEBUG, INFO and WARN. The default is\n INFO. The old value is returned and can be used to restore it later,\n similarly as with `Set Timeout`.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:Expr_L489_C8", "label": "_is_valid_log_level()", "type": "expression", "loc": [489, 489], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L482_C4", "vector": [8, 2, 0.9404, 0.0019, 2, 0.36, 0.25, 380, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "_is_valid_log_level", "arg_names": [], "import_names": [], "rhs_call_name": "_is_valid_log_level", "annotation": ""}, "snippet": " self._is_valid_log_level(level, raise_if_invalid=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:Assign_L490_C8", "label": "old =", "type": "assigned_variable", "loc": [490, 490], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L482_C4", "vector": [14, 2, 0.9423, 0.0019, 2, 0.36, 0.5, 206, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "old", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " old = self._default_log_level"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:Assign_L491_C8", "label": "self._default_log_level = upper()", "type": "assigned_variable", "loc": [491, 491], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L482_C4", "vector": [14, 2, 0.9442, 0.0019, 2, 0.36, 0.75, 371, 3, 0, 0, 0, 347, 10, 1], "semantic": {"name": "self._default_log_level", "arg_names": [], "import_names": [], "rhs_call_name": "upper", "annotation": ""}, "snippet": " self._default_log_level = level.upper()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:Return_L492_C8", "label": "return", "type": "return", "loc": [492, 492], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L482_C4", "vector": [13, 2, 0.9462, 0.0019, 2, 0.36, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return old"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L494_C4", "label": "_log", "type": "function", "loc": [494, 500], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:ClassDef_L178_C0", "vector": [2, 1, 0.9558, 0.0135, 1, 0.78, 0.8947, 191, 0, 3, 0, 0, 0, 0, 4], "semantic": {"name": "_log", "arg_names": ["self", "msg", "level"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _log(self, msg, level=None):\n self._is_valid_log_level(level, raise_if_invalid=True)\n msg = msg.strip()\n if level is None:\n level = self._default_log_level\n if msg != '':\n print('*%s* %s' % (level.upper(), msg))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:Expr_L495_C8", "label": "_is_valid_log_level()", "type": "expression", "loc": [495, 495], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L494_C4", "vector": [8, 2, 0.9519, 0.0019, 2, 0.03, 0.0, 380, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "_is_valid_log_level", "arg_names": [], "import_names": [], "rhs_call_name": "_is_valid_log_level", "annotation": ""}, "snippet": " self._is_valid_log_level(level, raise_if_invalid=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:Assign_L496_C8", "label": "msg = strip()", "type": "assigned_variable", "loc": [496, 496], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L494_C4", "vector": [14, 2, 0.9538, 0.0019, 2, 0.03, 0.3333, 712, 3, 0, 0, 0, 973, 10, 1], "semantic": {"name": "msg", "arg_names": [], "import_names": [], "rhs_call_name": "strip", "annotation": ""}, "snippet": " msg = msg.strip()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:If_L497_C8", "label": "if", "type": "if", "loc": [497, 498], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L494_C4", "vector": [4, 2, 0.9567, 0.0038, 2, 0.03, 0.6667, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if level is None:\n level = self._default_log_level"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:Assign_L498_C12", "label": "level =", "type": "assigned_variable", "loc": [498, 498], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:If_L497_C8", "vector": [14, 3, 0.9577, 0.0019, 3, 0.24, 0.0, 479, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "level", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " level = self._default_log_level"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:If_L499_C8", "label": "if", "type": "if", "loc": [499, 500], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L494_C4", "vector": [4, 2, 0.9606, 0.0038, 2, 0.03, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if msg != '':\n print('*%s* %s' % (level.upper(), msg))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:Expr_L500_C12", "label": "print()", "type": "expression", "loc": [500, 500], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:If_L499_C8", "vector": [8, 3, 0.9615, 0.0019, 3, 0.34, 0.0, 535, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('*%s* %s' % (level.upper(), msg))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L502_C4", "label": "_is_valid_log_level", "type": "function", "loc": [502, 510], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:ClassDef_L178_C0", "vector": [2, 1, 0.9731, 0.0173, 1, 0.78, 0.9474, 380, 0, 3, 1, 0, 0, 0, 3], "semantic": {"name": "_is_valid_log_level", "arg_names": ["self", "level", "raise_if_invalid"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _is_valid_log_level(self, level, raise_if_invalid=False):\n if level is None:\n return True\n if isinstance(level, basestring) and \\\n level.upper() in ['TRACE', 'DEBUG', 'INFO', 'WARN']:\n return True\n if not raise_if_invalid:\n return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:If_L503_C8", "label": "if", "type": "if", "loc": [503, 504], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L502_C4", "vector": [4, 2, 0.9683, 0.0038, 2, 0.49, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if level is None:\n return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:Return_L504_C12", "label": "return", "type": "return", "loc": [504, 504], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:If_L503_C8", "vector": [13, 3, 0.9692, 0.0019, 3, 0.11, 0.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:If_L505_C8", "label": "if", "type": "if", "loc": [505, 507], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L502_C4", "vector": [4, 2, 0.9731, 0.0058, 2, 0.49, 0.5, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if isinstance(level, basestring) and \\\n level.upper() in ['TRACE', 'DEBUG', 'INFO', 'WARN']:\n return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:Return_L507_C12", "label": "return", "type": "return", "loc": [507, 507], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:If_L505_C8", "vector": [13, 3, 0.975, 0.0019, 3, 0.5, 0.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:If_L508_C8", "label": "if", "type": "if", "loc": [508, 509], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L502_C4", "vector": [4, 2, 0.9779, 0.0038, 2, 0.49, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not raise_if_invalid:\n return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:Return_L509_C12", "label": "return", "type": "return", "loc": [509, 509], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:If_L508_C8", "vector": [13, 3, 0.9788, 0.0019, 3, 0.92, 0.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L512_C4", "label": "_negotiate_echo_on", "type": "function", "loc": [512, 520], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:ClassDef_L178_C0", "vector": [2, 1, 0.9923, 0.0173, 1, 0.78, 1.0, 647, 0, 4, 0, 0, 0, 0, 3], "semantic": {"name": "_negotiate_echo_on", "arg_names": ["self", "sock", "cmd", "opt"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _negotiate_echo_on(self, sock, cmd, opt):\n # This is supposed to turn server side echoing on and turn other options off.\n if opt == telnetlib.ECHO and cmd in (telnetlib.WILL, telnetlib.WONT):\n self.sock.sendall(telnetlib.IAC + telnetlib.DO + opt)\n elif opt != telnetlib.NOOPT:\n if cmd in (telnetlib.DO, telnetlib.DONT):\n self.sock.sendall(telnetlib.IAC + telnetlib.WONT + opt)\n elif cmd in (telnetlib.WILL, telnetlib.WONT):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:If_L514_C8", "label": "if", "type": "if", "loc": [514, 520], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L512_C4", "vector": [4, 2, 0.9942, 0.0135, 2, 0.85, 0.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if opt == telnetlib.ECHO and cmd in (telnetlib.WILL, telnetlib.WONT):\n self.sock.sendall(telnetlib.IAC + telnetlib.DO + opt)\n elif opt != telnetlib.NOOPT:\n if cmd in (telnetlib.DO, telnetlib.DONT):\n self.sock.sendall(telnetlib.IAC + telnetlib.WONT + opt)\n elif cmd in (telnetlib.WILL, telnetlib.WONT):\n self.sock.sendall(telnetlib.IAC + telnetlib.DONT + opt)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:Expr_L515_C12", "label": "sendall()", "type": "expression", "loc": [515, 515], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:If_L514_C8", "vector": [8, 3, 0.9904, 0.0019, 3, 0.54, 0.0, 874, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "sendall", "arg_names": [], "import_names": [], "rhs_call_name": "sendall", "annotation": ""}, "snippet": " self.sock.sendall(telnetlib.IAC + telnetlib.DO + opt)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:If_L516_C8", "label": "if", "type": "if", "loc": [516, 520], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:If_L514_C8", "vector": [4, 3, 0.9962, 0.0096, 3, 0.54, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif opt != telnetlib.NOOPT:\n if cmd in (telnetlib.DO, telnetlib.DONT):\n self.sock.sendall(telnetlib.IAC + telnetlib.WONT + opt)\n elif cmd in (telnetlib.WILL, telnetlib.WONT):\n self.sock.sendall(telnetlib.IAC + telnetlib.DONT + opt)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:If_L517_C12", "label": "if", "type": "if", "loc": [517, 520], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:If_L516_C8", "vector": [4, 4, 0.9971, 0.0077, 4, 0.8, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if cmd in (telnetlib.DO, telnetlib.DONT):\n self.sock.sendall(telnetlib.IAC + telnetlib.WONT + opt)\n elif cmd in (telnetlib.WILL, telnetlib.WONT):\n self.sock.sendall(telnetlib.IAC + telnetlib.DONT + opt)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:Expr_L518_C16", "label": "sendall()", "type": "expression", "loc": [518, 518], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:If_L517_C12", "vector": [8, 5, 0.9962, 0.0019, 5, 0.85, 0.0, 874, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "sendall", "arg_names": [], "import_names": [], "rhs_call_name": "sendall", "annotation": ""}, "snippet": " self.sock.sendall(telnetlib.IAC + telnetlib.WONT + opt)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:If_L519_C12", "label": "if", "type": "if", "loc": [519, 520], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:If_L517_C12", "vector": [4, 5, 0.999, 0.0038, 5, 0.85, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif cmd in (telnetlib.WILL, telnetlib.WONT):\n self.sock.sendall(telnetlib.IAC + telnetlib.DONT + opt)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99864:Expr_L520_C16", "label": "sendall()", "type": "expression", "loc": [520, 520], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99864:If_L519_C12", "vector": [8, 6, 1.0, 0.0019, 6, 0.0, 0.0, 874, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "sendall", "arg_names": [], "import_names": [], "rhs_call_name": "sendall", "annotation": ""}, "snippet": " self.sock.sendall(telnetlib.IAC + telnetlib.DONT + opt)"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99864:ClassDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:Expr_L27_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:ClassDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:Assign_L39_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:ClassDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:Assign_L40_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:ClassDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L42_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:Expr_L43_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:Assign_L60_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:Assign_L61_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:Assign_L62_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:Assign_L63_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:Assign_L64_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:Assign_L65_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:ClassDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L67_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L67_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:Return_L68_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:ClassDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L70_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L70_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:If_L71_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:If_L71_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:Assign_L72_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L70_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:Return_L75_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:ClassDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L77_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L77_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:If_L78_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:If_L78_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:Assign_L79_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:If_L78_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:Assign_L80_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:If_L78_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:Assign_L82_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L77_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:Return_L85_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:ClassDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L87_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L87_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:If_L88_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L87_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:Assign_L93_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L87_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:Return_L94_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:ClassDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L96_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L96_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:Expr_L98_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L96_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:If_L116_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:If_L116_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:Assign_L117_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L96_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:If_L118_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:If_L118_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:Assign_L119_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L96_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:If_L120_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:If_L120_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:Assign_L121_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L96_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:Assign_L122_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L96_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:Return_L124_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:ClassDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L126_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L126_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:Expr_L127_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L126_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:Return_L128_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:ClassDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L130_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L130_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:Expr_L131_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L130_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:Assign_L162_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L130_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:Assign_L163_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L130_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:Return_L164_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:ClassDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L166_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L166_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:Expr_L167_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L166_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:Assign_L175_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:ClassDef_L178_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L180_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L180_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:Assign_L182_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L180_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:Expr_L183_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L180_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:Expr_L184_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L180_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:Expr_L185_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L180_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:Expr_L186_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L180_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:Assign_L187_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L180_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:Expr_L188_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:ClassDef_L178_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L190_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L190_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:Expr_L191_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L190_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:Assign_L208_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L190_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:Assign_L209_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L190_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:Return_L210_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:ClassDef_L178_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L212_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L212_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:Expr_L213_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L212_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:Assign_L228_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L212_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:Assign_L229_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L212_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:Return_L230_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:ClassDef_L178_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L232_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L232_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:Expr_L233_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L232_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:Expr_L237_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L232_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:Assign_L238_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L232_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:Expr_L239_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L232_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:Return_L240_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:ClassDef_L178_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L242_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L242_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:Expr_L244_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L242_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:Assign_L258_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L242_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:Expr_L259_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L242_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:Expr_L262_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L242_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:If_L264_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:If_L264_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:Try_L265_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:Try_L265_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:Expr_L268_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L242_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:Expr_L272_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L242_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:Return_L273_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:ClassDef_L178_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L275_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L275_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:Expr_L277_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L275_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:While_L278_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:While_L278_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:Try_L279_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:Try_L279_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:Return_L282_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:Try_L279_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:If_L284_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:If_L284_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:Expr_L285_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:ClassDef_L178_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L288_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L288_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:Expr_L289_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L288_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:If_L301_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L288_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:Expr_L305_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L288_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:Return_L307_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:ClassDef_L178_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L309_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L309_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:Expr_L310_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L309_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:Try_L314_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:Try_L314_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:Assign_L315_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L309_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:Expr_L319_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:ClassDef_L178_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L321_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L321_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:Expr_L323_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L321_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:Assign_L344_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L321_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:Assign_L345_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L321_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:Assign_L346_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L321_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:While_L347_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:While_L347_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:Expr_L348_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:While_L347_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:Expr_L349_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:While_L347_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:Assign_L350_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:While_L347_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:Expr_L352_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:While_L347_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:If_L353_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:If_L353_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:Return_L354_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:ClassDef_L178_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L358_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L358_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:Expr_L359_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L358_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:Assign_L367_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L358_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:Expr_L368_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L358_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:Return_L369_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:ClassDef_L178_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L371_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L371_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:Expr_L372_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L371_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:Assign_L379_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L371_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:Expr_L381_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L371_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:If_L382_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L371_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:Return_L385_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:ClassDef_L178_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L387_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L387_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:Expr_L388_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L387_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:Assign_L403_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L387_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:If_L404_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:If_L404_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:Assign_L405_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:If_L404_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:Assign_L406_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:If_L404_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:Assign_L408_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L387_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:Try_L409_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:Try_L409_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:Assign_L410_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:Try_L409_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:Assign_L412_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L387_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:Assign_L413_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L387_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:Expr_L414_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L387_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:If_L415_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:If_L415_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:Assign_L416_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L387_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:Return_L421_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:ClassDef_L178_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L423_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L423_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:Expr_L424_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L423_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:If_L431_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L423_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:Assign_L433_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L423_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:If_L434_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:If_L434_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:Return_L435_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L423_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:Return_L436_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:ClassDef_L178_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L438_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L438_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:Expr_L439_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L438_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:Expr_L454_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L438_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:Return_L455_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:ClassDef_L178_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L457_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L457_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:Expr_L458_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L457_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:Assign_L470_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L457_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:If_L471_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:If_L471_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:Assign_L472_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:If_L471_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:Assign_L474_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L457_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:If_L475_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:If_L475_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:Return_L476_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L457_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:Return_L477_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:ClassDef_L178_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L479_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L479_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:Return_L480_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:ClassDef_L178_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L482_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L482_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:Expr_L483_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L482_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:Expr_L489_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L482_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:Assign_L490_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L482_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:Assign_L491_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L482_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:Return_L492_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:ClassDef_L178_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L494_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L494_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:Expr_L495_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L494_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:Assign_L496_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L494_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:If_L497_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:If_L497_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:Assign_L498_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L494_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:If_L499_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:If_L499_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:Expr_L500_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:ClassDef_L178_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L502_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L502_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:If_L503_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:If_L503_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:Return_L504_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L502_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:If_L505_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:If_L505_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:Return_L507_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L502_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:If_L508_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:If_L508_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:Return_L509_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:ClassDef_L178_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L512_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:FunctionDef_L512_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:If_L514_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:If_L514_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:Expr_L515_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:If_L514_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:If_L516_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:If_L516_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:If_L517_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:If_L517_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:Expr_L518_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:If_L517_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:If_L519_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99864:If_L519_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99864:Expr_L520_C16"}] |
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import OperatingSystem
OPSYS = OperatingSystem.OperatingSystem()
class DeprecatedOperatingSystem:
ROBOT_LIBRARY_SCOPE = 'GLOBAL'
delete_environment_variable = OPSYS.remove_environment_variable
environment_variable_is_set = OPSYS.environment_variable_should_be_set
environment_variable_is_not_set = OPSYS.environment_variable_should_not_be_set
fail_unless_exists = OPSYS.should_exist
fail_if_exists = OPSYS.should_not_exist
fail_unless_file_exists = OPSYS.file_should_exist
fail_if_file_exists = OPSYS.file_should_not_exist
fail_unless_dir_exists = OPSYS.directory_should_exist
fail_if_dir_exists = OPSYS.directory_should_not_exist
fail_unless_dir_empty = OPSYS.directory_should_be_empty
fail_if_dir_empty = OPSYS.directory_should_not_be_empty
fail_unless_file_empty = OPSYS.file_should_be_empty
fail_if_file_empty = OPSYS.file_should_not_be_empty
empty_dir = OPSYS.empty_directory
remove_dir = OPSYS.remove_directory
copy_dir = OPSYS.copy_directory
move_dir = OPSYS.move_directory
create_dir = OPSYS.create_directory
list_dir = OPSYS.list_directory
list_files_in_dir = OPSYS.list_files_in_directory
list_dirs_in_dir = OPSYS.list_directories_in_directory
count_items_in_dir = OPSYS.count_items_in_directory
count_files_in_dir = OPSYS.count_files_in_directory
count_dirs_in_dir = OPSYS.count_directories_in_directory
| ajibawa-2023/Python-Code-Large/train/row_99865 | 28 | 48 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99865:Import_L16_C0", "label": "OperatingSystem import OperatingSystem", "type": "import", "loc": [16, 16], "level": 0, "parent": null, "vector": [1, 0, 0.3333, 0.0208, 0, 0.66, 0.0, 59, 0, 1, 0, 0, 59, 0, 0], "semantic": {"name": "OperatingSystem", "arg_names": [], "import_names": ["OperatingSystem"], "rhs_call_name": "", "annotation": ""}, "snippet": "import OperatingSystem"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99865:Assign_L18_C0", "label": "OPSYS = OperatingSystem()", "type": "assigned_variable", "loc": [18, 18], "level": 0, "parent": null, "vector": [14, 0, 0.375, 0.0208, 0, 0.66, 0.5, 308, 3, 0, 0, 0, 59, 10, 1], "semantic": {"name": "OPSYS", "arg_names": [], "import_names": [], "rhs_call_name": "OperatingSystem", "annotation": ""}, "snippet": "OPSYS = OperatingSystem.OperatingSystem()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99865:ClassDef_L20_C0", "label": "DeprecatedOperatingSystem", "type": "class", "loc": [20, 48], "level": 0, "parent": null, "vector": [3, 0, 0.7083, 0.6042, 0, 0.66, 1.0, 622, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "DeprecatedOperatingSystem", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class DeprecatedOperatingSystem:\n ROBOT_LIBRARY_SCOPE = 'GLOBAL'\n\n delete_environment_variable = OPSYS.remove_environment_variable\n environment_variable_is_set = OPSYS.environment_variable_should_be_set\n environment_variable_is_not_set = OPSYS.environment_variable_should_not_be_set\n\n fail_unless_exists = OPSYS.should_exist"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99865:Assign_L21_C4", "label": "ROBOT_LIBRARY_SCOPE =", "type": "assigned_variable", "loc": [21, 21], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99865:ClassDef_L20_C0", "vector": [14, 1, 0.4375, 0.0208, 1, 0.65, 0.0, 305, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "ROBOT_LIBRARY_SCOPE", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ROBOT_LIBRARY_SCOPE = 'GLOBAL'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99865:Assign_L23_C4", "label": "delete_environment_variable =", "type": "assigned_variable", "loc": [23, 23], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99865:ClassDef_L20_C0", "vector": [14, 1, 0.4792, 0.0208, 1, 0.65, 0.0417, 198, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "delete_environment_variable", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " delete_environment_variable = OPSYS.remove_environment_variable"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99865:Assign_L24_C4", "label": "environment_variable_is_set =", "type": "assigned_variable", "loc": [24, 24], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99865:ClassDef_L20_C0", "vector": [14, 1, 0.5, 0.0208, 1, 0.65, 0.0833, 435, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "environment_variable_is_set", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " environment_variable_is_set = OPSYS.environment_variable_should_be_set"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99865:Assign_L25_C4", "label": "environment_variable_is_not_set =", "type": "assigned_variable", "loc": [25, 25], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99865:ClassDef_L20_C0", "vector": [14, 1, 0.5208, 0.0208, 1, 0.65, 0.125, 709, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "environment_variable_is_not_set", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " environment_variable_is_not_set = OPSYS.environment_variable_should_not_be_set"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99865:Assign_L27_C4", "label": "fail_unless_exists =", "type": "assigned_variable", "loc": [27, 27], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99865:ClassDef_L20_C0", "vector": [14, 1, 0.5625, 0.0208, 1, 0.65, 0.1667, 960, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "fail_unless_exists", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " fail_unless_exists = OPSYS.should_exist"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99865:Assign_L28_C4", "label": "fail_if_exists =", "type": "assigned_variable", "loc": [28, 28], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99865:ClassDef_L20_C0", "vector": [14, 1, 0.5833, 0.0208, 1, 0.65, 0.2083, 211, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "fail_if_exists", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " fail_if_exists = OPSYS.should_not_exist"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99865:Assign_L29_C4", "label": "fail_unless_file_exists =", "type": "assigned_variable", "loc": [29, 29], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99865:ClassDef_L20_C0", "vector": [14, 1, 0.6042, 0.0208, 1, 0.65, 0.25, 45, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "fail_unless_file_exists", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " fail_unless_file_exists = OPSYS.file_should_exist"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99865:Assign_L30_C4", "label": "fail_if_file_exists =", "type": "assigned_variable", "loc": [30, 30], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99865:ClassDef_L20_C0", "vector": [14, 1, 0.625, 0.0208, 1, 0.65, 0.2917, 65, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "fail_if_file_exists", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " fail_if_file_exists = OPSYS.file_should_not_exist"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99865:Assign_L31_C4", "label": "fail_unless_dir_exists =", "type": "assigned_variable", "loc": [31, 31], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99865:ClassDef_L20_C0", "vector": [14, 1, 0.6458, 0.0208, 1, 0.65, 0.3333, 877, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "fail_unless_dir_exists", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " fail_unless_dir_exists = OPSYS.directory_should_exist"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99865:Assign_L32_C4", "label": "fail_if_dir_exists =", "type": "assigned_variable", "loc": [32, 32], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99865:ClassDef_L20_C0", "vector": [14, 1, 0.6667, 0.0208, 1, 0.65, 0.375, 304, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "fail_if_dir_exists", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " fail_if_dir_exists = OPSYS.directory_should_not_exist"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99865:Assign_L33_C4", "label": "fail_unless_dir_empty =", "type": "assigned_variable", "loc": [33, 33], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99865:ClassDef_L20_C0", "vector": [14, 1, 0.6875, 0.0208, 1, 0.65, 0.4167, 435, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "fail_unless_dir_empty", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " fail_unless_dir_empty = OPSYS.directory_should_be_empty"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99865:Assign_L34_C4", "label": "fail_if_dir_empty =", "type": "assigned_variable", "loc": [34, 34], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99865:ClassDef_L20_C0", "vector": [14, 1, 0.7083, 0.0208, 1, 0.65, 0.4583, 748, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "fail_if_dir_empty", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " fail_if_dir_empty = OPSYS.directory_should_not_be_empty"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99865:Assign_L35_C4", "label": "fail_unless_file_empty =", "type": "assigned_variable", "loc": [35, 35], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99865:ClassDef_L20_C0", "vector": [14, 1, 0.7292, 0.0208, 1, 0.65, 0.5, 373, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "fail_unless_file_empty", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " fail_unless_file_empty = OPSYS.file_should_be_empty"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99865:Assign_L36_C4", "label": "fail_if_file_empty =", "type": "assigned_variable", "loc": [36, 36], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99865:ClassDef_L20_C0", "vector": [14, 1, 0.75, 0.0208, 1, 0.65, 0.5417, 671, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "fail_if_file_empty", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " fail_if_file_empty = OPSYS.file_should_not_be_empty"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99865:Assign_L38_C4", "label": "empty_dir =", "type": "assigned_variable", "loc": [38, 38], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99865:ClassDef_L20_C0", "vector": [14, 1, 0.7917, 0.0208, 1, 0.65, 0.5833, 606, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "empty_dir", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " empty_dir = OPSYS.empty_directory"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99865:Assign_L39_C4", "label": "remove_dir =", "type": "assigned_variable", "loc": [39, 39], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99865:ClassDef_L20_C0", "vector": [14, 1, 0.8125, 0.0208, 1, 0.65, 0.625, 977, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "remove_dir", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " remove_dir = OPSYS.remove_directory"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99865:Assign_L40_C4", "label": "copy_dir =", "type": "assigned_variable", "loc": [40, 40], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99865:ClassDef_L20_C0", "vector": [14, 1, 0.8333, 0.0208, 1, 0.65, 0.6667, 477, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "copy_dir", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " copy_dir = OPSYS.copy_directory"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99865:Assign_L41_C4", "label": "move_dir =", "type": "assigned_variable", "loc": [41, 41], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99865:ClassDef_L20_C0", "vector": [14, 1, 0.8542, 0.0208, 1, 0.65, 0.7083, 21, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "move_dir", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " move_dir = OPSYS.move_directory"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99865:Assign_L42_C4", "label": "create_dir =", "type": "assigned_variable", "loc": [42, 42], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99865:ClassDef_L20_C0", "vector": [14, 1, 0.875, 0.0208, 1, 0.65, 0.75, 331, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "create_dir", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " create_dir = OPSYS.create_directory"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99865:Assign_L43_C4", "label": "list_dir =", "type": "assigned_variable", "loc": [43, 43], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99865:ClassDef_L20_C0", "vector": [14, 1, 0.8958, 0.0208, 1, 0.65, 0.7917, 966, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "list_dir", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " list_dir = OPSYS.list_directory"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99865:Assign_L44_C4", "label": "list_files_in_dir =", "type": "assigned_variable", "loc": [44, 44], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99865:ClassDef_L20_C0", "vector": [14, 1, 0.9167, 0.0208, 1, 0.65, 0.8333, 873, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "list_files_in_dir", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " list_files_in_dir = OPSYS.list_files_in_directory"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99865:Assign_L45_C4", "label": "list_dirs_in_dir =", "type": "assigned_variable", "loc": [45, 45], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99865:ClassDef_L20_C0", "vector": [14, 1, 0.9375, 0.0208, 1, 0.65, 0.875, 505, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "list_dirs_in_dir", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " list_dirs_in_dir = OPSYS.list_directories_in_directory"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99865:Assign_L46_C4", "label": "count_items_in_dir =", "type": "assigned_variable", "loc": [46, 46], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99865:ClassDef_L20_C0", "vector": [14, 1, 0.9583, 0.0208, 1, 0.65, 0.9167, 336, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "count_items_in_dir", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " count_items_in_dir = OPSYS.count_items_in_directory"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99865:Assign_L47_C4", "label": "count_files_in_dir =", "type": "assigned_variable", "loc": [47, 47], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99865:ClassDef_L20_C0", "vector": [14, 1, 0.9792, 0.0208, 1, 0.65, 0.9583, 260, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "count_files_in_dir", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " count_files_in_dir = OPSYS.count_files_in_directory"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99865:Assign_L48_C4", "label": "count_dirs_in_dir =", "type": "assigned_variable", "loc": [48, 48], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99865:ClassDef_L20_C0", "vector": [14, 1, 1.0, 0.0208, 1, 0.65, 1.0, 28, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "count_dirs_in_dir", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " count_dirs_in_dir = OPSYS.count_directories_in_directory"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99865:ClassDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99865:Assign_L21_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99865:ClassDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99865:Assign_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99865:ClassDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99865:Assign_L24_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99865:ClassDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99865:Assign_L25_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99865:ClassDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99865:Assign_L27_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99865:ClassDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99865:Assign_L28_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99865:ClassDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99865:Assign_L29_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99865:ClassDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99865:Assign_L30_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99865:ClassDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99865:Assign_L31_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99865:ClassDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99865:Assign_L32_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99865:ClassDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99865:Assign_L33_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99865:ClassDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99865:Assign_L34_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99865:ClassDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99865:Assign_L35_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99865:ClassDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99865:Assign_L36_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99865:ClassDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99865:Assign_L38_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99865:ClassDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99865:Assign_L39_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99865:ClassDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99865:Assign_L40_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99865:ClassDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99865:Assign_L41_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99865:ClassDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99865:Assign_L42_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99865:ClassDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99865:Assign_L43_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99865:ClassDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99865:Assign_L44_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99865:ClassDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99865:Assign_L45_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99865:ClassDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99865:Assign_L46_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99865:ClassDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99865:Assign_L47_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99865:ClassDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99865:Assign_L48_C4"}] |
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import re
import fnmatch
from robot.utils import asserts
import BuiltIn
BUILTIN = BuiltIn.BuiltIn()
class DeprecatedBuiltIn:
ROBOT_LIBRARY_SCOPE = 'GLOBAL'
integer = BUILTIN.convert_to_integer
float = BUILTIN.convert_to_number
string = BUILTIN.convert_to_string
boolean = BUILTIN.convert_to_boolean
list = BUILTIN.create_list
equal = equals = fail_unless_equal = BUILTIN.should_be_equal
not_equal = not_equals = fail_if_equal = BUILTIN.should_not_be_equal
is_true = fail_unless = BUILTIN.should_be_true
is_false = fail_if = BUILTIN.should_not_be_true
fail_if_ints_equal = ints_not_equal = BUILTIN.should_not_be_equal_as_integers
ints_equal = fail_unless_ints_equal = BUILTIN.should_be_equal_as_integers
floats_not_equal = fail_if_floats_equal = BUILTIN.should_not_be_equal_as_numbers
floats_equal = fail_unless_floats_equal = BUILTIN.should_be_equal_as_numbers
does_not_start = fail_if_starts = BUILTIN.should_not_start_with
starts = fail_unless_starts = BUILTIN.should_start_with
does_not_end = fail_if_ends = BUILTIN.should_not_end_with
ends = fail_unless_ends = BUILTIN.should_end_with
does_not_contain = fail_if_contains = BUILTIN.should_not_contain
contains = fail_unless_contains = BUILTIN.should_contain
does_not_match = fail_if_matches = BUILTIN.should_not_match
matches = fail_unless_matches = BUILTIN.should_match
does_not_match_regexp = fail_if_regexp_matches = BUILTIN.should_not_match_regexp
matches_regexp = fail_unless_regexp_matches = BUILTIN.should_match_regexp
noop = BUILTIN.no_operation
set_ = BUILTIN.set_variable
message = BUILTIN.comment
variable_exists = fail_unless_variable_exists = BUILTIN.variable_should_exist
variable_does_not_exist = fail_if_variable_exists = BUILTIN.variable_should_not_exist
def error(self, msg=None):
"""Errors the test immediately with the given message."""
asserts.error(msg)
def grep(self, text, pattern, pattern_type='literal string'):
lines = self._filter_lines(text.splitlines(), pattern, pattern_type)
return '\n'.join(lines)
def _filter_lines(self, lines, pattern, ptype):
ptype = ptype.lower().replace(' ','').replace('-','')
if not pattern:
filtr = lambda line: True
elif 'simple' in ptype or 'glob' in ptype:
if 'caseinsensitive' in ptype:
pattern = pattern.lower()
filtr = lambda line: fnmatch.fnmatchcase(line.lower(), pattern)
else:
filtr = lambda line: fnmatch.fnmatchcase(line, pattern)
elif 'regularexpression' in ptype or 'regexp' in ptype:
pattern = re.compile(pattern)
filtr = lambda line: pattern.search(line)
elif 'caseinsensitive' in ptype:
pattern = pattern.lower()
filtr = lambda line: pattern in line.lower()
else:
filtr = lambda line: pattern in line
return [ line for line in lines if filtr(line) ]
| ajibawa-2023/Python-Code-Large/train/row_99868 | 58 | 89 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99868:Import_L16_C0", "label": "re import re", "type": "import", "loc": [16, 16], "level": 0, "parent": null, "vector": [1, 0, 0.1798, 0.0112, 0, 0.66, 0.0, 540, 0, 1, 0, 0, 540, 0, 0], "semantic": {"name": "re", "arg_names": [], "import_names": ["re"], "rhs_call_name": "", "annotation": ""}, "snippet": "import re"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99868:Import_L17_C0", "label": "fnmatch import fnmatch", "type": "import", "loc": [17, 17], "level": 0, "parent": null, "vector": [1, 0, 0.191, 0.0112, 0, 0.66, 0.2, 626, 0, 1, 0, 0, 626, 0, 0], "semantic": {"name": "fnmatch", "arg_names": [], "import_names": ["fnmatch"], "rhs_call_name": "", "annotation": ""}, "snippet": "import fnmatch"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99868:ImportFrom_L20_C0", "label": "from robot.utils import asserts", "type": "import", "loc": [20, 20], "level": 0, "parent": null, "vector": [1, 0, 0.2247, 0.0112, 0, 0.66, 0.4, 417, 0, 1, 0, 0, 417, 0, 0], "semantic": {"name": "robot.utils", "arg_names": [], "import_names": ["asserts"], "rhs_call_name": "", "annotation": ""}, "snippet": "from robot.utils import asserts"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99868:Import_L22_C0", "label": "BuiltIn import BuiltIn", "type": "import", "loc": [22, 22], "level": 0, "parent": null, "vector": [1, 0, 0.2472, 0.0112, 0, 0.66, 0.6, 961, 0, 1, 0, 0, 961, 0, 0], "semantic": {"name": "BuiltIn", "arg_names": [], "import_names": ["BuiltIn"], "rhs_call_name": "", "annotation": ""}, "snippet": "import BuiltIn"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99868:Assign_L25_C0", "label": "BUILTIN = BuiltIn()", "type": "assigned_variable", "loc": [25, 25], "level": 0, "parent": null, "vector": [14, 0, 0.2809, 0.0112, 0, 0.66, 0.8, 152, 3, 0, 0, 0, 961, 10, 1], "semantic": {"name": "BUILTIN", "arg_names": [], "import_names": [], "rhs_call_name": "BuiltIn", "annotation": ""}, "snippet": "BUILTIN = BuiltIn.BuiltIn()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99868:ClassDef_L27_C0", "label": "DeprecatedBuiltIn", "type": "class", "loc": [27, 88], "level": 0, "parent": null, "vector": [3, 0, 0.6461, 0.6966, 0, 0.66, 1.0, 674, 0, 3, 0, 0, 0, 0, 16], "semantic": {"name": "DeprecatedBuiltIn", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class DeprecatedBuiltIn:\n ROBOT_LIBRARY_SCOPE = 'GLOBAL'\n\n integer = BUILTIN.convert_to_integer\n float = BUILTIN.convert_to_number\n string = BUILTIN.convert_to_string\n boolean = BUILTIN.convert_to_boolean\n list = BUILTIN.create_list"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99868:Assign_L28_C4", "label": "ROBOT_LIBRARY_SCOPE =", "type": "assigned_variable", "loc": [28, 28], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99868:ClassDef_L27_C0", "vector": [14, 1, 0.3146, 0.0112, 1, 0.79, 0.0, 305, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "ROBOT_LIBRARY_SCOPE", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ROBOT_LIBRARY_SCOPE = 'GLOBAL'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99868:Assign_L30_C4", "label": "integer =", "type": "assigned_variable", "loc": [30, 30], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99868:ClassDef_L27_C0", "vector": [14, 1, 0.3371, 0.0112, 1, 0.79, 0.0323, 441, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "integer", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " integer = BUILTIN.convert_to_integer"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99868:Assign_L31_C4", "label": "float =", "type": "assigned_variable", "loc": [31, 31], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99868:ClassDef_L27_C0", "vector": [14, 1, 0.3483, 0.0112, 1, 0.79, 0.0645, 639, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "float", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " float = BUILTIN.convert_to_number"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99868:Assign_L32_C4", "label": "string =", "type": "assigned_variable", "loc": [32, 32], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99868:ClassDef_L27_C0", "vector": [14, 1, 0.3596, 0.0112, 1, 0.79, 0.0968, 890, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "string", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " string = BUILTIN.convert_to_string"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99868:Assign_L33_C4", "label": "boolean =", "type": "assigned_variable", "loc": [33, 33], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99868:ClassDef_L27_C0", "vector": [14, 1, 0.3708, 0.0112, 1, 0.79, 0.129, 756, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "boolean", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " boolean = BUILTIN.convert_to_boolean"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99868:Assign_L34_C4", "label": "list =", "type": "assigned_variable", "loc": [34, 34], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99868:ClassDef_L27_C0", "vector": [14, 1, 0.382, 0.0112, 1, 0.79, 0.1613, 430, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " list = BUILTIN.create_list"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99868:Assign_L36_C4", "label": "equal =", "type": "assigned_variable", "loc": [36, 36], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99868:ClassDef_L27_C0", "vector": [14, 1, 0.4045, 0.0112, 1, 0.79, 0.1935, 579, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "equal", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " equal = equals = fail_unless_equal = BUILTIN.should_be_equal"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99868:Assign_L37_C4", "label": "not_equal =", "type": "assigned_variable", "loc": [37, 37], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99868:ClassDef_L27_C0", "vector": [14, 1, 0.4157, 0.0112, 1, 0.79, 0.2258, 106, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "not_equal", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " not_equal = not_equals = fail_if_equal = BUILTIN.should_not_be_equal"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99868:Assign_L38_C4", "label": "is_true =", "type": "assigned_variable", "loc": [38, 38], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99868:ClassDef_L27_C0", "vector": [14, 1, 0.427, 0.0112, 1, 0.79, 0.2581, 526, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "is_true", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " is_true = fail_unless = BUILTIN.should_be_true"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99868:Assign_L39_C4", "label": "is_false =", "type": "assigned_variable", "loc": [39, 39], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99868:ClassDef_L27_C0", "vector": [14, 1, 0.4382, 0.0112, 1, 0.79, 0.2903, 389, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "is_false", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " is_false = fail_if = BUILTIN.should_not_be_true"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99868:Assign_L40_C4", "label": "fail_if_ints_equal =", "type": "assigned_variable", "loc": [40, 40], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99868:ClassDef_L27_C0", "vector": [14, 1, 0.4494, 0.0112, 1, 0.79, 0.3226, 652, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "fail_if_ints_equal", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " fail_if_ints_equal = ints_not_equal = BUILTIN.should_not_be_equal_as_integers"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99868:Assign_L41_C4", "label": "ints_equal =", "type": "assigned_variable", "loc": [41, 41], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99868:ClassDef_L27_C0", "vector": [14, 1, 0.4607, 0.0112, 1, 0.79, 0.3548, 366, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ints_equal", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ints_equal = fail_unless_ints_equal = BUILTIN.should_be_equal_as_integers"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99868:Assign_L42_C4", "label": "floats_not_equal =", "type": "assigned_variable", "loc": [42, 42], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99868:ClassDef_L27_C0", "vector": [14, 1, 0.4719, 0.0112, 1, 0.79, 0.3871, 315, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "floats_not_equal", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " floats_not_equal = fail_if_floats_equal = BUILTIN.should_not_be_equal_as_numbers"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99868:Assign_L43_C4", "label": "floats_equal =", "type": "assigned_variable", "loc": [43, 43], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99868:ClassDef_L27_C0", "vector": [14, 1, 0.4831, 0.0112, 1, 0.79, 0.4194, 401, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "floats_equal", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " floats_equal = fail_unless_floats_equal = BUILTIN.should_be_equal_as_numbers"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99868:Assign_L44_C4", "label": "does_not_start =", "type": "assigned_variable", "loc": [44, 44], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99868:ClassDef_L27_C0", "vector": [14, 1, 0.4944, 0.0112, 1, 0.79, 0.4516, 107, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "does_not_start", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " does_not_start = fail_if_starts = BUILTIN.should_not_start_with"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99868:Assign_L45_C4", "label": "starts =", "type": "assigned_variable", "loc": [45, 45], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99868:ClassDef_L27_C0", "vector": [14, 1, 0.5056, 0.0112, 1, 0.79, 0.4839, 730, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "starts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " starts = fail_unless_starts = BUILTIN.should_start_with"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99868:Assign_L46_C4", "label": "does_not_end =", "type": "assigned_variable", "loc": [46, 46], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99868:ClassDef_L27_C0", "vector": [14, 1, 0.5169, 0.0112, 1, 0.79, 0.5161, 521, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "does_not_end", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " does_not_end = fail_if_ends = BUILTIN.should_not_end_with"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99868:Assign_L47_C4", "label": "ends =", "type": "assigned_variable", "loc": [47, 47], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99868:ClassDef_L27_C0", "vector": [14, 1, 0.5281, 0.0112, 1, 0.79, 0.5484, 820, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ends", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ends = fail_unless_ends = BUILTIN.should_end_with"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99868:Assign_L48_C4", "label": "does_not_contain =", "type": "assigned_variable", "loc": [48, 48], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99868:ClassDef_L27_C0", "vector": [14, 1, 0.5393, 0.0112, 1, 0.79, 0.5806, 674, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "does_not_contain", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " does_not_contain = fail_if_contains = BUILTIN.should_not_contain"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99868:Assign_L49_C4", "label": "contains =", "type": "assigned_variable", "loc": [49, 49], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99868:ClassDef_L27_C0", "vector": [14, 1, 0.5506, 0.0112, 1, 0.79, 0.6129, 848, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "contains", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " contains = fail_unless_contains = BUILTIN.should_contain"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99868:Assign_L50_C4", "label": "does_not_match =", "type": "assigned_variable", "loc": [50, 50], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99868:ClassDef_L27_C0", "vector": [14, 1, 0.5618, 0.0112, 1, 0.79, 0.6452, 467, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "does_not_match", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " does_not_match = fail_if_matches = BUILTIN.should_not_match"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99868:Assign_L51_C4", "label": "matches =", "type": "assigned_variable", "loc": [51, 51], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99868:ClassDef_L27_C0", "vector": [14, 1, 0.573, 0.0112, 1, 0.79, 0.6774, 684, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "matches", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " matches = fail_unless_matches = BUILTIN.should_match"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99868:Assign_L52_C4", "label": "does_not_match_regexp =", "type": "assigned_variable", "loc": [52, 52], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99868:ClassDef_L27_C0", "vector": [14, 1, 0.5843, 0.0112, 1, 0.79, 0.7097, 795, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "does_not_match_regexp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " does_not_match_regexp = fail_if_regexp_matches = BUILTIN.should_not_match_regexp"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99868:Assign_L53_C4", "label": "matches_regexp =", "type": "assigned_variable", "loc": [53, 53], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99868:ClassDef_L27_C0", "vector": [14, 1, 0.5955, 0.0112, 1, 0.79, 0.7419, 941, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "matches_regexp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " matches_regexp = fail_unless_regexp_matches = BUILTIN.should_match_regexp"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99868:Assign_L55_C4", "label": "noop =", "type": "assigned_variable", "loc": [55, 55], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99868:ClassDef_L27_C0", "vector": [14, 1, 0.618, 0.0112, 1, 0.79, 0.7742, 907, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "noop", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " noop = BUILTIN.no_operation"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99868:Assign_L56_C4", "label": "set_ =", "type": "assigned_variable", "loc": [56, 56], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99868:ClassDef_L27_C0", "vector": [14, 1, 0.6292, 0.0112, 1, 0.79, 0.8065, 820, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "set_", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " set_ = BUILTIN.set_variable"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99868:Assign_L57_C4", "label": "message =", "type": "assigned_variable", "loc": [57, 57], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99868:ClassDef_L27_C0", "vector": [14, 1, 0.6404, 0.0112, 1, 0.79, 0.8387, 635, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "message", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " message = BUILTIN.comment"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99868:Assign_L59_C4", "label": "variable_exists =", "type": "assigned_variable", "loc": [59, 59], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99868:ClassDef_L27_C0", "vector": [14, 1, 0.6629, 0.0112, 1, 0.79, 0.871, 791, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "variable_exists", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " variable_exists = fail_unless_variable_exists = BUILTIN.variable_should_exist"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99868:Assign_L60_C4", "label": "variable_does_not_exist =", "type": "assigned_variable", "loc": [60, 60], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99868:ClassDef_L27_C0", "vector": [14, 1, 0.6742, 0.0112, 1, 0.79, 0.9032, 536, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "variable_does_not_exist", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " variable_does_not_exist = fail_if_variable_exists = BUILTIN.variable_should_not_exist"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99868:FunctionDef_L62_C4", "label": "error", "type": "function", "loc": [62, 64], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99868:ClassDef_L27_C0", "vector": [2, 1, 0.7079, 0.0337, 1, 0.79, 0.9355, 771, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "error", "arg_names": ["self", "msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def error(self, msg=None):\n \"\"\"Errors the test immediately with the given message.\"\"\"\n asserts.error(msg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99868:Expr_L63_C8", "label": "expression", "type": "expression", "loc": [63, 63], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99868:FunctionDef_L62_C4", "vector": [8, 2, 0.7079, 0.0112, 2, 0.38, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Errors the test immediately with the given message.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99868:Expr_L64_C8", "label": "error()", "type": "expression", "loc": [64, 64], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99868:FunctionDef_L62_C4", "vector": [8, 2, 0.7191, 0.0112, 2, 0.38, 1.0, 771, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "error", "arg_names": [], "import_names": [], "rhs_call_name": "error", "annotation": ""}, "snippet": " asserts.error(msg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99868:FunctionDef_L66_C4", "label": "grep", "type": "function", "loc": [66, 68], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99868:ClassDef_L27_C0", "vector": [2, 1, 0.7528, 0.0337, 1, 0.79, 0.9677, 21, 0, 4, 1, 0, 0, 0, 3], "semantic": {"name": "grep", "arg_names": ["self", "text", "pattern", "pattern_type"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def grep(self, text, pattern, pattern_type='literal string'):\n lines = self._filter_lines(text.splitlines(), pattern, pattern_type)\n return '\\n'.join(lines)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99868:Assign_L67_C8", "label": "lines = _filter_lines()", "type": "assigned_variable", "loc": [67, 67], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99868:FunctionDef_L66_C4", "vector": [14, 2, 0.7528, 0.0112, 2, 0.04, 0.0, 73, 3, 3, 0, 0, 903, 10, 2], "semantic": {"name": "lines", "arg_names": [], "import_names": [], "rhs_call_name": "_filter_lines", "annotation": ""}, "snippet": " lines = self._filter_lines(text.splitlines(), pattern, pattern_type)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99868:Return_L68_C8", "label": "return", "type": "return", "loc": [68, 68], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99868:FunctionDef_L66_C4", "vector": [13, 2, 0.764, 0.0112, 2, 0.04, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return '\\n'.join(lines)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99868:FunctionDef_L70_C4", "label": "_filter_lines", "type": "function", "loc": [70, 88], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99868:ClassDef_L27_C0", "vector": [2, 1, 0.8876, 0.2135, 1, 0.79, 1.0, 903, 0, 4, 1, 0, 0, 0, 12], "semantic": {"name": "_filter_lines", "arg_names": ["self", "lines", "pattern", "ptype"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _filter_lines(self, lines, pattern, ptype):\n ptype = ptype.lower().replace(' ','').replace('-','')\n if not pattern:\n filtr = lambda line: True\n elif 'simple' in ptype or 'glob' in ptype:\n if 'caseinsensitive' in ptype:\n pattern = pattern.lower()\n filtr = lambda line: fnmatch.fnmatchcase(line.lower(), pattern)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99868:Assign_L71_C8", "label": "ptype = replace()", "type": "assigned_variable", "loc": [71, 71], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99868:FunctionDef_L70_C4", "vector": [14, 2, 0.7978, 0.0112, 2, 0.45, 0.0, 597, 3, 2, 0, 0, 293, 10, 3], "semantic": {"name": "ptype", "arg_names": [], "import_names": [], "rhs_call_name": "replace", "annotation": ""}, "snippet": " ptype = ptype.lower().replace(' ','').replace('-','')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99868:If_L72_C8", "label": "if", "type": "if", "loc": [72, 87], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99868:FunctionDef_L70_C4", "vector": [4, 2, 0.8933, 0.1798, 2, 0.45, 0.5, 0, 0, 0, 0, 0, 0, 0, 8], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not pattern:\n filtr = lambda line: True\n elif 'simple' in ptype or 'glob' in ptype:\n if 'caseinsensitive' in ptype:\n pattern = pattern.lower()\n filtr = lambda line: fnmatch.fnmatchcase(line.lower(), pattern)\n else:\n filtr = lambda line: fnmatch.fnmatchcase(line, pattern)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99868:Assign_L73_C12", "label": "filtr =", "type": "assigned_variable", "loc": [73, 73], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99868:If_L72_C8", "vector": [14, 3, 0.8202, 0.0112, 3, 0.49, 0.0, 743, 9, 0, 0, 0, 0, 0, 0], "semantic": {"name": "filtr", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " filtr = lambda line: True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99868:If_L74_C8", "label": "if", "type": "if", "loc": [74, 87], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99868:If_L72_C8", "vector": [4, 3, 0.9045, 0.1573, 3, 0.49, 1.0, 0, 0, 0, 0, 0, 0, 0, 8], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif 'simple' in ptype or 'glob' in ptype:\n if 'caseinsensitive' in ptype:\n pattern = pattern.lower()\n filtr = lambda line: fnmatch.fnmatchcase(line.lower(), pattern)\n else:\n filtr = lambda line: fnmatch.fnmatchcase(line, pattern)\n elif 'regularexpression' in ptype or 'regexp' in ptype:\n pattern = re.compile(pattern)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99868:If_L75_C12", "label": "if", "type": "if", "loc": [75, 79], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99868:If_L74_C8", "vector": [4, 4, 0.8652, 0.0562, 4, 0.16, 0.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if 'caseinsensitive' in ptype:\n pattern = pattern.lower()\n filtr = lambda line: fnmatch.fnmatchcase(line.lower(), pattern)\n else:\n filtr = lambda line: fnmatch.fnmatchcase(line, pattern)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99868:Assign_L76_C16", "label": "pattern = lower()", "type": "assigned_variable", "loc": [76, 76], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99868:If_L75_C12", "vector": [14, 5, 0.8539, 0.0112, 5, 0.2, 0.0, 561, 3, 0, 0, 0, 432, 10, 1], "semantic": {"name": "pattern", "arg_names": [], "import_names": [], "rhs_call_name": "lower", "annotation": ""}, "snippet": " pattern = pattern.lower()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99868:Assign_L77_C16", "label": "filtr =", "type": "assigned_variable", "loc": [77, 77], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99868:If_L75_C12", "vector": [14, 5, 0.8652, 0.0112, 5, 0.2, 0.5, 743, 9, 0, 0, 0, 0, 0, 2], "semantic": {"name": "filtr", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " filtr = lambda line: fnmatch.fnmatchcase(line.lower(), pattern)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99868:Assign_L79_C16", "label": "filtr =", "type": "assigned_variable", "loc": [79, 79], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99868:If_L75_C12", "vector": [14, 5, 0.8876, 0.0112, 5, 0.2, 1.0, 743, 9, 0, 0, 0, 0, 0, 1], "semantic": {"name": "filtr", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " filtr = lambda line: fnmatch.fnmatchcase(line, pattern)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99868:If_L80_C8", "label": "if", "type": "if", "loc": [80, 87], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99868:If_L74_C8", "vector": [4, 4, 0.9382, 0.0899, 4, 0.16, 1.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif 'regularexpression' in ptype or 'regexp' in ptype:\n pattern = re.compile(pattern)\n filtr = lambda line: pattern.search(line)\n elif 'caseinsensitive' in ptype:\n pattern = pattern.lower()\n filtr = lambda line: pattern in line.lower()\n else:\n filtr = lambda line: pattern in line"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99868:Assign_L81_C12", "label": "pattern = compile()", "type": "assigned_variable", "loc": [81, 81], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99868:If_L80_C8", "vector": [14, 5, 0.9101, 0.0112, 5, 0.48, 0.0, 561, 3, 1, 0, 0, 821, 10, 1], "semantic": {"name": "pattern", "arg_names": [], "import_names": [], "rhs_call_name": "compile", "annotation": ""}, "snippet": " pattern = re.compile(pattern)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99868:Assign_L82_C12", "label": "filtr =", "type": "assigned_variable", "loc": [82, 82], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99868:If_L80_C8", "vector": [14, 5, 0.9213, 0.0112, 5, 0.48, 0.5, 743, 9, 0, 0, 0, 0, 0, 1], "semantic": {"name": "filtr", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " filtr = lambda line: pattern.search(line)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99868:If_L83_C8", "label": "if", "type": "if", "loc": [83, 87], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99868:If_L80_C8", "vector": [4, 5, 0.9551, 0.0562, 5, 0.48, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif 'caseinsensitive' in ptype:\n pattern = pattern.lower()\n filtr = lambda line: pattern in line.lower()\n else:\n filtr = lambda line: pattern in line"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99868:Assign_L84_C12", "label": "pattern = lower()", "type": "assigned_variable", "loc": [84, 84], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99868:If_L83_C8", "vector": [14, 6, 0.9438, 0.0112, 6, 0.35, 0.0, 561, 3, 0, 0, 0, 432, 10, 1], "semantic": {"name": "pattern", "arg_names": [], "import_names": [], "rhs_call_name": "lower", "annotation": ""}, "snippet": " pattern = pattern.lower()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99868:Assign_L85_C12", "label": "filtr =", "type": "assigned_variable", "loc": [85, 85], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99868:If_L83_C8", "vector": [14, 6, 0.9551, 0.0112, 6, 0.35, 0.5, 743, 9, 0, 0, 0, 0, 0, 1], "semantic": {"name": "filtr", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " filtr = lambda line: pattern in line.lower()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99868:Assign_L87_C12", "label": "filtr =", "type": "assigned_variable", "loc": [87, 87], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99868:If_L83_C8", "vector": [14, 6, 0.9775, 0.0112, 6, 0.35, 1.0, 743, 9, 0, 0, 0, 0, 0, 0], "semantic": {"name": "filtr", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " filtr = lambda line: pattern in line"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99868:Return_L88_C8", "label": "return", "type": "return", "loc": [88, 88], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99868:FunctionDef_L70_C4", "vector": [13, 2, 0.9888, 0.0112, 2, 0.45, 1.0, 0, 5, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return [ line for line in lines if filtr(line) ]"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99868:ClassDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99868:Assign_L28_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99868:ClassDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99868:Assign_L30_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99868:ClassDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99868:Assign_L31_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99868:ClassDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99868:Assign_L32_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99868:ClassDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99868:Assign_L33_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99868:ClassDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99868:Assign_L34_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99868:ClassDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99868:Assign_L36_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99868:ClassDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99868:Assign_L37_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99868:ClassDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99868:Assign_L38_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99868:ClassDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99868:Assign_L39_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99868:ClassDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99868:Assign_L40_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99868:ClassDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99868:Assign_L41_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99868:ClassDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99868:Assign_L42_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99868:ClassDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99868:Assign_L43_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99868:ClassDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99868:Assign_L44_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99868:ClassDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99868:Assign_L45_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99868:ClassDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99868:Assign_L46_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99868:ClassDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99868:Assign_L47_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99868:ClassDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99868:Assign_L48_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99868:ClassDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99868:Assign_L49_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99868:ClassDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99868:Assign_L50_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99868:ClassDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99868:Assign_L51_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99868:ClassDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99868:Assign_L52_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99868:ClassDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99868:Assign_L53_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99868:ClassDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99868:Assign_L55_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99868:ClassDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99868:Assign_L56_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99868:ClassDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99868:Assign_L57_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99868:ClassDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99868:Assign_L59_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99868:ClassDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99868:Assign_L60_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99868:ClassDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99868:FunctionDef_L62_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99868:FunctionDef_L62_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99868:Expr_L63_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99868:FunctionDef_L62_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99868:Expr_L64_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99868:ClassDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99868:FunctionDef_L66_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99868:FunctionDef_L66_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99868:Assign_L67_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99868:FunctionDef_L66_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99868:Return_L68_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99868:ClassDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99868:FunctionDef_L70_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99868:FunctionDef_L70_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99868:Assign_L71_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99868:FunctionDef_L70_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99868:If_L72_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99868:If_L72_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99868:Assign_L73_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99868:If_L72_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99868:If_L74_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99868:If_L74_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99868:If_L75_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99868:If_L75_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99868:Assign_L76_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99868:If_L75_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99868:Assign_L77_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99868:If_L75_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99868:Assign_L79_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99868:If_L74_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99868:If_L80_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99868:If_L80_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99868:Assign_L81_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99868:If_L80_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99868:Assign_L82_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99868:If_L80_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99868:If_L83_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99868:If_L83_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99868:Assign_L84_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99868:If_L83_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99868:Assign_L85_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99868:If_L83_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99868:Assign_L87_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99868:FunctionDef_L70_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99868:Return_L88_C8"}] |
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import re
from fnmatch import fnmatchcase
from random import randint
from string import ascii_lowercase, ascii_uppercase, digits
from robot.version import get_version
class String:
"""A test library for string manipulation and verification.
`String` is Robot Framework's standard library for manipulating
strings (e.g. `Replace String Using Regexp`, `Split To Lines`) and
verifying their contents (e.g. `Should Be String`).
Following keywords from the BuiltIn library can also be used with
strings:
- `Catenate`
- `Get Length`
- `Length Should Be`
- `Should (Not) Match (Regexp)`
- `Should (Not) Be Empty`
- `Should (Not) Be Equal (As Strings/Integers/Numbers)`
- `Should (Not) Contain`
- `Should (Not) Start With`
- `Should (Not) End With`
"""
ROBOT_LIBRARY_SCOPE = 'GLOBAL'
ROBOT_LIBRARY_VERSION = get_version()
def get_line_count(self, string):
"""Returns and logs the number of lines in the given `string`."""
count = len(string.splitlines())
print '*INFO* %d lines' % count
return count
def split_to_lines(self, string, start=0, end=None):
"""Converts the `string` into a list of lines.
It is possible to get only a selection of lines from `start`
to `end` so that `start` index is inclusive and `end` is
exclusive. Line numbering starts from 0, and it is possible to
use negative indices to refer to lines from the end.
Lines are returned without the newlines. The number of
returned lines is automatically logged.
Examples:
| @{lines} = | Split To Lines | ${manylines} | | |
| @{ignore first} = | Split To Lines | ${manylines} | 1 | |
| @{ignore last} = | Split To Lines | ${manylines} | | -1 |
| @{5th to 10th} = | Split To Lines | ${manylines} | 4 | 10 |
| @{first two} = | Split To Lines | ${manylines} | | 1 |
| @{last two} = | Split To Lines | ${manylines} | -2 | |
Use `Get Line` if you only need to get a single line.
"""
start = self._convert_to_index(start, 'start')
end = self._convert_to_index(end, 'end')
lines = string.splitlines()[start:end]
print '*INFO* %d lines returned' % len(lines)
return lines
def get_line(self, string, line_number):
"""Returns the specified line from the given `string`.
Line numbering starts from 0 and it is possible to use
negative indices to refer to lines from the end. The line is
returned without the newline character.
Examples:
| ${first} = | Get Line | ${string} | 0 |
| ${2nd last} = | Get Line | ${string} | -2 |
"""
line_number = self._convert_to_integer(line_number, 'line_number')
return string.splitlines()[line_number]
def get_lines_containing_string(self, string, pattern, case_insensitive=False):
"""Returns lines of the given `string` that contain the `pattern`.
The `pattern` is always considered to be a normal string and a
line matches if the `pattern` is found anywhere in it. By
default the match is case-sensitive, but setting
`case_insensitive` to any value makes it case-insensitive.
Lines are returned as one string catenated back together with
newlines. Possible trailing newline is never returned. The
number of matching lines is automatically logged.
Examples:
| ${lines} = | Get Lines Containing String | ${result} | An example |
| ${ret} = | Get Lines Containing String | ${ret} | FAIL | case-insensitive |
See `Get Lines Matching Pattern` and `Get Lines Matching Regexp`
if you need more complex pattern matching.
"""
if case_insensitive:
pattern = pattern.lower()
contains = lambda line: pattern in line.lower()
else:
contains = lambda line: pattern in line
return self._get_matching_lines(string, contains)
def get_lines_matching_pattern(self, string, pattern, case_insensitive=False):
"""Returns lines of the given `string` that match the `pattern`.
The `pattern` is a _glob pattern_ where:
| * | matches everything |
| ? | matches any single character |
| [chars] | matches any character inside square brackets (e.g. '[abc]' matches either 'a', 'b' or 'c') |
| [!chars] | matches any character not inside square brackets |
A line matches only if it matches the `pattern` fully. By
default the match is case-sensitive, but setting
`case_insensitive` to any value makes it case-insensitive.
Lines are returned as one string catenated back together with
newlines. Possible trailing newline is never returned. The
number of matching lines is automatically logged.
Examples:
| ${lines} = | Get Lines Matching Pattern | ${result} | Wild???? example |
| ${ret} = | Get Lines Matching Pattern | ${ret} | FAIL: * | case-insensitive |
See `Get Lines Matching Regexp` if you need more complex
patterns and `Get Lines Containing String` if searching
literal strings is enough.
"""
if case_insensitive:
pattern = pattern.lower()
matches = lambda line: fnmatchcase(line.lower(), pattern)
else:
matches = lambda line: fnmatchcase(line, pattern)
return self._get_matching_lines(string, matches)
def get_lines_matching_regexp(self, string, pattern):
"""Returns lines of the given `string` that match the regexp `pattern`.
See `BuiltIn.Should Match Regexp` for more information about
Python regular expression syntax in general and how to use it
in Robot Framework test data in particular. A line matches
only if it matches the `pattern` fully. Notice that to make
the match case-insensitive, you need to embed case-insensitive
flag into the pattern.
Lines are returned as one string catenated back together with
newlines. Possible trailing newline is never returned. The
number of matching lines is automatically logged.
Examples:
| ${lines} = | Get Lines Matching Regexp | ${result} | Reg\\\\w{3} example |
| ${ret} = | Get Lines Matching Regexp | ${ret} | (?i)FAIL: .* |
See `Get Lines Matching Pattern` and `Get Lines Containing
String` if you do not need full regular expression powers (and
complexity).
"""
regexp = re.compile('^%s$' % pattern)
return self._get_matching_lines(string, regexp.match)
def _get_matching_lines(self, string, matches):
lines = string.splitlines()
matching = [ line for line in lines if matches(line) ]
print '*INFO* %d out of %d lines matched' % (len(matching), len(lines))
return '\n'.join(matching)
def replace_string(self, string, search_for, replace_with, count=-1):
"""Replaces `search_for` in the given `string` with `replace_with`.
`search_for` is used as a literal string. See `Replace String
Using Regexp` if more powerful pattern matching is needed.
If the optional argument `count` is given, only that many
occurrences from left are replaced. Negative `count` means
that all occurrences are replaced (default behaviour) and zero
means that nothing is done.
A modified version of the string is returned and the original
string is not altered.
Examples:
| ${str} = | Replace String | ${str} | Hello | Hi | |
| ${str} = | Replace String | ${str} | world | tellus | 1 |
"""
count = self._convert_to_integer(count, 'count')
return string.replace(search_for, replace_with, count)
def replace_string_using_regexp(self, string, pattern, replace_with, count=-1):
"""Replaces `pattern` in the given `string` with `replace_with`.
This keyword is otherwise identical to `Replace String`, but
the `pattern` to search for is considered to be a regular
expression. See `BuiltIn.Should Match Regexp` for more
information about Python regular expression syntax in general
and how to use it in Robot Framework test data in particular.
Examples:
| ${str} = | Replace String Using Regexp | ${str} | (Hello|Hi) | Hei | |
| ${str} = | Replace String Using Regexp | ${str} | 20\\\\d\\\\d-\\\\d\\\\d-\\\\d\\\\d | <DATE> | 2 |
"""
count = self._convert_to_integer(count, 'count')
# re.sub handles 0 and negative counts differently than string.replace
if count < 0:
count = 0
elif count == 0:
count = -1
return re.sub(pattern, replace_with, string, count)
def split_string(self, string, separator=None, max_split=-1):
"""Splits the `string` using `separator` as a delimiter string.
If a `separator` is not given, any whitespace string is a
separator. In that case also possible consecutive whitespace
as well as leading and trailing whitespace is ignored.
Split words are returned as a list. If the optional
`max_split` is given, at most `max_split` splits are done, and
the returned list will have maximum `max_split + 1` elements.
Examples:
| @{words} = | Split String | ${string} |
| @{words} = | Split String | ${string} | ,${SPACE} |
| ${pre} | ${post} = | Split String | ${string} | :: | 1 |
See `Split String From Right` if you want to start splitting
from right, and `Fetch From Left` and `Fetch From Right` if
you only want to get first/last part of the string.
"""
if separator == '':
separator = None
max_split = self._convert_to_integer(max_split, 'max_split')
return string.split(separator, max_split)
def split_string_from_right(self, string, separator=None, max_split=-1):
"""Splits the `string` using `separator` starting from right.
Same as `Split String`, but splitting is started from right. This has
an effect only when `max_split` is given.
Examples:
| ${first} | ${others} = | Split String | ${string} | - | 1 |
| ${others} | ${last} = | Split String From Right | ${string} | - | 1 |
"""
# Strings in Jython 2.2 don't have 'rsplit' methods
reversed = self.split_string(string[::-1], separator, max_split)
return [ r[::-1] for r in reversed ][::-1]
def fetch_from_left(self, string, marker):
"""Returns contents of the `string` before the first occurrence of `marker`.
If the `marker` is not found, whole string is returned.
See also `Fetch From Right`, `Split String` and `Split String
From Right`.
"""
return string.split(marker)[0]
def fetch_from_right(self, string, marker):
"""Returns contents of the `string` after the last occurrence of `marker`.
If the `marker` is not found, whole string is returned.
See also `Fetch From Left`, `Split String` and `Split String
From Right`.
"""
return string.split(marker)[-1]
def generate_random_string(self, length=8, chars='[LETTERS][NUMBERS]'):
"""Generates a string with a desired `length` from the given `chars`.
The population sequence `chars` contains the characters to use
when generating the random string. It can contain any
characters, and it is possible to use special markers
explained in the table below:
| _[LOWER]_ | Lowercase ASCII characters from 'a' to 'z'. |
| _[UPPER]_ | Uppercase ASCII characters from 'A' to 'Z'. |
| _[LETTERS]_ | Lowercase and uppercase ASCII characters. |
| _[NUMBERS]_ | Numbers from 0 to 9. |
Examples:
| ${ret} = | Generate Random String |
| ${low} = | Generate Random String | 12 | [LOWER] |
| ${bin} = | Generate Random String | 8 | 01 |
| ${hex} = | Generate Random String | 4 | [NUMBERS]abcdef |
"""
if length == '':
length = 8
length = self._convert_to_integer(length, 'length')
for name, value in [('[LOWER]', ascii_lowercase),
('[UPPER]', ascii_uppercase),
('[LETTERS]', ascii_lowercase + ascii_uppercase),
('[NUMBERS]', digits)]:
chars = chars.replace(name, value)
maxi = len(chars) - 1
return ''.join([ chars[randint(0, maxi)] for i in xrange(length) ])
def get_substring(self, string, start, end=None):
"""Returns a substring from `start` index to `end` index.
The `start` index is inclusive and `end` is exclusive.
Indexing starts from 0, and it is possible to use
negative indices to refer to characters from the end.
Examples:
| ${ignore first} = | Get Substring | ${string} | 1 | |
| ${ignore last} = | Get Substring | ${string} | | -1 |
| ${5th to 10th} = | Get Substring | ${string} | 4 | 10 |
| ${first two} = | Get Substring | ${string} | | 1 |
| ${last two} = | Get Substring | ${string} | -2 | |
"""
start = self._convert_to_index(start, 'start')
end = self._convert_to_index(end, 'end')
return string[start:end]
def should_be_string(self, item, msg=None):
"""Fails if the given `item` is not a string.
The default error message can be overridden with the optional
`msg` argument.
"""
if not isinstance(item, basestring):
if not msg:
msg = "Given item '%s' is not a string" % item
raise AssertionError(msg)
def should_not_be_string(self, item, msg=None):
"""Fails if the given `item` is a string.
The default error message can be overridden with the optional
`msg` argument.
"""
if isinstance(item, basestring):
if not msg:
msg = "Given item '%s' is a string" % item
raise AssertionError(msg)
def should_be_lowercase(self, string, msg=None):
"""Fails if the given `string` is not in lowercase.
The default error message can be overridden with the optional
`msg` argument.
For example 'string' and 'with specials!' would pass, and 'String', ''
and ' ' would fail.
See also `Should Be Uppercase` and `Should Be Titlecase`.
All these keywords were added in Robot Framework 2.1.2.
"""
if not string.islower():
raise AssertionError(msg or "'%s' is not lowercase" % string)
def should_be_uppercase(self, string, msg=None):
"""Fails if the given `string` is not in uppercase.
The default error message can be overridden with the optional
`msg` argument.
For example 'STRING' and 'WITH SPECIALS!' would pass, and 'String', ''
and ' ' would fail.
See also `Should Be Titlecase` and `Should Be Lowercase`.
All these keywords were added in Robot Framework 2.1.2.
"""
if not string.isupper():
raise AssertionError(msg or "'%s' is not uppercase" % string)
def should_be_titlecase(self, string, msg=None):
"""Fails if given `string` is not title.
`string` is a titlecased string if there is at least one
character in it, uppercase characters only follow uncased
characters and lowercase characters only cased ones.
The default error message can be overridden with the optional
`msg` argument.
For example 'This Is Title' would pass, and 'Word In UPPER',
'Word In lower', '' and ' ' would fail.
See also `Should Be Uppercase` and `Should Be Lowercase`.
All theses keyword were added in Robot Framework 2.1.2.
"""
if not string.istitle():
raise AssertionError(msg or "'%s' is not titlecase" % string)
def _convert_to_index(self, value, name):
if value == '':
return 0
if value is None:
return None
return self._convert_to_integer(value, name)
def _convert_to_integer(self, value, name):
try:
return int(value)
except ValueError:
raise ValueError("Cannot convert '%s' argument '%s' to an integer"
% (name, value))
| ajibawa-2023/Python-Code-Large/train/row_99869 | 118 | 416 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99869:Import_L16_C0", "label": "re import re", "type": "import", "loc": [16, 16], "level": 0, "parent": null, "vector": [1, 0, 0.0385, 0.0024, 0, 0.66, 0.0, 540, 0, 1, 0, 0, 540, 0, 0], "semantic": {"name": "re", "arg_names": [], "import_names": ["re"], "rhs_call_name": "", "annotation": ""}, "snippet": "import re"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99869:ImportFrom_L17_C0", "label": "from fnmatch import fnmatchcase", "type": "import", "loc": [17, 17], "level": 0, "parent": null, "vector": [1, 0, 0.0409, 0.0024, 0, 0.66, 0.2, 626, 0, 1, 0, 0, 626, 0, 0], "semantic": {"name": "fnmatch", "arg_names": [], "import_names": ["fnmatchcase"], "rhs_call_name": "", "annotation": ""}, "snippet": "from fnmatch import fnmatchcase"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99869:ImportFrom_L18_C0", "label": "from random import randint", "type": "import", "loc": [18, 18], "level": 0, "parent": null, "vector": [1, 0, 0.0433, 0.0024, 0, 0.66, 0.4, 715, 0, 1, 0, 0, 715, 0, 0], "semantic": {"name": "random", "arg_names": [], "import_names": ["randint"], "rhs_call_name": "", "annotation": ""}, "snippet": "from random import randint"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99869:ImportFrom_L19_C0", "label": "from string import ascii_lowercase, ascii_uppercase, digits", "type": "import", "loc": [19, 19], "level": 0, "parent": null, "vector": [1, 0, 0.0457, 0.0024, 0, 0.66, 0.6, 890, 0, 3, 0, 0, 890, 0, 0], "semantic": {"name": "string", "arg_names": [], "import_names": ["ascii_lowercase", "ascii_uppercase", "digits"], "rhs_call_name": "", "annotation": ""}, "snippet": "from string import ascii_lowercase, ascii_uppercase, digits"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99869:ImportFrom_L21_C0", "label": "from robot.version import get_version", "type": "import", "loc": [21, 21], "level": 0, "parent": null, "vector": [1, 0, 0.0505, 0.0024, 0, 0.66, 0.8, 622, 0, 1, 0, 0, 622, 0, 0], "semantic": {"name": "robot.version", "arg_names": [], "import_names": ["get_version"], "rhs_call_name": "", "annotation": ""}, "snippet": "from robot.version import get_version"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99869:ClassDef_L24_C0", "label": "String", "type": "class", "loc": [24, 416], "level": 0, "parent": null, "vector": [3, 0, 0.5288, 0.9447, 0, 0.66, 1.0, 214, 0, 22, 0, 0, 0, 0, 57], "semantic": {"name": "String", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class String:\n\n \"\"\"A test library for string manipulation and verification.\n\n `String` is Robot Framework's standard library for manipulating\n strings (e.g. `Replace String Using Regexp`, `Split To Lines`) and\n verifying their contents (e.g. `Should Be String`).\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99869:Expr_L26_C4", "label": "expression", "type": "expression", "loc": [26, 43], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99869:ClassDef_L24_C0", "vector": [8, 1, 0.0829, 0.0433, 1, 0.26, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"A test library for string manipulation and verification.\n\n `String` is Robot Framework's standard library for manipulating\n strings (e.g. `Replace String Using Regexp`, `Split To Lines`) and\n verifying their contents (e.g. `Should Be String`).\n\n Following keywords from the BuiltIn library can also be used with\n strings:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99869:Assign_L45_C4", "label": "ROBOT_LIBRARY_SCOPE =", "type": "assigned_variable", "loc": [45, 45], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99869:ClassDef_L24_C0", "vector": [14, 1, 0.1082, 0.0024, 1, 0.26, 0.0417, 305, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "ROBOT_LIBRARY_SCOPE", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ROBOT_LIBRARY_SCOPE = 'GLOBAL'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99869:Assign_L46_C4", "label": "ROBOT_LIBRARY_VERSION = get_version()", "type": "assigned_variable", "loc": [46, 46], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99869:ClassDef_L24_C0", "vector": [14, 1, 0.1106, 0.0024, 1, 0.26, 0.0833, 466, 3, 0, 0, 0, 75, 10, 1], "semantic": {"name": "ROBOT_LIBRARY_VERSION", "arg_names": [], "import_names": [], "rhs_call_name": "get_version", "annotation": ""}, "snippet": " ROBOT_LIBRARY_VERSION = get_version()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L48_C4", "label": "get_line_count", "type": "function", "loc": [48, 52], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99869:ClassDef_L24_C0", "vector": [2, 1, 0.1202, 0.012, 1, 0.26, 0.125, 906, 0, 2, 1, 0, 0, 0, 3], "semantic": {"name": "get_line_count", "arg_names": ["self", "string"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_line_count(self, string):\n \"\"\"Returns and logs the number of lines in the given `string`.\"\"\"\n count = len(string.splitlines())\n print('*INFO* %d lines' % count)\n return count"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99869:Expr_L49_C8", "label": "expression", "type": "expression", "loc": [49, 49], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L48_C4", "vector": [8, 2, 0.1178, 0.0024, 2, 0.35, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Returns and logs the number of lines in the given `string`.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99869:Assign_L50_C8", "label": "count = len()", "type": "assigned_variable", "loc": [50, 50], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L48_C4", "vector": [14, 2, 0.1202, 0.0024, 2, 0.35, 0.3333, 778, 3, 1, 0, 0, 890, 10, 2], "semantic": {"name": "count", "arg_names": [], "import_names": [], "rhs_call_name": "len", "annotation": ""}, "snippet": " count = len(string.splitlines())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99869:Expr_L51_C8", "label": "print()", "type": "expression", "loc": [51, 51], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L48_C4", "vector": [8, 2, 0.1226, 0.0024, 2, 0.35, 0.6667, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('*INFO* %d lines' % count)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99869:Return_L52_C8", "label": "return", "type": "return", "loc": [52, 52], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L48_C4", "vector": [13, 2, 0.125, 0.0024, 2, 0.35, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return count"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L54_C4", "label": "split_to_lines", "type": "function", "loc": [54, 79], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99869:ClassDef_L24_C0", "vector": [2, 1, 0.1599, 0.0625, 1, 0.26, 0.1667, 533, 0, 4, 1, 0, 0, 0, 5], "semantic": {"name": "split_to_lines", "arg_names": ["self", "string", "start", "end"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def split_to_lines(self, string, start=0, end=None):\n \"\"\"Converts the `string` into a list of lines.\n\n It is possible to get only a selection of lines from `start`\n to `end` so that `start` index is inclusive and `end` is\n exclusive. Line numbering starts from 0, and it is possible to\n use negative indices to refer to lines from the end.\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99869:Expr_L55_C8", "label": "expression", "type": "expression", "loc": [55, 74], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L54_C4", "vector": [8, 2, 0.155, 0.0481, 2, 0.83, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Converts the `string` into a list of lines.\n\n It is possible to get only a selection of lines from `start`\n to `end` so that `start` index is inclusive and `end` is\n exclusive. Line numbering starts from 0, and it is possible to\n use negative indices to refer to lines from the end.\n\n Lines are returned without the newlines. The number of"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99869:Assign_L75_C8", "label": "start = _convert_to_index()", "type": "assigned_variable", "loc": [75, 75], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L54_C4", "vector": [14, 2, 0.1803, 0.0024, 2, 0.83, 0.2, 511, 3, 2, 0, 0, 95, 10, 1], "semantic": {"name": "start", "arg_names": [], "import_names": [], "rhs_call_name": "_convert_to_index", "annotation": ""}, "snippet": " start = self._convert_to_index(start, 'start')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99869:Assign_L76_C8", "label": "end = _convert_to_index()", "type": "assigned_variable", "loc": [76, 76], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L54_C4", "vector": [14, 2, 0.1827, 0.0024, 2, 0.83, 0.4, 128, 3, 2, 0, 0, 95, 10, 1], "semantic": {"name": "end", "arg_names": [], "import_names": [], "rhs_call_name": "_convert_to_index", "annotation": ""}, "snippet": " end = self._convert_to_index(end, 'end')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99869:Assign_L77_C8", "label": "lines =", "type": "assigned_variable", "loc": [77, 77], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L54_C4", "vector": [14, 2, 0.1851, 0.0024, 2, 0.83, 0.6, 73, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "lines", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " lines = string.splitlines()[start:end]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99869:Expr_L78_C8", "label": "print()", "type": "expression", "loc": [78, 78], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L54_C4", "vector": [8, 2, 0.1875, 0.0024, 2, 0.83, 0.8, 535, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('*INFO* %d lines returned' % len(lines))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99869:Return_L79_C8", "label": "return", "type": "return", "loc": [79, 79], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L54_C4", "vector": [13, 2, 0.1899, 0.0024, 2, 0.83, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return lines"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L81_C4", "label": "get_line", "type": "function", "loc": [81, 93], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99869:ClassDef_L24_C0", "vector": [2, 1, 0.2091, 0.0312, 1, 0.26, 0.2083, 72, 0, 3, 1, 0, 0, 0, 2], "semantic": {"name": "get_line", "arg_names": ["self", "string", "line_number"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_line(self, string, line_number):\n \"\"\"Returns the specified line from the given `string`.\n\n Line numbering starts from 0 and it is possible to use\n negative indices to refer to lines from the end. The line is\n returned without the newline character.\n\n Examples:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99869:Expr_L82_C8", "label": "expression", "type": "expression", "loc": [82, 91], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L81_C4", "vector": [8, 2, 0.2079, 0.024, 2, 0.99, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Returns the specified line from the given `string`.\n\n Line numbering starts from 0 and it is possible to use\n negative indices to refer to lines from the end. The line is\n returned without the newline character.\n\n Examples:\n | ${first} = | Get Line | ${string} | 0 |"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99869:Assign_L92_C8", "label": "line_number = _convert_to_integer()", "type": "assigned_variable", "loc": [92, 92], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L81_C4", "vector": [14, 2, 0.2212, 0.0024, 2, 0.99, 0.5, 490, 3, 2, 0, 0, 283, 10, 1], "semantic": {"name": "line_number", "arg_names": [], "import_names": [], "rhs_call_name": "_convert_to_integer", "annotation": ""}, "snippet": " line_number = self._convert_to_integer(line_number, 'line_number')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99869:Return_L93_C8", "label": "return", "type": "return", "loc": [93, 93], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L81_C4", "vector": [13, 2, 0.2236, 0.0024, 2, 0.99, 1.0, 0, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return string.splitlines()[line_number]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L95_C4", "label": "get_lines_containing_string", "type": "function", "loc": [95, 119], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99869:ClassDef_L24_C0", "vector": [2, 1, 0.2572, 0.0601, 1, 0.26, 0.25, 509, 0, 4, 1, 0, 0, 0, 3], "semantic": {"name": "get_lines_containing_string", "arg_names": ["self", "string", "pattern", "case_insensitive"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_lines_containing_string(self, string, pattern, case_insensitive=False):\n \"\"\"Returns lines of the given `string` that contain the `pattern`.\n\n The `pattern` is always considered to be a normal string and a\n line matches if the `pattern` is found anywhere in it. By\n default the match is case-sensitive, but setting\n `case_insensitive` to any value makes it case-insensitive.\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99869:Expr_L96_C8", "label": "expression", "type": "expression", "loc": [96, 113], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L95_C4", "vector": [8, 2, 0.2512, 0.0433, 2, 0.45, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Returns lines of the given `string` that contain the `pattern`.\n\n The `pattern` is always considered to be a normal string and a\n line matches if the `pattern` is found anywhere in it. By\n default the match is case-sensitive, but setting\n `case_insensitive` to any value makes it case-insensitive.\n\n Lines are returned as one string catenated back together with"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99869:If_L114_C8", "label": "if", "type": "if", "loc": [114, 118], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L95_C4", "vector": [4, 2, 0.2788, 0.012, 2, 0.45, 0.5, 0, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if case_insensitive:\n pattern = pattern.lower()\n contains = lambda line: pattern in line.lower()\n else:\n contains = lambda line: pattern in line"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99869:Assign_L115_C12", "label": "pattern = lower()", "type": "assigned_variable", "loc": [115, 115], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99869:If_L114_C8", "vector": [14, 3, 0.2764, 0.0024, 3, 0.8, 0.0, 561, 3, 0, 0, 0, 432, 10, 1], "semantic": {"name": "pattern", "arg_names": [], "import_names": [], "rhs_call_name": "lower", "annotation": ""}, "snippet": " pattern = pattern.lower()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99869:Assign_L116_C12", "label": "contains =", "type": "assigned_variable", "loc": [116, 116], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99869:If_L114_C8", "vector": [14, 3, 0.2788, 0.0024, 3, 0.8, 0.5, 848, 9, 0, 0, 0, 0, 0, 1], "semantic": {"name": "contains", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " contains = lambda line: pattern in line.lower()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99869:Assign_L118_C12", "label": "contains =", "type": "assigned_variable", "loc": [118, 118], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99869:If_L114_C8", "vector": [14, 3, 0.2837, 0.0024, 3, 0.8, 1.0, 848, 9, 0, 0, 0, 0, 0, 0], "semantic": {"name": "contains", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " contains = lambda line: pattern in line"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99869:Return_L119_C8", "label": "return", "type": "return", "loc": [119, 119], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L95_C4", "vector": [13, 2, 0.2861, 0.0024, 2, 0.45, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._get_matching_lines(string, contains)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L121_C4", "label": "get_lines_matching_pattern", "type": "function", "loc": [121, 151], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99869:ClassDef_L24_C0", "vector": [2, 1, 0.3269, 0.0745, 1, 0.26, 0.2917, 481, 0, 4, 1, 0, 0, 0, 5], "semantic": {"name": "get_lines_matching_pattern", "arg_names": ["self", "string", "pattern", "case_insensitive"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_lines_matching_pattern(self, string, pattern, case_insensitive=False):\n \"\"\"Returns lines of the given `string` that match the `pattern`.\n\n The `pattern` is a _glob pattern_ where:\n | * | matches everything |\n | ? | matches any single character |\n | [chars] | matches any character inside square brackets (e.g. '[abc]' matches either 'a', 'b' or 'c') |\n | [!chars] | matches any character not inside square brackets |"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99869:Expr_L122_C8", "label": "expression", "type": "expression", "loc": [122, 145], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L121_C4", "vector": [8, 2, 0.3209, 0.0577, 2, 0.32, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Returns lines of the given `string` that match the `pattern`.\n\n The `pattern` is a _glob pattern_ where:\n | * | matches everything |\n | ? | matches any single character |\n | [chars] | matches any character inside square brackets (e.g. '[abc]' matches either 'a', 'b' or 'c') |\n | [!chars] | matches any character not inside square brackets |\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99869:If_L146_C8", "label": "if", "type": "if", "loc": [146, 150], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L121_C4", "vector": [4, 2, 0.3558, 0.012, 2, 0.32, 0.5, 0, 2, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if case_insensitive:\n pattern = pattern.lower()\n matches = lambda line: fnmatchcase(line.lower(), pattern)\n else:\n matches = lambda line: fnmatchcase(line, pattern)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99869:Assign_L147_C12", "label": "pattern = lower()", "type": "assigned_variable", "loc": [147, 147], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99869:If_L146_C8", "vector": [14, 3, 0.3534, 0.0024, 3, 0.18, 0.0, 561, 3, 0, 0, 0, 432, 10, 1], "semantic": {"name": "pattern", "arg_names": [], "import_names": [], "rhs_call_name": "lower", "annotation": ""}, "snippet": " pattern = pattern.lower()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99869:Assign_L148_C12", "label": "matches =", "type": "assigned_variable", "loc": [148, 148], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99869:If_L146_C8", "vector": [14, 3, 0.3558, 0.0024, 3, 0.18, 0.5, 684, 9, 0, 0, 0, 0, 0, 2], "semantic": {"name": "matches", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " matches = lambda line: fnmatchcase(line.lower(), pattern)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99869:Assign_L150_C12", "label": "matches =", "type": "assigned_variable", "loc": [150, 150], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99869:If_L146_C8", "vector": [14, 3, 0.3606, 0.0024, 3, 0.18, 1.0, 684, 9, 0, 0, 0, 0, 0, 1], "semantic": {"name": "matches", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " matches = lambda line: fnmatchcase(line, pattern)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99869:Return_L151_C8", "label": "return", "type": "return", "loc": [151, 151], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L121_C4", "vector": [13, 2, 0.363, 0.0024, 2, 0.32, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._get_matching_lines(string, matches)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L153_C4", "label": "get_lines_matching_regexp", "type": "function", "loc": [153, 176], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99869:ClassDef_L24_C0", "vector": [2, 1, 0.3954, 0.0577, 1, 0.26, 0.3333, 166, 0, 3, 1, 0, 0, 0, 2], "semantic": {"name": "get_lines_matching_regexp", "arg_names": ["self", "string", "pattern"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_lines_matching_regexp(self, string, pattern):\n \"\"\"Returns lines of the given `string` that match the regexp `pattern`.\n\n See `BuiltIn.Should Match Regexp` for more information about\n Python regular expression syntax in general and how to use it\n in Robot Framework test data in particular. A line matches\n only if it matches the `pattern` fully. Notice that to make\n the match case-insensitive, you need to embed case-insensitive"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99869:Expr_L154_C8", "label": "expression", "type": "expression", "loc": [154, 174], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L153_C4", "vector": [8, 2, 0.3942, 0.0505, 2, 0.65, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Returns lines of the given `string` that match the regexp `pattern`.\n\n See `BuiltIn.Should Match Regexp` for more information about\n Python regular expression syntax in general and how to use it\n in Robot Framework test data in particular. A line matches\n only if it matches the `pattern` fully. Notice that to make\n the match case-insensitive, you need to embed case-insensitive\n flag into the pattern."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99869:Assign_L175_C8", "label": "regexp = compile()", "type": "assigned_variable", "loc": [175, 175], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L153_C4", "vector": [14, 2, 0.4207, 0.0024, 2, 0.65, 0.5, 982, 3, 1, 0, 0, 821, 10, 1], "semantic": {"name": "regexp", "arg_names": [], "import_names": [], "rhs_call_name": "compile", "annotation": ""}, "snippet": " regexp = re.compile('^%s$' % pattern)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99869:Return_L176_C8", "label": "return", "type": "return", "loc": [176, 176], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L153_C4", "vector": [13, 2, 0.4231, 0.0024, 2, 0.65, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._get_matching_lines(string, regexp.match)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L178_C4", "label": "_get_matching_lines", "type": "function", "loc": [178, 182], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99869:ClassDef_L24_C0", "vector": [2, 1, 0.4327, 0.012, 1, 0.26, 0.375, 348, 0, 3, 1, 0, 0, 0, 6], "semantic": {"name": "_get_matching_lines", "arg_names": ["self", "string", "matches"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _get_matching_lines(self, string, matches):\n lines = string.splitlines()\n matching = [ line for line in lines if matches(line) ]\n print('*INFO* %d out of %d lines matched' % (len(matching), len(lines)))\n return '\\n'.join(matching)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99869:Assign_L179_C8", "label": "lines = splitlines()", "type": "assigned_variable", "loc": [179, 179], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L178_C4", "vector": [14, 2, 0.4303, 0.0024, 2, 0.76, 0.0, 73, 3, 0, 0, 0, 296, 10, 1], "semantic": {"name": "lines", "arg_names": [], "import_names": [], "rhs_call_name": "splitlines", "annotation": ""}, "snippet": " lines = string.splitlines()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99869:Assign_L180_C8", "label": "matching =", "type": "assigned_variable", "loc": [180, 180], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L178_C4", "vector": [14, 2, 0.4327, 0.0024, 2, 0.76, 0.3333, 306, 5, 0, 0, 0, 0, 0, 1], "semantic": {"name": "matching", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " matching = [ line for line in lines if matches(line) ]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99869:Expr_L181_C8", "label": "print()", "type": "expression", "loc": [181, 181], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L178_C4", "vector": [8, 2, 0.4351, 0.0024, 2, 0.76, 0.6667, 535, 3, 1, 0, 0, 0, 0, 3], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('*INFO* %d out of %d lines matched' % (len(matching), len(lines)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99869:Return_L182_C8", "label": "return", "type": "return", "loc": [182, 182], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L178_C4", "vector": [13, 2, 0.4375, 0.0024, 2, 0.76, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return '\\n'.join(matching)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L184_C4", "label": "replace_string", "type": "function", "loc": [184, 203], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99869:ClassDef_L24_C0", "vector": [2, 1, 0.4651, 0.0481, 1, 0.26, 0.4167, 720, 0, 5, 1, 0, 0, 0, 2], "semantic": {"name": "replace_string", "arg_names": ["self", "string", "search_for", "replace_with", "count"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def replace_string(self, string, search_for, replace_with, count=-1):\n \"\"\"Replaces `search_for` in the given `string` with `replace_with`.\n\n `search_for` is used as a literal string. See `Replace String\n Using Regexp` if more powerful pattern matching is needed.\n\n If the optional argument `count` is given, only that many\n occurrences from left are replaced. Negative `count` means"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99869:Expr_L185_C8", "label": "expression", "type": "expression", "loc": [185, 201], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L184_C4", "vector": [8, 2, 0.4639, 0.0409, 2, 0.56, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Replaces `search_for` in the given `string` with `replace_with`.\n\n `search_for` is used as a literal string. See `Replace String\n Using Regexp` if more powerful pattern matching is needed.\n\n If the optional argument `count` is given, only that many\n occurrences from left are replaced. Negative `count` means\n that all occurrences are replaced (default behaviour) and zero"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99869:Assign_L202_C8", "label": "count = _convert_to_integer()", "type": "assigned_variable", "loc": [202, 202], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L184_C4", "vector": [14, 2, 0.4856, 0.0024, 2, 0.56, 0.5, 778, 3, 2, 0, 0, 283, 10, 1], "semantic": {"name": "count", "arg_names": [], "import_names": [], "rhs_call_name": "_convert_to_integer", "annotation": ""}, "snippet": " count = self._convert_to_integer(count, 'count')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99869:Return_L203_C8", "label": "return", "type": "return", "loc": [203, 203], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L184_C4", "vector": [13, 2, 0.488, 0.0024, 2, 0.56, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return string.replace(search_for, replace_with, count)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L205_C4", "label": "replace_string_using_regexp", "type": "function", "loc": [205, 224], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99869:ClassDef_L24_C0", "vector": [2, 1, 0.5156, 0.0481, 1, 0.26, 0.4583, 749, 0, 5, 1, 0, 0, 0, 2], "semantic": {"name": "replace_string_using_regexp", "arg_names": ["self", "string", "pattern", "replace_with", "count"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def replace_string_using_regexp(self, string, pattern, replace_with, count=-1):\n \"\"\"Replaces `pattern` in the given `string` with `replace_with`.\n\n This keyword is otherwise identical to `Replace String`, but\n the `pattern` to search for is considered to be a regular\n expression. See `BuiltIn.Should Match Regexp` for more\n information about Python regular expression syntax in general\n and how to use it in Robot Framework test data in particular."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99869:Expr_L206_C8", "label": "expression", "type": "expression", "loc": [206, 217], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L205_C4", "vector": [8, 2, 0.5084, 0.0288, 2, 0.99, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Replaces `pattern` in the given `string` with `replace_with`.\n\n This keyword is otherwise identical to `Replace String`, but\n the `pattern` to search for is considered to be a regular\n expression. See `BuiltIn.Should Match Regexp` for more\n information about Python regular expression syntax in general\n and how to use it in Robot Framework test data in particular.\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99869:Assign_L218_C8", "label": "count = _convert_to_integer()", "type": "assigned_variable", "loc": [218, 218], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L205_C4", "vector": [14, 2, 0.524, 0.0024, 2, 0.99, 0.3333, 778, 3, 2, 0, 0, 283, 10, 1], "semantic": {"name": "count", "arg_names": [], "import_names": [], "rhs_call_name": "_convert_to_integer", "annotation": ""}, "snippet": " count = self._convert_to_integer(count, 'count')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99869:If_L220_C8", "label": "if", "type": "if", "loc": [220, 223], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L205_C4", "vector": [4, 2, 0.5325, 0.0096, 2, 0.99, 0.6667, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if count < 0:\n count = 0\n elif count == 0:\n count = -1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99869:Assign_L221_C12", "label": "count =", "type": "assigned_variable", "loc": [221, 221], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99869:If_L220_C8", "vector": [14, 3, 0.5312, 0.0024, 3, 0.59, 0.0, 778, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "count", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " count = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99869:If_L222_C8", "label": "if", "type": "if", "loc": [222, 223], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99869:If_L220_C8", "vector": [4, 3, 0.5349, 0.0048, 3, 0.59, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif count == 0:\n count = -1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99869:Assign_L223_C12", "label": "count =", "type": "assigned_variable", "loc": [223, 223], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99869:If_L222_C8", "vector": [14, 4, 0.5361, 0.0024, 4, 0.58, 0.0, 778, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "count", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " count = -1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99869:Return_L224_C8", "label": "return", "type": "return", "loc": [224, 224], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L205_C4", "vector": [13, 2, 0.5385, 0.0024, 2, 0.99, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return re.sub(pattern, replace_with, string, count)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L226_C4", "label": "split_string", "type": "function", "loc": [226, 249], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99869:ClassDef_L24_C0", "vector": [2, 1, 0.5709, 0.0577, 1, 0.26, 0.5, 228, 0, 4, 1, 0, 0, 0, 2], "semantic": {"name": "split_string", "arg_names": ["self", "string", "separator", "max_split"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def split_string(self, string, separator=None, max_split=-1):\n \"\"\"Splits the `string` using `separator` as a delimiter string.\n\n If a `separator` is not given, any whitespace string is a\n separator. In that case also possible consecutive whitespace\n as well as leading and trailing whitespace is ignored.\n\n Split words are returned as a list. If the optional"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99869:Expr_L227_C8", "label": "expression", "type": "expression", "loc": [227, 245], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L226_C4", "vector": [8, 2, 0.5673, 0.0457, 2, 0.14, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Splits the `string` using `separator` as a delimiter string.\n\n If a `separator` is not given, any whitespace string is a\n separator. In that case also possible consecutive whitespace\n as well as leading and trailing whitespace is ignored.\n\n Split words are returned as a list. If the optional\n `max_split` is given, at most `max_split` splits are done, and"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99869:If_L246_C8", "label": "if", "type": "if", "loc": [246, 247], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L226_C4", "vector": [4, 2, 0.5925, 0.0048, 2, 0.14, 0.3333, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if separator == '':\n separator = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99869:Assign_L247_C12", "label": "separator =", "type": "assigned_variable", "loc": [247, 247], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99869:If_L246_C8", "vector": [14, 3, 0.5938, 0.0024, 3, 0.85, 0.0, 539, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "separator", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " separator = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99869:Assign_L248_C8", "label": "max_split = _convert_to_integer()", "type": "assigned_variable", "loc": [248, 248], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L226_C4", "vector": [14, 2, 0.5962, 0.0024, 2, 0.14, 0.6667, 327, 3, 2, 0, 0, 283, 10, 1], "semantic": {"name": "max_split", "arg_names": [], "import_names": [], "rhs_call_name": "_convert_to_integer", "annotation": ""}, "snippet": " max_split = self._convert_to_integer(max_split, 'max_split')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99869:Return_L249_C8", "label": "return", "type": "return", "loc": [249, 249], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L226_C4", "vector": [13, 2, 0.5986, 0.0024, 2, 0.14, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return string.split(separator, max_split)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L251_C4", "label": "split_string_from_right", "type": "function", "loc": [251, 263], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99869:ClassDef_L24_C0", "vector": [2, 1, 0.6178, 0.0312, 1, 0.26, 0.5417, 646, 0, 4, 1, 0, 0, 0, 1], "semantic": {"name": "split_string_from_right", "arg_names": ["self", "string", "separator", "max_split"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def split_string_from_right(self, string, separator=None, max_split=-1):\n \"\"\"Splits the `string` using `separator` starting from right.\n\n Same as `Split String`, but splitting is started from right. This has\n an effect only when `max_split` is given.\n\n Examples:\n | ${first} | ${others} = | Split String | ${string} | - | 1 |"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99869:Expr_L252_C8", "label": "expression", "type": "expression", "loc": [252, 260], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L251_C4", "vector": [8, 2, 0.6154, 0.0216, 2, 0.26, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Splits the `string` using `separator` starting from right.\n\n Same as `Split String`, but splitting is started from right. This has\n an effect only when `max_split` is given.\n\n Examples:\n | ${first} | ${others} = | Split String | ${string} | - | 1 |\n | ${others} | ${last} = | Split String From Right | ${string} | - | 1 |"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99869:Assign_L262_C8", "label": "reversed = split_string()", "type": "assigned_variable", "loc": [262, 262], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L251_C4", "vector": [14, 2, 0.6298, 0.0024, 2, 0.26, 0.5, 339, 3, 3, 0, 0, 228, 10, 1], "semantic": {"name": "reversed", "arg_names": [], "import_names": [], "rhs_call_name": "split_string", "annotation": ""}, "snippet": " reversed = self.split_string(string[::-1], separator, max_split)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99869:Return_L263_C8", "label": "return", "type": "return", "loc": [263, 263], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L251_C4", "vector": [13, 2, 0.6322, 0.0024, 2, 0.26, 1.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return [ r[::-1] for r in reversed ][::-1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L265_C4", "label": "fetch_from_left", "type": "function", "loc": [265, 273], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99869:ClassDef_L24_C0", "vector": [2, 1, 0.6466, 0.0216, 1, 0.26, 0.5833, 802, 0, 3, 1, 0, 0, 0, 1], "semantic": {"name": "fetch_from_left", "arg_names": ["self", "string", "marker"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def fetch_from_left(self, string, marker):\n \"\"\"Returns contents of the `string` before the first occurrence of `marker`.\n\n If the `marker` is not found, whole string is returned.\n\n See also `Fetch From Right`, `Split String` and `Split String\n From Right`.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99869:Expr_L266_C8", "label": "expression", "type": "expression", "loc": [266, 272], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L265_C4", "vector": [8, 2, 0.6466, 0.0168, 2, 0.46, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Returns contents of the `string` before the first occurrence of `marker`.\n\n If the `marker` is not found, whole string is returned.\n\n See also `Fetch From Right`, `Split String` and `Split String\n From Right`.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99869:Return_L273_C8", "label": "return", "type": "return", "loc": [273, 273], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L265_C4", "vector": [13, 2, 0.6562, 0.0024, 2, 0.46, 1.0, 0, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return string.split(marker)[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L275_C4", "label": "fetch_from_right", "type": "function", "loc": [275, 283], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99869:ClassDef_L24_C0", "vector": [2, 1, 0.6707, 0.0216, 1, 0.26, 0.625, 383, 0, 3, 1, 0, 0, 0, 1], "semantic": {"name": "fetch_from_right", "arg_names": ["self", "string", "marker"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def fetch_from_right(self, string, marker):\n \"\"\"Returns contents of the `string` after the last occurrence of `marker`.\n\n If the `marker` is not found, whole string is returned.\n\n See also `Fetch From Left`, `Split String` and `Split String\n From Right`.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99869:Expr_L276_C8", "label": "expression", "type": "expression", "loc": [276, 282], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L275_C4", "vector": [8, 2, 0.6707, 0.0168, 2, 0.13, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Returns contents of the `string` after the last occurrence of `marker`.\n\n If the `marker` is not found, whole string is returned.\n\n See also `Fetch From Left`, `Split String` and `Split String\n From Right`.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99869:Return_L283_C8", "label": "return", "type": "return", "loc": [283, 283], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L275_C4", "vector": [13, 2, 0.6803, 0.0024, 2, 0.13, 1.0, 0, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return string.split(marker)[-1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L285_C4", "label": "generate_random_string", "type": "function", "loc": [285, 313], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99869:ClassDef_L24_C0", "vector": [2, 1, 0.7188, 0.0697, 1, 0.26, 0.6667, 322, 0, 3, 1, 0, 0, 0, 6], "semantic": {"name": "generate_random_string", "arg_names": ["self", "length", "chars"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def generate_random_string(self, length=8, chars='[LETTERS][NUMBERS]'):\n \"\"\"Generates a string with a desired `length` from the given `chars`.\n\n The population sequence `chars` contains the characters to use\n when generating the random string. It can contain any\n characters, and it is possible to use special markers\n explained in the table below:\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99869:Expr_L286_C8", "label": "expression", "type": "expression", "loc": [286, 303], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L285_C4", "vector": [8, 2, 0.7079, 0.0433, 2, 0.52, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Generates a string with a desired `length` from the given `chars`.\n\n The population sequence `chars` contains the characters to use\n when generating the random string. It can contain any\n characters, and it is possible to use special markers\n explained in the table below:\n\n | _[LOWER]_ | Lowercase ASCII characters from 'a' to 'z'. |"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99869:If_L304_C8", "label": "if", "type": "if", "loc": [304, 305], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L285_C4", "vector": [4, 2, 0.732, 0.0048, 2, 0.52, 0.2, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if length == '':\n length = 8"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99869:Assign_L305_C12", "label": "length =", "type": "assigned_variable", "loc": [305, 305], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99869:If_L304_C8", "vector": [14, 3, 0.7332, 0.0024, 3, 0.53, 0.0, 221, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "length", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " length = 8"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99869:Assign_L306_C8", "label": "length = _convert_to_integer()", "type": "assigned_variable", "loc": [306, 306], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L285_C4", "vector": [14, 2, 0.7356, 0.0024, 2, 0.52, 0.4, 221, 3, 2, 0, 0, 283, 10, 1], "semantic": {"name": "length", "arg_names": [], "import_names": [], "rhs_call_name": "_convert_to_integer", "annotation": ""}, "snippet": " length = self._convert_to_integer(length, 'length')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99869:For_L307_C8", "label": "for name, value", "type": "for", "loc": [307, 311], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L285_C4", "vector": [6, 2, 0.7428, 0.012, 2, 0.52, 0.6, 509, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "name, value", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for name, value in [('[LOWER]', ascii_lowercase),\n ('[UPPER]', ascii_uppercase),\n ('[LETTERS]', ascii_lowercase + ascii_uppercase),\n ('[NUMBERS]', digits)]:\n chars = chars.replace(name, value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99869:Assign_L311_C12", "label": "chars = replace()", "type": "assigned_variable", "loc": [311, 311], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99869:For_L307_C8", "vector": [14, 3, 0.7476, 0.0024, 3, 0.39, 0.0, 363, 3, 2, 0, 0, 293, 10, 1], "semantic": {"name": "chars", "arg_names": [], "import_names": [], "rhs_call_name": "replace", "annotation": ""}, "snippet": " chars = chars.replace(name, value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99869:Assign_L312_C8", "label": "maxi =", "type": "assigned_variable", "loc": [312, 312], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L285_C4", "vector": [14, 2, 0.75, 0.0024, 2, 0.52, 0.8, 437, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "maxi", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " maxi = len(chars) - 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99869:Return_L313_C8", "label": "return", "type": "return", "loc": [313, 313], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L285_C4", "vector": [13, 2, 0.7524, 0.0024, 2, 0.52, 1.0, 0, 3, 0, 0, 0, 0, 10, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ''.join([ chars[randint(0, maxi)] for i in xrange(length) ])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L315_C4", "label": "get_substring", "type": "function", "loc": [315, 331], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99869:ClassDef_L24_C0", "vector": [2, 1, 0.7764, 0.0409, 1, 0.26, 0.7083, 974, 0, 4, 1, 0, 0, 0, 2], "semantic": {"name": "get_substring", "arg_names": ["self", "string", "start", "end"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_substring(self, string, start, end=None):\n \"\"\"Returns a substring from `start` index to `end` index.\n\n The `start` index is inclusive and `end` is exclusive.\n Indexing starts from 0, and it is possible to use\n negative indices to refer to characters from the end.\n\n Examples:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99869:Expr_L316_C8", "label": "expression", "type": "expression", "loc": [316, 328], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L315_C4", "vector": [8, 2, 0.774, 0.0312, 2, 0.56, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Returns a substring from `start` index to `end` index.\n\n The `start` index is inclusive and `end` is exclusive.\n Indexing starts from 0, and it is possible to use\n negative indices to refer to characters from the end.\n\n Examples:\n | ${ignore first} = | Get Substring | ${string} | 1 | |"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99869:Assign_L329_C8", "label": "start = _convert_to_index()", "type": "assigned_variable", "loc": [329, 329], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L315_C4", "vector": [14, 2, 0.7909, 0.0024, 2, 0.56, 0.3333, 511, 3, 2, 0, 0, 95, 10, 1], "semantic": {"name": "start", "arg_names": [], "import_names": [], "rhs_call_name": "_convert_to_index", "annotation": ""}, "snippet": " start = self._convert_to_index(start, 'start')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99869:Assign_L330_C8", "label": "end = _convert_to_index()", "type": "assigned_variable", "loc": [330, 330], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L315_C4", "vector": [14, 2, 0.7933, 0.0024, 2, 0.56, 0.6667, 128, 3, 2, 0, 0, 95, 10, 1], "semantic": {"name": "end", "arg_names": [], "import_names": [], "rhs_call_name": "_convert_to_index", "annotation": ""}, "snippet": " end = self._convert_to_index(end, 'end')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99869:Return_L331_C8", "label": "return", "type": "return", "loc": [331, 331], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L315_C4", "vector": [13, 2, 0.7957, 0.0024, 2, 0.56, 1.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return string[start:end]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L333_C4", "label": "should_be_string", "type": "function", "loc": [333, 342], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99869:ClassDef_L24_C0", "vector": [2, 1, 0.8113, 0.024, 1, 0.26, 0.75, 828, 0, 3, 0, 0, 0, 0, 2], "semantic": {"name": "should_be_string", "arg_names": ["self", "item", "msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def should_be_string(self, item, msg=None):\n \"\"\"Fails if the given `item` is not a string.\n\n The default error message can be overridden with the optional\n `msg` argument.\n \"\"\"\n if not isinstance(item, basestring):\n if not msg:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99869:Expr_L334_C8", "label": "expression", "type": "expression", "loc": [334, 338], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L333_C4", "vector": [8, 2, 0.8077, 0.012, 2, 0.84, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Fails if the given `item` is not a string.\n\n The default error message can be overridden with the optional\n `msg` argument.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99869:If_L339_C8", "label": "if", "type": "if", "loc": [339, 342], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L333_C4", "vector": [4, 2, 0.8185, 0.0096, 2, 0.84, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not isinstance(item, basestring):\n if not msg:\n msg = \"Given item '%s' is not a string\" % item\n raise AssertionError(msg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99869:If_L340_C12", "label": "if", "type": "if", "loc": [340, 341], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99869:If_L339_C8", "vector": [4, 3, 0.8185, 0.0048, 3, 0.72, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not msg:\n msg = \"Given item '%s' is not a string\" % item"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99869:Assign_L341_C16", "label": "msg =", "type": "assigned_variable", "loc": [341, 341], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99869:If_L340_C12", "vector": [14, 4, 0.8197, 0.0024, 4, 0.88, 0.0, 712, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "msg", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " msg = \"Given item '%s' is not a string\" % item"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L344_C4", "label": "should_not_be_string", "type": "function", "loc": [344, 353], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99869:ClassDef_L24_C0", "vector": [2, 1, 0.8377, 0.024, 1, 0.26, 0.7917, 595, 0, 3, 0, 0, 0, 0, 2], "semantic": {"name": "should_not_be_string", "arg_names": ["self", "item", "msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def should_not_be_string(self, item, msg=None):\n \"\"\"Fails if the given `item` is a string.\n\n The default error message can be overridden with the optional\n `msg` argument.\n \"\"\"\n if isinstance(item, basestring):\n if not msg:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99869:Expr_L345_C8", "label": "expression", "type": "expression", "loc": [345, 349], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L344_C4", "vector": [8, 2, 0.8341, 0.012, 2, 0.13, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Fails if the given `item` is a string.\n\n The default error message can be overridden with the optional\n `msg` argument.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99869:If_L350_C8", "label": "if", "type": "if", "loc": [350, 353], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L344_C4", "vector": [4, 2, 0.845, 0.0096, 2, 0.13, 1.0, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if isinstance(item, basestring):\n if not msg:\n msg = \"Given item '%s' is a string\" % item\n raise AssertionError(msg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99869:If_L351_C12", "label": "if", "type": "if", "loc": [351, 352], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99869:If_L350_C8", "vector": [4, 3, 0.845, 0.0048, 3, 0.23, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not msg:\n msg = \"Given item '%s' is a string\" % item"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99869:Assign_L352_C16", "label": "msg =", "type": "assigned_variable", "loc": [352, 352], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99869:If_L351_C12", "vector": [14, 4, 0.8462, 0.0024, 4, 0.9, 0.0, 712, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "msg", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " msg = \"Given item '%s' is a string\" % item"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L355_C4", "label": "should_be_lowercase", "type": "function", "loc": [355, 368], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99869:ClassDef_L24_C0", "vector": [2, 1, 0.869, 0.0337, 1, 0.26, 0.8333, 613, 0, 3, 0, 0, 0, 0, 2], "semantic": {"name": "should_be_lowercase", "arg_names": ["self", "string", "msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def should_be_lowercase(self, string, msg=None):\n \"\"\"Fails if the given `string` is not in lowercase.\n\n The default error message can be overridden with the optional\n `msg` argument.\n\n For example 'string' and 'with specials!' would pass, and 'String', ''\n and ' ' would fail."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99869:Expr_L356_C8", "label": "expression", "type": "expression", "loc": [356, 366], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L355_C4", "vector": [8, 2, 0.8678, 0.0264, 2, 0.05, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Fails if the given `string` is not in lowercase.\n\n The default error message can be overridden with the optional\n `msg` argument.\n\n For example 'string' and 'with specials!' would pass, and 'String', ''\n and ' ' would fail.\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99869:If_L367_C8", "label": "if", "type": "if", "loc": [367, 368], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L355_C4", "vector": [4, 2, 0.8834, 0.0048, 2, 0.05, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not string.islower():\n raise AssertionError(msg or \"'%s' is not lowercase\" % string)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L370_C4", "label": "should_be_uppercase", "type": "function", "loc": [370, 383], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99869:ClassDef_L24_C0", "vector": [2, 1, 0.905, 0.0337, 1, 0.26, 0.875, 37, 0, 3, 0, 0, 0, 0, 2], "semantic": {"name": "should_be_uppercase", "arg_names": ["self", "string", "msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def should_be_uppercase(self, string, msg=None):\n \"\"\"Fails if the given `string` is not in uppercase.\n\n The default error message can be overridden with the optional\n `msg` argument.\n\n For example 'STRING' and 'WITH SPECIALS!' would pass, and 'String', ''\n and ' ' would fail."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99869:Expr_L371_C8", "label": "expression", "type": "expression", "loc": [371, 381], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L370_C4", "vector": [8, 2, 0.9038, 0.0264, 2, 0.5, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Fails if the given `string` is not in uppercase.\n\n The default error message can be overridden with the optional\n `msg` argument.\n\n For example 'STRING' and 'WITH SPECIALS!' would pass, and 'String', ''\n and ' ' would fail.\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99869:If_L382_C8", "label": "if", "type": "if", "loc": [382, 383], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L370_C4", "vector": [4, 2, 0.9195, 0.0048, 2, 0.5, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not string.isupper():\n raise AssertionError(msg or \"'%s' is not uppercase\" % string)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L385_C4", "label": "should_be_titlecase", "type": "function", "loc": [385, 402], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99869:ClassDef_L24_C0", "vector": [2, 1, 0.9459, 0.0433, 1, 0.26, 0.9167, 636, 0, 3, 0, 0, 0, 0, 2], "semantic": {"name": "should_be_titlecase", "arg_names": ["self", "string", "msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def should_be_titlecase(self, string, msg=None):\n \"\"\"Fails if given `string` is not title.\n\n `string` is a titlecased string if there is at least one\n character in it, uppercase characters only follow uncased\n characters and lowercase characters only cased ones.\n\n The default error message can be overridden with the optional"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99869:Expr_L386_C8", "label": "expression", "type": "expression", "loc": [386, 400], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L385_C4", "vector": [8, 2, 0.9447, 0.0361, 2, 0.17, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Fails if given `string` is not title.\n\n `string` is a titlecased string if there is at least one\n character in it, uppercase characters only follow uncased\n characters and lowercase characters only cased ones.\n\n The default error message can be overridden with the optional\n `msg` argument."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99869:If_L401_C8", "label": "if", "type": "if", "loc": [401, 402], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L385_C4", "vector": [4, 2, 0.9651, 0.0048, 2, 0.17, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not string.istitle():\n raise AssertionError(msg or \"'%s' is not titlecase\" % string)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L404_C4", "label": "_convert_to_index", "type": "function", "loc": [404, 409], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99869:ClassDef_L24_C0", "vector": [2, 1, 0.9772, 0.0144, 1, 0.26, 0.9583, 95, 0, 3, 1, 0, 0, 0, 1], "semantic": {"name": "_convert_to_index", "arg_names": ["self", "value", "name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _convert_to_index(self, value, name):\n if value == '':\n return 0\n if value is None:\n return None\n return self._convert_to_integer(value, name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99869:If_L405_C8", "label": "if", "type": "if", "loc": [405, 406], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L404_C4", "vector": [4, 2, 0.9748, 0.0048, 2, 0.53, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if value == '':\n return 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99869:Return_L406_C12", "label": "return", "type": "return", "loc": [406, 406], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99869:If_L405_C8", "vector": [13, 3, 0.976, 0.0024, 3, 0.65, 0.0, 0, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99869:If_L407_C8", "label": "if", "type": "if", "loc": [407, 408], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L404_C4", "vector": [4, 2, 0.9796, 0.0048, 2, 0.53, 0.5, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if value is None:\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99869:Return_L408_C12", "label": "return", "type": "return", "loc": [408, 408], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99869:If_L407_C8", "vector": [13, 3, 0.9808, 0.0024, 3, 0.39, 0.0, 0, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99869:Return_L409_C8", "label": "return", "type": "return", "loc": [409, 409], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L404_C4", "vector": [13, 2, 0.9832, 0.0024, 2, 0.53, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._convert_to_integer(value, name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L411_C4", "label": "_convert_to_integer", "type": "function", "loc": [411, 416], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99869:ClassDef_L24_C0", "vector": [2, 1, 0.994, 0.0144, 1, 0.26, 1.0, 283, 0, 3, 1, 0, 0, 0, 2], "semantic": {"name": "_convert_to_integer", "arg_names": ["self", "value", "name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _convert_to_integer(self, value, name):\n try:\n return int(value)\n except ValueError:\n raise ValueError(\"Cannot convert '%s' argument '%s' to an integer\"\n % (name, value))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99869:Try_L412_C8", "label": "try", "type": "try", "loc": [412, 416], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L411_C4", "vector": [7, 2, 0.9952, 0.012, 2, 0.18, 0.0, 0, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n return int(value)\n except ValueError:\n raise ValueError(\"Cannot convert '%s' argument '%s' to an integer\"\n % (name, value))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99869:Return_L413_C12", "label": "return", "type": "return", "loc": [413, 413], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99869:Try_L412_C8", "vector": [13, 3, 0.9928, 0.0024, 3, 0.58, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return int(value)"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99869:ClassDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99869:Expr_L26_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99869:ClassDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99869:Assign_L45_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99869:ClassDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99869:Assign_L46_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99869:ClassDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L48_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L48_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99869:Expr_L49_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L48_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99869:Assign_L50_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L48_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99869:Expr_L51_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L48_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99869:Return_L52_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99869:ClassDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L54_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99869:Expr_L55_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99869:Assign_L75_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99869:Assign_L76_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99869:Assign_L77_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99869:Expr_L78_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99869:Return_L79_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99869:ClassDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L81_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L81_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99869:Expr_L82_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L81_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99869:Assign_L92_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L81_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99869:Return_L93_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99869:ClassDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L95_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L95_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99869:Expr_L96_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L95_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99869:If_L114_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99869:If_L114_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99869:Assign_L115_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99869:If_L114_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99869:Assign_L116_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99869:If_L114_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99869:Assign_L118_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L95_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99869:Return_L119_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99869:ClassDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L121_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L121_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99869:Expr_L122_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L121_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99869:If_L146_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99869:If_L146_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99869:Assign_L147_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99869:If_L146_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99869:Assign_L148_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99869:If_L146_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99869:Assign_L150_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L121_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99869:Return_L151_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99869:ClassDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L153_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L153_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99869:Expr_L154_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L153_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99869:Assign_L175_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L153_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99869:Return_L176_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99869:ClassDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L178_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L178_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99869:Assign_L179_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L178_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99869:Assign_L180_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L178_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99869:Expr_L181_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L178_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99869:Return_L182_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99869:ClassDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L184_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L184_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99869:Expr_L185_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L184_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99869:Assign_L202_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L184_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99869:Return_L203_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99869:ClassDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L205_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L205_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99869:Expr_L206_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L205_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99869:Assign_L218_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L205_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99869:If_L220_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99869:If_L220_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99869:Assign_L221_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99869:If_L220_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99869:If_L222_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99869:If_L222_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99869:Assign_L223_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L205_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99869:Return_L224_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99869:ClassDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L226_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L226_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99869:Expr_L227_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L226_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99869:If_L246_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99869:If_L246_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99869:Assign_L247_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L226_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99869:Assign_L248_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L226_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99869:Return_L249_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99869:ClassDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L251_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L251_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99869:Expr_L252_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L251_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99869:Assign_L262_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L251_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99869:Return_L263_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99869:ClassDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L265_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L265_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99869:Expr_L266_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L265_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99869:Return_L273_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99869:ClassDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L275_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L275_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99869:Expr_L276_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L275_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99869:Return_L283_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99869:ClassDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L285_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L285_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99869:Expr_L286_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L285_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99869:If_L304_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99869:If_L304_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99869:Assign_L305_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L285_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99869:Assign_L306_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L285_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99869:For_L307_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99869:For_L307_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99869:Assign_L311_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L285_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99869:Assign_L312_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L285_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99869:Return_L313_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99869:ClassDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L315_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L315_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99869:Expr_L316_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L315_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99869:Assign_L329_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L315_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99869:Assign_L330_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L315_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99869:Return_L331_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99869:ClassDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L333_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L333_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99869:Expr_L334_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L333_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99869:If_L339_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99869:If_L339_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99869:If_L340_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99869:If_L340_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99869:Assign_L341_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99869:ClassDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L344_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L344_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99869:Expr_L345_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L344_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99869:If_L350_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99869:If_L350_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99869:If_L351_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99869:If_L351_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99869:Assign_L352_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99869:ClassDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L355_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L355_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99869:Expr_L356_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L355_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99869:If_L367_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99869:ClassDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L370_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L370_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99869:Expr_L371_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L370_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99869:If_L382_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99869:ClassDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L385_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L385_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99869:Expr_L386_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L385_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99869:If_L401_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99869:ClassDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L404_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L404_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99869:If_L405_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99869:If_L405_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99869:Return_L406_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L404_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99869:If_L407_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99869:If_L407_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99869:Return_L408_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L404_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99869:Return_L409_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99869:ClassDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L411_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99869:FunctionDef_L411_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99869:Try_L412_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99869:Try_L412_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99869:Return_L413_C12"}] |
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
| ajibawa-2023/Python-Code-Large/train/row_99870 | 0 | 14 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [] | [] |
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
class Populator(object):
"""Explicit interface for all populators."""
def add(self, row): raise NotImplementedError()
def populate(self): raise NotImplementedError()
class CommentCacher(object):
def __init__(self):
self._init_comments()
def _init_comments(self):
self._comments = []
def add(self, comment):
self._comments.append(comment)
def consume_comments_with(self, function):
for c in self._comments:
function(c)
self._init_comments()
class _TablePopulator(Populator):
def __init__(self, table):
self._table = table
self._populator = NullPopulator()
self._comments = CommentCacher()
def add(self, row):
if self._is_cacheable_comment_row(row):
self._comments.add(row)
else:
self._add(row)
def _add(self, row):
if not self._is_continuing(row):
self._populator.populate()
self._populator = self._get_populator(row)
self._comments.consume_comments_with(self._populator.add)
self._populator.add(row)
def populate(self):
self._comments.consume_comments_with(self._populator.add)
self._populator.populate()
def _is_continuing(self, row):
return row.is_continuing() and self._populator
def _is_cacheable_comment_row(self, row):
return row.is_commented()
class SettingTablePopulator(_TablePopulator):
def _get_populator(self, row):
row.handle_old_style_metadata()
setter = self._table.get_setter(row.head)
return SettingPopulator(setter) if setter else NullPopulator()
class VariableTablePopulator(_TablePopulator):
def _get_populator(self, row):
return VariablePopulator(self._table.add, row.head)
class _StepContainingTablePopulator(_TablePopulator):
def _is_continuing(self, row):
return row.is_indented() and self._populator or row.is_commented()
def _is_cacheable_comment_row(self, row):
return row.is_commented() and isinstance(self._populator, NullPopulator)
class TestTablePopulator(_StepContainingTablePopulator):
def _get_populator(self, row):
return TestCasePopulator(self._table.add)
class KeywordTablePopulator(_StepContainingTablePopulator):
def _get_populator(self, row):
return UserKeywordPopulator(self._table.add)
class ForLoopPopulator(Populator):
def __init__(self, for_loop_creator):
self._for_loop_creator = for_loop_creator
self._loop = None
self._populator = NullPopulator()
self._declaration = []
def add(self, row):
dedented_row = row.dedent()
if not self._loop:
declaration_ready = self._populate_declaration(row)
if not declaration_ready:
return
self._loop = self._for_loop_creator(self._declaration)
if not row.is_continuing():
self._populator.populate()
self._populator = StepPopulator(self._loop.add_step)
self._populator.add(dedented_row)
def _populate_declaration(self, row):
if row.starts_for_loop() or row.is_continuing():
self._declaration.extend(row.dedent().data)
return False
return True
def populate(self):
if not self._loop:
self._for_loop_creator(self._declaration)
self._populator.populate()
class _TestCaseUserKeywordPopulator(Populator):
def __init__(self, test_or_uk_creator):
self._test_or_uk_creator = test_or_uk_creator
self._test_or_uk = None
self._populator = NullPopulator()
self._comments = CommentCacher()
def add(self, row):
if row.is_commented():
self._comments.add(row)
return
if not self._test_or_uk:
self._test_or_uk = self._test_or_uk_creator(row.head)
dedented_row = row.dedent()
if dedented_row:
self._handle_data_row(dedented_row)
def _handle_data_row(self, row):
if not self._continues(row):
self._populator.populate()
self._populator = self._get_populator(row)
self._flush_comments_with(self._populate_comment_row)
else:
self._flush_comments_with(self._populator.add)
self._populator.add(row)
def _populate_comment_row(self, crow):
populator = StepPopulator(self._test_or_uk.add_step)
populator.add(crow)
populator.populate()
def _flush_comments_with(self, function):
self._comments.consume_comments_with(function)
def populate(self):
self._populator.populate()
self._flush_comments_with(self._populate_comment_row)
def _get_populator(self, row):
if row.starts_test_or_user_keyword_setting():
setter = self._setting_setter(row)
return SettingPopulator(setter) if setter else NullPopulator()
if row.starts_for_loop():
return ForLoopPopulator(self._test_or_uk.add_for_loop)
return StepPopulator(self._test_or_uk.add_step)
def _continues(self, row):
return row.is_continuing() and self._populator or \
(isinstance(self._populator, ForLoopPopulator) and row.is_indented())
def _setting_setter(self, row):
setting_name = row.test_or_user_keyword_setting_name()
return self._test_or_uk.get_setter(setting_name)
class TestCasePopulator(_TestCaseUserKeywordPopulator):
_item_type = 'test case'
class UserKeywordPopulator(_TestCaseUserKeywordPopulator):
_item_type = 'keyword'
class Comments(object):
def __init__(self):
self._crows = []
def add(self, row):
if row.comments:
self._crows.append(row.comments)
def formatted_value(self):
rows = (' '.join(row).strip() for row in self._crows)
return '\n'.join(rows)
class _PropertyPopulator(Populator):
def __init__(self, setter):
self._setter = setter
self._value = []
self._comments = Comments()
def add(self, row):
if not row.is_commented():
self._add(row)
self._comments.add(row)
def _add(self, row):
self._value.extend(row.dedent().data)
class VariablePopulator(_PropertyPopulator):
def __init__(self, setter, name):
_PropertyPopulator.__init__(self, setter)
self._name = name
def populate(self):
self._setter(self._name, self._value,
self._comments.formatted_value())
class SettingPopulator(_PropertyPopulator):
def populate(self):
self._setter(self._value, self._comments.formatted_value())
class StepPopulator(_PropertyPopulator):
def _add(self, row):
self._value.extend(row.data)
def populate(self):
if self._value or self._comments:
self._setter(self._value, self._comments.formatted_value())
class NullPopulator(Populator):
def add(self, row): pass
def populate(self): pass
def __nonzero__(self): return False
| ajibawa-2023/Python-Code-Large/train/row_99873 | 169 | 261 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99873:ClassDef_L16_C0", "label": "Populator", "type": "class", "loc": [16, 19], "level": 0, "parent": null, "vector": [3, 0, 0.067, 0.0153, 0, 0.66, 0.0, 532, 0, 2, 0, 0, 186, 0, 2], "semantic": {"name": "Populator", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Populator(object):\n \"\"\"Explicit interface for all populators.\"\"\"\n def add(self, row): raise NotImplementedError()\n def populate(self): raise NotImplementedError()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:Expr_L17_C4", "label": "expression", "type": "expression", "loc": [17, 17], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:ClassDef_L16_C0", "vector": [8, 1, 0.0651, 0.0038, 1, 0.48, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Explicit interface for all populators.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L18_C4", "label": "add", "type": "function", "loc": [18, 18], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:ClassDef_L16_C0", "vector": [2, 1, 0.069, 0.0038, 1, 0.48, 0.5, 241, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "add", "arg_names": ["self", "row"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def add(self, row): raise NotImplementedError()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L19_C4", "label": "populate", "type": "function", "loc": [19, 19], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:ClassDef_L16_C0", "vector": [2, 1, 0.0728, 0.0038, 1, 0.48, 1.0, 265, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "populate", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def populate(self): raise NotImplementedError()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:ClassDef_L22_C0", "label": "CommentCacher", "type": "class", "loc": [22, 36], "level": 0, "parent": null, "vector": [3, 0, 0.1111, 0.0575, 0, 0.66, 0.0588, 299, 0, 4, 0, 0, 186, 0, 4], "semantic": {"name": "CommentCacher", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class CommentCacher(object):\n\n def __init__(self):\n self._init_comments()\n\n def _init_comments(self):\n self._comments = []\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L24_C4", "label": "__init__", "type": "function", "loc": [24, 25], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:ClassDef_L22_C0", "vector": [2, 1, 0.0939, 0.0077, 1, 0.28, 0.0, 555, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self):\n self._init_comments()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:Expr_L25_C8", "label": "_init_comments()", "type": "expression", "loc": [25, 25], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L24_C4", "vector": [8, 2, 0.0958, 0.0038, 2, 0.24, 0.0, 926, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_init_comments", "arg_names": [], "import_names": [], "rhs_call_name": "_init_comments", "annotation": ""}, "snippet": " self._init_comments()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L27_C4", "label": "_init_comments", "type": "function", "loc": [27, 28], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:ClassDef_L22_C0", "vector": [2, 1, 0.1054, 0.0077, 1, 0.28, 0.3333, 926, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "_init_comments", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _init_comments(self):\n self._comments = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:Assign_L28_C8", "label": "self._comments =", "type": "assigned_variable", "loc": [28, 28], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L27_C4", "vector": [14, 2, 0.1073, 0.0038, 2, 0.97, 0.0, 96, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self._comments", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._comments = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L30_C4", "label": "add", "type": "function", "loc": [30, 31], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:ClassDef_L22_C0", "vector": [2, 1, 0.1169, 0.0077, 1, 0.28, 0.6667, 241, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "add", "arg_names": ["self", "comment"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def add(self, comment):\n self._comments.append(comment)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:Expr_L31_C8", "label": "append()", "type": "expression", "loc": [31, 31], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L30_C4", "vector": [8, 2, 0.1188, 0.0038, 2, 0.22, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self._comments.append(comment)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L33_C4", "label": "consume_comments_with", "type": "function", "loc": [33, 36], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:ClassDef_L22_C0", "vector": [2, 1, 0.1322, 0.0153, 1, 0.28, 1.0, 329, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "consume_comments_with", "arg_names": ["self", "function"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def consume_comments_with(self, function):\n for c in self._comments:\n function(c)\n self._init_comments()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:For_L34_C8", "label": "for c", "type": "for", "loc": [34, 35], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L33_C4", "vector": [6, 2, 0.1322, 0.0077, 2, 0.85, 0.0, 411, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "c", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for c in self._comments:\n function(c)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:Expr_L35_C12", "label": "function()", "type": "expression", "loc": [35, 35], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:For_L34_C8", "vector": [8, 3, 0.1341, 0.0038, 3, 0.92, 0.0, 275, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "function", "arg_names": [], "import_names": [], "rhs_call_name": "function", "annotation": ""}, "snippet": " function(c)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:Expr_L36_C8", "label": "_init_comments()", "type": "expression", "loc": [36, 36], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L33_C4", "vector": [8, 2, 0.1379, 0.0038, 2, 0.85, 1.0, 926, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_init_comments", "arg_names": [], "import_names": [], "rhs_call_name": "_init_comments", "annotation": ""}, "snippet": " self._init_comments()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:ClassDef_L39_C0", "label": "_TablePopulator", "type": "class", "loc": [39, 67], "level": 0, "parent": null, "vector": [3, 0, 0.2031, 0.1111, 0, 0.66, 0.1176, 391, 0, 6, 0, 0, 532, 0, 14], "semantic": {"name": "_TablePopulator", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class _TablePopulator(Populator):\n\n def __init__(self, table):\n self._table = table\n self._populator = NullPopulator()\n self._comments = CommentCacher()\n\n def add(self, row):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L41_C4", "label": "__init__", "type": "function", "loc": [41, 44], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:ClassDef_L39_C0", "vector": [2, 1, 0.1628, 0.0153, 1, 0.09, 0.0, 555, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": ["self", "table"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, table):\n self._table = table\n self._populator = NullPopulator()\n self._comments = CommentCacher()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:Assign_L42_C8", "label": "self._table =", "type": "assigned_variable", "loc": [42, 42], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L41_C4", "vector": [14, 2, 0.1609, 0.0038, 2, 0.29, 0.0, 840, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._table", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._table = table"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:Assign_L43_C8", "label": "self._populator = NullPopulator()", "type": "assigned_variable", "loc": [43, 43], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L41_C4", "vector": [14, 2, 0.1648, 0.0038, 2, 0.29, 0.5, 426, 3, 0, 0, 0, 308, 10, 1], "semantic": {"name": "self._populator", "arg_names": [], "import_names": [], "rhs_call_name": "NullPopulator", "annotation": ""}, "snippet": " self._populator = NullPopulator()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:Assign_L44_C8", "label": "self._comments = CommentCacher()", "type": "assigned_variable", "loc": [44, 44], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L41_C4", "vector": [14, 2, 0.1686, 0.0038, 2, 0.29, 1.0, 96, 3, 0, 0, 0, 299, 10, 1], "semantic": {"name": "self._comments", "arg_names": [], "import_names": [], "rhs_call_name": "CommentCacher", "annotation": ""}, "snippet": " self._comments = CommentCacher()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L46_C4", "label": "add", "type": "function", "loc": [46, 50], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:ClassDef_L39_C0", "vector": [2, 1, 0.1839, 0.0192, 1, 0.09, 0.2, 241, 0, 2, 0, 0, 0, 0, 3], "semantic": {"name": "add", "arg_names": ["self", "row"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def add(self, row):\n if self._is_cacheable_comment_row(row):\n self._comments.add(row)\n else:\n self._add(row)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:If_L47_C8", "label": "if", "type": "if", "loc": [47, 50], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L46_C4", "vector": [4, 2, 0.1858, 0.0153, 2, 0.27, 0.0, 0, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self._is_cacheable_comment_row(row):\n self._comments.add(row)\n else:\n self._add(row)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:Expr_L48_C12", "label": "add()", "type": "expression", "loc": [48, 48], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:If_L47_C8", "vector": [8, 3, 0.1839, 0.0038, 3, 0.5, 0.0, 241, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " self._comments.add(row)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:Expr_L50_C12", "label": "_add()", "type": "expression", "loc": [50, 50], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:If_L47_C8", "vector": [8, 3, 0.1916, 0.0038, 3, 0.5, 1.0, 840, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_add", "arg_names": [], "import_names": [], "rhs_call_name": "_add", "annotation": ""}, "snippet": " self._add(row)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L52_C4", "label": "_add", "type": "function", "loc": [52, 57], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:ClassDef_L39_C0", "vector": [2, 1, 0.2088, 0.023, 1, 0.09, 0.4, 840, 0, 2, 0, 0, 0, 0, 5], "semantic": {"name": "_add", "arg_names": ["self", "row"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _add(self, row):\n if not self._is_continuing(row):\n self._populator.populate()\n self._populator = self._get_populator(row)\n self._comments.consume_comments_with(self._populator.add)\n self._populator.add(row)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:If_L53_C8", "label": "if", "type": "if", "loc": [53, 55], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L52_C4", "vector": [4, 2, 0.2069, 0.0115, 2, 0.97, 0.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not self._is_continuing(row):\n self._populator.populate()\n self._populator = self._get_populator(row)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:Expr_L54_C12", "label": "populate()", "type": "expression", "loc": [54, 54], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:If_L53_C8", "vector": [8, 3, 0.2069, 0.0038, 3, 0.82, 0.0, 265, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "populate", "arg_names": [], "import_names": [], "rhs_call_name": "populate", "annotation": ""}, "snippet": " self._populator.populate()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:Assign_L55_C12", "label": "self._populator = _get_populator()", "type": "assigned_variable", "loc": [55, 55], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:If_L53_C8", "vector": [14, 3, 0.2107, 0.0038, 3, 0.82, 1.0, 426, 3, 1, 0, 0, 220, 10, 1], "semantic": {"name": "self._populator", "arg_names": [], "import_names": [], "rhs_call_name": "_get_populator", "annotation": ""}, "snippet": " self._populator = self._get_populator(row)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:Expr_L56_C8", "label": "consume_comments_with()", "type": "expression", "loc": [56, 56], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L52_C4", "vector": [8, 2, 0.2146, 0.0038, 2, 0.97, 0.5, 329, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "consume_comments_with", "arg_names": [], "import_names": [], "rhs_call_name": "consume_comments_with", "annotation": ""}, "snippet": " self._comments.consume_comments_with(self._populator.add)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:Expr_L57_C8", "label": "add()", "type": "expression", "loc": [57, 57], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L52_C4", "vector": [8, 2, 0.2184, 0.0038, 2, 0.97, 1.0, 241, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " self._populator.add(row)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L59_C4", "label": "populate", "type": "function", "loc": [59, 61], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:ClassDef_L39_C0", "vector": [2, 1, 0.2299, 0.0115, 1, 0.09, 0.6, 265, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "populate", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def populate(self):\n self._comments.consume_comments_with(self._populator.add)\n self._populator.populate()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:Expr_L60_C8", "label": "consume_comments_with()", "type": "expression", "loc": [60, 60], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L59_C4", "vector": [8, 2, 0.2299, 0.0038, 2, 0.2, 0.0, 329, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "consume_comments_with", "arg_names": [], "import_names": [], "rhs_call_name": "consume_comments_with", "annotation": ""}, "snippet": " self._comments.consume_comments_with(self._populator.add)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:Expr_L61_C8", "label": "populate()", "type": "expression", "loc": [61, 61], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L59_C4", "vector": [8, 2, 0.2337, 0.0038, 2, 0.2, 1.0, 265, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "populate", "arg_names": [], "import_names": [], "rhs_call_name": "populate", "annotation": ""}, "snippet": " self._populator.populate()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L63_C4", "label": "_is_continuing", "type": "function", "loc": [63, 64], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:ClassDef_L39_C0", "vector": [2, 1, 0.2433, 0.0077, 1, 0.09, 0.8, 26, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "_is_continuing", "arg_names": ["self", "row"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _is_continuing(self, row):\n return row.is_continuing() and self._populator"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:Return_L64_C8", "label": "return", "type": "return", "loc": [64, 64], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L63_C4", "vector": [13, 2, 0.2452, 0.0038, 2, 0.91, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return row.is_continuing() and self._populator"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L66_C4", "label": "_is_cacheable_comment_row", "type": "function", "loc": [66, 67], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:ClassDef_L39_C0", "vector": [2, 1, 0.2548, 0.0077, 1, 0.09, 1.0, 853, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "_is_cacheable_comment_row", "arg_names": ["self", "row"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _is_cacheable_comment_row(self, row):\n return row.is_commented()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:Return_L67_C8", "label": "return", "type": "return", "loc": [67, 67], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L66_C4", "vector": [13, 2, 0.2567, 0.0038, 2, 0.96, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return row.is_commented()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:ClassDef_L70_C0", "label": "SettingTablePopulator", "type": "class", "loc": [70, 75], "level": 0, "parent": null, "vector": [3, 0, 0.2778, 0.023, 0, 0.66, 0.1765, 253, 0, 1, 0, 0, 391, 0, 4], "semantic": {"name": "SettingTablePopulator", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class SettingTablePopulator(_TablePopulator):\n\n def _get_populator(self, row):\n row.handle_old_style_metadata()\n setter = self._table.get_setter(row.head)\n return SettingPopulator(setter) if setter else NullPopulator()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L72_C4", "label": "_get_populator", "type": "function", "loc": [72, 75], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:ClassDef_L70_C0", "vector": [2, 1, 0.2816, 0.0153, 1, 0.9, 0.0, 220, 0, 2, 1, 0, 0, 0, 4], "semantic": {"name": "_get_populator", "arg_names": ["self", "row"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _get_populator(self, row):\n row.handle_old_style_metadata()\n setter = self._table.get_setter(row.head)\n return SettingPopulator(setter) if setter else NullPopulator()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:Expr_L73_C8", "label": "handle_old_style_metadata()", "type": "expression", "loc": [73, 73], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L72_C4", "vector": [8, 2, 0.2797, 0.0038, 2, 0.95, 0.0, 474, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "handle_old_style_metadata", "arg_names": [], "import_names": [], "rhs_call_name": "handle_old_style_metadata", "annotation": ""}, "snippet": " row.handle_old_style_metadata()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:Assign_L74_C8", "label": "setter = get_setter()", "type": "assigned_variable", "loc": [74, 74], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L72_C4", "vector": [14, 2, 0.2835, 0.0038, 2, 0.95, 0.5, 235, 3, 1, 0, 0, 277, 10, 1], "semantic": {"name": "setter", "arg_names": [], "import_names": [], "rhs_call_name": "get_setter", "annotation": ""}, "snippet": " setter = self._table.get_setter(row.head)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:Return_L75_C8", "label": "return", "type": "return", "loc": [75, 75], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L72_C4", "vector": [13, 2, 0.2874, 0.0038, 2, 0.95, 1.0, 0, 8, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return SettingPopulator(setter) if setter else NullPopulator()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:ClassDef_L78_C0", "label": "VariableTablePopulator", "type": "class", "loc": [78, 81], "level": 0, "parent": null, "vector": [3, 0, 0.3046, 0.0153, 0, 0.66, 0.2353, 852, 0, 1, 0, 0, 391, 0, 1], "semantic": {"name": "VariableTablePopulator", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class VariableTablePopulator(_TablePopulator):\n\n def _get_populator(self, row):\n return VariablePopulator(self._table.add, row.head)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L80_C4", "label": "_get_populator", "type": "function", "loc": [80, 81], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:ClassDef_L78_C0", "vector": [2, 1, 0.3084, 0.0077, 1, 0.38, 0.0, 220, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "_get_populator", "arg_names": ["self", "row"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _get_populator(self, row):\n return VariablePopulator(self._table.add, row.head)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:Return_L81_C8", "label": "return", "type": "return", "loc": [81, 81], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L80_C4", "vector": [13, 2, 0.3103, 0.0038, 2, 0.24, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return VariablePopulator(self._table.add, row.head)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:ClassDef_L84_C0", "label": "_StepContainingTablePopulator", "type": "class", "loc": [84, 90], "level": 0, "parent": null, "vector": [3, 0, 0.3333, 0.0268, 0, 0.66, 0.2941, 924, 0, 2, 0, 0, 391, 0, 4], "semantic": {"name": "_StepContainingTablePopulator", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class _StepContainingTablePopulator(_TablePopulator):\n\n def _is_continuing(self, row):\n return row.is_indented() and self._populator or row.is_commented()\n\n def _is_cacheable_comment_row(self, row):\n return row.is_commented() and isinstance(self._populator, NullPopulator)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L86_C4", "label": "_is_continuing", "type": "function", "loc": [86, 87], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:ClassDef_L84_C0", "vector": [2, 1, 0.3314, 0.0077, 1, 0.61, 0.0, 26, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "_is_continuing", "arg_names": ["self", "row"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _is_continuing(self, row):\n return row.is_indented() and self._populator or row.is_commented()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:Return_L87_C8", "label": "return", "type": "return", "loc": [87, 87], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L86_C4", "vector": [13, 2, 0.3333, 0.0038, 2, 0.37, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return row.is_indented() and self._populator or row.is_commented()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L89_C4", "label": "_is_cacheable_comment_row", "type": "function", "loc": [89, 90], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:ClassDef_L84_C0", "vector": [2, 1, 0.3429, 0.0077, 1, 0.61, 1.0, 853, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "_is_cacheable_comment_row", "arg_names": ["self", "row"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _is_cacheable_comment_row(self, row):\n return row.is_commented() and isinstance(self._populator, NullPopulator)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:Return_L90_C8", "label": "return", "type": "return", "loc": [90, 90], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L89_C4", "vector": [13, 2, 0.3448, 0.0038, 2, 0.14, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return row.is_commented() and isinstance(self._populator, NullPopulator)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:ClassDef_L93_C0", "label": "TestTablePopulator", "type": "class", "loc": [93, 96], "level": 0, "parent": null, "vector": [3, 0, 0.3621, 0.0153, 0, 0.66, 0.3529, 985, 0, 1, 0, 0, 924, 0, 1], "semantic": {"name": "TestTablePopulator", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class TestTablePopulator(_StepContainingTablePopulator):\n\n def _get_populator(self, row):\n return TestCasePopulator(self._table.add)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L95_C4", "label": "_get_populator", "type": "function", "loc": [95, 96], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:ClassDef_L93_C0", "vector": [2, 1, 0.3659, 0.0077, 1, 0.12, 0.0, 220, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "_get_populator", "arg_names": ["self", "row"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _get_populator(self, row):\n return TestCasePopulator(self._table.add)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:Return_L96_C8", "label": "return", "type": "return", "loc": [96, 96], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L95_C4", "vector": [13, 2, 0.3678, 0.0038, 2, 0.77, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return TestCasePopulator(self._table.add)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:ClassDef_L99_C0", "label": "KeywordTablePopulator", "type": "class", "loc": [99, 102], "level": 0, "parent": null, "vector": [3, 0, 0.3851, 0.0153, 0, 0.66, 0.4118, 291, 0, 1, 0, 0, 924, 0, 1], "semantic": {"name": "KeywordTablePopulator", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class KeywordTablePopulator(_StepContainingTablePopulator):\n\n def _get_populator(self, row):\n return UserKeywordPopulator(self._table.add)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L101_C4", "label": "_get_populator", "type": "function", "loc": [101, 102], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:ClassDef_L99_C0", "vector": [2, 1, 0.3889, 0.0077, 1, 0.31, 0.0, 220, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "_get_populator", "arg_names": ["self", "row"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _get_populator(self, row):\n return UserKeywordPopulator(self._table.add)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:Return_L102_C8", "label": "return", "type": "return", "loc": [102, 102], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L101_C4", "vector": [13, 2, 0.3908, 0.0038, 2, 0.68, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return UserKeywordPopulator(self._table.add)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:ClassDef_L105_C0", "label": "ForLoopPopulator", "type": "class", "loc": [105, 134], "level": 0, "parent": null, "vector": [3, 0, 0.4579, 0.1149, 0, 0.66, 0.4706, 166, 0, 4, 0, 0, 532, 0, 14], "semantic": {"name": "ForLoopPopulator", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class ForLoopPopulator(Populator):\n\n def __init__(self, for_loop_creator):\n self._for_loop_creator = for_loop_creator\n self._loop = None\n self._populator = NullPopulator()\n self._declaration = []\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L107_C4", "label": "__init__", "type": "function", "loc": [107, 111], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:ClassDef_L105_C0", "vector": [2, 1, 0.4176, 0.0192, 1, 0.16, 0.0, 555, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": ["self", "for_loop_creator"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, for_loop_creator):\n self._for_loop_creator = for_loop_creator\n self._loop = None\n self._populator = NullPopulator()\n self._declaration = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:Assign_L108_C8", "label": "self._for_loop_creator =", "type": "assigned_variable", "loc": [108, 108], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L107_C4", "vector": [14, 2, 0.4138, 0.0038, 2, 0.86, 0.0, 556, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._for_loop_creator", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._for_loop_creator = for_loop_creator"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:Assign_L109_C8", "label": "self._loop =", "type": "assigned_variable", "loc": [109, 109], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L107_C4", "vector": [14, 2, 0.4176, 0.0038, 2, 0.86, 0.3333, 215, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self._loop", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._loop = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:Assign_L110_C8", "label": "self._populator = NullPopulator()", "type": "assigned_variable", "loc": [110, 110], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L107_C4", "vector": [14, 2, 0.4215, 0.0038, 2, 0.86, 0.6667, 426, 3, 0, 0, 0, 308, 10, 1], "semantic": {"name": "self._populator", "arg_names": [], "import_names": [], "rhs_call_name": "NullPopulator", "annotation": ""}, "snippet": " self._populator = NullPopulator()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:Assign_L111_C8", "label": "self._declaration =", "type": "assigned_variable", "loc": [111, 111], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L107_C4", "vector": [14, 2, 0.4253, 0.0038, 2, 0.86, 1.0, 841, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self._declaration", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._declaration = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L113_C4", "label": "add", "type": "function", "loc": [113, 123], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:ClassDef_L105_C0", "vector": [2, 1, 0.4521, 0.0421, 1, 0.16, 0.3333, 241, 0, 2, 0, 0, 0, 0, 7], "semantic": {"name": "add", "arg_names": ["self", "row"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def add(self, row):\n dedented_row = row.dedent()\n if not self._loop:\n declaration_ready = self._populate_declaration(row)\n if not declaration_ready:\n return\n self._loop = self._for_loop_creator(self._declaration)\n if not row.is_continuing():"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:Assign_L114_C8", "label": "dedented_row = dedent()", "type": "assigned_variable", "loc": [114, 114], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L113_C4", "vector": [14, 2, 0.4368, 0.0038, 2, 0.35, 0.0, 370, 3, 0, 0, 0, 899, 10, 1], "semantic": {"name": "dedented_row", "arg_names": [], "import_names": [], "rhs_call_name": "dedent", "annotation": ""}, "snippet": " dedented_row = row.dedent()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:If_L115_C8", "label": "if", "type": "if", "loc": [115, 119], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L113_C4", "vector": [4, 2, 0.4483, 0.0192, 2, 0.35, 0.3333, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not self._loop:\n declaration_ready = self._populate_declaration(row)\n if not declaration_ready:\n return\n self._loop = self._for_loop_creator(self._declaration)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:Assign_L116_C12", "label": "declaration_ready = _populate_declaration()", "type": "assigned_variable", "loc": [116, 116], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:If_L115_C8", "vector": [14, 3, 0.4444, 0.0038, 3, 0.79, 0.0, 26, 3, 1, 0, 0, 56, 10, 1], "semantic": {"name": "declaration_ready", "arg_names": [], "import_names": [], "rhs_call_name": "_populate_declaration", "annotation": ""}, "snippet": " declaration_ready = self._populate_declaration(row)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:If_L117_C12", "label": "if", "type": "if", "loc": [117, 118], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:If_L115_C8", "vector": [4, 3, 0.4502, 0.0077, 3, 0.79, 0.5, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not declaration_ready:\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:Return_L118_C16", "label": "return", "type": "return", "loc": [118, 118], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:If_L117_C12", "vector": [13, 4, 0.4521, 0.0038, 4, 0.78, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:Assign_L119_C12", "label": "self._loop = _for_loop_creator()", "type": "assigned_variable", "loc": [119, 119], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:If_L115_C8", "vector": [14, 3, 0.4559, 0.0038, 3, 0.79, 1.0, 215, 3, 1, 0, 0, 787, 10, 1], "semantic": {"name": "self._loop", "arg_names": [], "import_names": [], "rhs_call_name": "_for_loop_creator", "annotation": ""}, "snippet": " self._loop = self._for_loop_creator(self._declaration)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:If_L120_C8", "label": "if", "type": "if", "loc": [120, 122], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L113_C4", "vector": [4, 2, 0.4636, 0.0115, 2, 0.35, 0.6667, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not row.is_continuing():\n self._populator.populate()\n self._populator = StepPopulator(self._loop.add_step)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:Expr_L121_C12", "label": "populate()", "type": "expression", "loc": [121, 121], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:If_L120_C8", "vector": [8, 3, 0.4636, 0.0038, 3, 0.62, 0.0, 265, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "populate", "arg_names": [], "import_names": [], "rhs_call_name": "populate", "annotation": ""}, "snippet": " self._populator.populate()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:Assign_L122_C12", "label": "self._populator = StepPopulator()", "type": "assigned_variable", "loc": [122, 122], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:If_L120_C8", "vector": [14, 3, 0.4674, 0.0038, 3, 0.62, 1.0, 426, 3, 1, 0, 0, 291, 10, 1], "semantic": {"name": "self._populator", "arg_names": [], "import_names": [], "rhs_call_name": "StepPopulator", "annotation": ""}, "snippet": " self._populator = StepPopulator(self._loop.add_step)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:Expr_L123_C8", "label": "add()", "type": "expression", "loc": [123, 123], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L113_C4", "vector": [8, 2, 0.4713, 0.0038, 2, 0.35, 1.0, 241, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " self._populator.add(dedented_row)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L125_C4", "label": "_populate_declaration", "type": "function", "loc": [125, 129], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:ClassDef_L105_C0", "vector": [2, 1, 0.4866, 0.0192, 1, 0.16, 0.6667, 56, 0, 2, 1, 0, 0, 0, 4], "semantic": {"name": "_populate_declaration", "arg_names": ["self", "row"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _populate_declaration(self, row):\n if row.starts_for_loop() or row.is_continuing():\n self._declaration.extend(row.dedent().data)\n return False\n return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:If_L126_C8", "label": "if", "type": "if", "loc": [126, 128], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L125_C4", "vector": [4, 2, 0.4866, 0.0115, 2, 0.4, 0.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if row.starts_for_loop() or row.is_continuing():\n self._declaration.extend(row.dedent().data)\n return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:Expr_L127_C12", "label": "extend()", "type": "expression", "loc": [127, 127], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:If_L126_C8", "vector": [8, 3, 0.4866, 0.0038, 3, 0.53, 0.0, 660, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "extend", "arg_names": [], "import_names": [], "rhs_call_name": "extend", "annotation": ""}, "snippet": " self._declaration.extend(row.dedent().data)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:Return_L128_C12", "label": "return", "type": "return", "loc": [128, 128], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:If_L126_C8", "vector": [13, 3, 0.4904, 0.0038, 3, 0.53, 1.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:Return_L129_C8", "label": "return", "type": "return", "loc": [129, 129], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L125_C4", "vector": [13, 2, 0.4943, 0.0038, 2, 0.4, 1.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L131_C4", "label": "populate", "type": "function", "loc": [131, 134], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:ClassDef_L105_C0", "vector": [2, 1, 0.5077, 0.0153, 1, 0.16, 1.0, 265, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "populate", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def populate(self):\n if not self._loop:\n self._for_loop_creator(self._declaration)\n self._populator.populate()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:If_L132_C8", "label": "if", "type": "if", "loc": [132, 133], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L131_C4", "vector": [4, 2, 0.5077, 0.0077, 2, 0.44, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not self._loop:\n self._for_loop_creator(self._declaration)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:Expr_L133_C12", "label": "_for_loop_creator()", "type": "expression", "loc": [133, 133], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:If_L132_C8", "vector": [8, 3, 0.5096, 0.0038, 3, 0.68, 0.0, 787, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_for_loop_creator", "arg_names": [], "import_names": [], "rhs_call_name": "_for_loop_creator", "annotation": ""}, "snippet": " self._for_loop_creator(self._declaration)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:Expr_L134_C8", "label": "populate()", "type": "expression", "loc": [134, 134], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L131_C4", "vector": [8, 2, 0.5134, 0.0038, 2, 0.44, 1.0, 265, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "populate", "arg_names": [], "import_names": [], "rhs_call_name": "populate", "annotation": ""}, "snippet": " self._populator.populate()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:ClassDef_L137_C0", "label": "_TestCaseUserKeywordPopulator", "type": "class", "loc": [137, 190], "level": 0, "parent": null, "vector": [3, 0, 0.6264, 0.2069, 0, 0.66, 0.5294, 310, 0, 9, 0, 0, 532, 0, 31], "semantic": {"name": "_TestCaseUserKeywordPopulator", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class _TestCaseUserKeywordPopulator(Populator):\n\n def __init__(self, test_or_uk_creator):\n self._test_or_uk_creator = test_or_uk_creator\n self._test_or_uk = None\n self._populator = NullPopulator()\n self._comments = CommentCacher()\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L139_C4", "label": "__init__", "type": "function", "loc": [139, 143], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:ClassDef_L137_C0", "vector": [2, 1, 0.5402, 0.0192, 1, 0.22, 0.0, 555, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": ["self", "test_or_uk_creator"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, test_or_uk_creator):\n self._test_or_uk_creator = test_or_uk_creator\n self._test_or_uk = None\n self._populator = NullPopulator()\n self._comments = CommentCacher()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:Assign_L140_C8", "label": "self._test_or_uk_creator =", "type": "assigned_variable", "loc": [140, 140], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L139_C4", "vector": [14, 2, 0.5364, 0.0038, 2, 0.59, 0.0, 766, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._test_or_uk_creator", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._test_or_uk_creator = test_or_uk_creator"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:Assign_L141_C8", "label": "self._test_or_uk =", "type": "assigned_variable", "loc": [141, 141], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L139_C4", "vector": [14, 2, 0.5402, 0.0038, 2, 0.59, 0.3333, 987, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self._test_or_uk", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._test_or_uk = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:Assign_L142_C8", "label": "self._populator = NullPopulator()", "type": "assigned_variable", "loc": [142, 142], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L139_C4", "vector": [14, 2, 0.5441, 0.0038, 2, 0.59, 0.6667, 426, 3, 0, 0, 0, 308, 10, 1], "semantic": {"name": "self._populator", "arg_names": [], "import_names": [], "rhs_call_name": "NullPopulator", "annotation": ""}, "snippet": " self._populator = NullPopulator()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:Assign_L143_C8", "label": "self._comments = CommentCacher()", "type": "assigned_variable", "loc": [143, 143], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L139_C4", "vector": [14, 2, 0.5479, 0.0038, 2, 0.59, 1.0, 96, 3, 0, 0, 0, 299, 10, 1], "semantic": {"name": "self._comments", "arg_names": [], "import_names": [], "rhs_call_name": "CommentCacher", "annotation": ""}, "snippet": " self._comments = CommentCacher()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L145_C4", "label": "add", "type": "function", "loc": [145, 153], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:ClassDef_L137_C0", "vector": [2, 1, 0.5709, 0.0345, 1, 0.22, 0.125, 241, 0, 2, 0, 0, 0, 0, 5], "semantic": {"name": "add", "arg_names": ["self", "row"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def add(self, row):\n if row.is_commented():\n self._comments.add(row)\n return\n if not self._test_or_uk:\n self._test_or_uk = self._test_or_uk_creator(row.head)\n dedented_row = row.dedent()\n if dedented_row:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:If_L146_C8", "label": "if", "type": "if", "loc": [146, 148], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L145_C4", "vector": [4, 2, 0.5632, 0.0115, 2, 0.63, 0.0, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if row.is_commented():\n self._comments.add(row)\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:Expr_L147_C12", "label": "add()", "type": "expression", "loc": [147, 147], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:If_L146_C8", "vector": [8, 3, 0.5632, 0.0038, 3, 0.77, 0.0, 241, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " self._comments.add(row)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:Return_L148_C12", "label": "return", "type": "return", "loc": [148, 148], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:If_L146_C8", "vector": [13, 3, 0.567, 0.0038, 3, 0.77, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:If_L149_C8", "label": "if", "type": "if", "loc": [149, 150], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L145_C4", "vector": [4, 2, 0.5728, 0.0077, 2, 0.63, 0.3333, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not self._test_or_uk:\n self._test_or_uk = self._test_or_uk_creator(row.head)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:Assign_L150_C12", "label": "self._test_or_uk = _test_or_uk_creator()", "type": "assigned_variable", "loc": [150, 150], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:If_L149_C8", "vector": [14, 3, 0.5747, 0.0038, 3, 0.07, 0.0, 987, 3, 1, 0, 0, 384, 10, 1], "semantic": {"name": "self._test_or_uk", "arg_names": [], "import_names": [], "rhs_call_name": "_test_or_uk_creator", "annotation": ""}, "snippet": " self._test_or_uk = self._test_or_uk_creator(row.head)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:Assign_L151_C8", "label": "dedented_row = dedent()", "type": "assigned_variable", "loc": [151, 151], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L145_C4", "vector": [14, 2, 0.5785, 0.0038, 2, 0.63, 0.6667, 370, 3, 0, 0, 0, 899, 10, 1], "semantic": {"name": "dedented_row", "arg_names": [], "import_names": [], "rhs_call_name": "dedent", "annotation": ""}, "snippet": " dedented_row = row.dedent()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:If_L152_C8", "label": "if", "type": "if", "loc": [152, 153], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L145_C4", "vector": [4, 2, 0.5843, 0.0077, 2, 0.63, 1.0, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if dedented_row:\n self._handle_data_row(dedented_row)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:Expr_L153_C12", "label": "_handle_data_row()", "type": "expression", "loc": [153, 153], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:If_L152_C8", "vector": [8, 3, 0.5862, 0.0038, 3, 0.2, 0.0, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_handle_data_row", "arg_names": [], "import_names": [], "rhs_call_name": "_handle_data_row", "annotation": ""}, "snippet": " self._handle_data_row(dedented_row)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L155_C4", "label": "_handle_data_row", "type": "function", "loc": [155, 162], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:ClassDef_L137_C0", "vector": [2, 1, 0.6073, 0.0307, 1, 0.22, 0.25, 525, 0, 2, 0, 0, 0, 0, 6], "semantic": {"name": "_handle_data_row", "arg_names": ["self", "row"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _handle_data_row(self, row):\n if not self._continues(row):\n self._populator.populate()\n self._populator = self._get_populator(row)\n self._flush_comments_with(self._populate_comment_row)\n else:\n self._flush_comments_with(self._populator.add)\n self._populator.add(row)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:If_L156_C8", "label": "if", "type": "if", "loc": [156, 161], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L155_C4", "vector": [4, 2, 0.6073, 0.023, 2, 0.79, 0.0, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not self._continues(row):\n self._populator.populate()\n self._populator = self._get_populator(row)\n self._flush_comments_with(self._populate_comment_row)\n else:\n self._flush_comments_with(self._populator.add)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:Expr_L157_C12", "label": "populate()", "type": "expression", "loc": [157, 157], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:If_L156_C8", "vector": [8, 3, 0.6015, 0.0038, 3, 0.06, 0.0, 265, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "populate", "arg_names": [], "import_names": [], "rhs_call_name": "populate", "annotation": ""}, "snippet": " self._populator.populate()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:Assign_L158_C12", "label": "self._populator = _get_populator()", "type": "assigned_variable", "loc": [158, 158], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:If_L156_C8", "vector": [14, 3, 0.6054, 0.0038, 3, 0.06, 0.3333, 426, 3, 1, 0, 0, 220, 10, 1], "semantic": {"name": "self._populator", "arg_names": [], "import_names": [], "rhs_call_name": "_get_populator", "annotation": ""}, "snippet": " self._populator = self._get_populator(row)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:Expr_L159_C12", "label": "_flush_comments_with()", "type": "expression", "loc": [159, 159], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:If_L156_C8", "vector": [8, 3, 0.6092, 0.0038, 3, 0.06, 0.6667, 294, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_flush_comments_with", "arg_names": [], "import_names": [], "rhs_call_name": "_flush_comments_with", "annotation": ""}, "snippet": " self._flush_comments_with(self._populate_comment_row)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:Expr_L161_C12", "label": "_flush_comments_with()", "type": "expression", "loc": [161, 161], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:If_L156_C8", "vector": [8, 3, 0.6169, 0.0038, 3, 0.06, 1.0, 294, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_flush_comments_with", "arg_names": [], "import_names": [], "rhs_call_name": "_flush_comments_with", "annotation": ""}, "snippet": " self._flush_comments_with(self._populator.add)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:Expr_L162_C8", "label": "add()", "type": "expression", "loc": [162, 162], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L155_C4", "vector": [8, 2, 0.6207, 0.0038, 2, 0.79, 1.0, 241, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " self._populator.add(row)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L164_C4", "label": "_populate_comment_row", "type": "function", "loc": [164, 167], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:ClassDef_L137_C0", "vector": [2, 1, 0.6341, 0.0153, 1, 0.22, 0.375, 243, 0, 2, 0, 0, 0, 0, 3], "semantic": {"name": "_populate_comment_row", "arg_names": ["self", "crow"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _populate_comment_row(self, crow):\n populator = StepPopulator(self._test_or_uk.add_step)\n populator.add(crow)\n populator.populate()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:Assign_L165_C8", "label": "populator = StepPopulator()", "type": "assigned_variable", "loc": [165, 165], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L164_C4", "vector": [14, 2, 0.6322, 0.0038, 2, 0.97, 0.0, 154, 3, 1, 0, 0, 291, 10, 1], "semantic": {"name": "populator", "arg_names": [], "import_names": [], "rhs_call_name": "StepPopulator", "annotation": ""}, "snippet": " populator = StepPopulator(self._test_or_uk.add_step)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:Expr_L166_C8", "label": "add()", "type": "expression", "loc": [166, 166], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L164_C4", "vector": [8, 2, 0.636, 0.0038, 2, 0.97, 0.5, 241, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " populator.add(crow)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:Expr_L167_C8", "label": "populate()", "type": "expression", "loc": [167, 167], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L164_C4", "vector": [8, 2, 0.6398, 0.0038, 2, 0.97, 1.0, 265, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "populate", "arg_names": [], "import_names": [], "rhs_call_name": "populate", "annotation": ""}, "snippet": " populator.populate()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L169_C4", "label": "_flush_comments_with", "type": "function", "loc": [169, 170], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:ClassDef_L137_C0", "vector": [2, 1, 0.6494, 0.0077, 1, 0.22, 0.5, 294, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "_flush_comments_with", "arg_names": ["self", "function"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _flush_comments_with(self, function):\n self._comments.consume_comments_with(function)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:Expr_L170_C8", "label": "consume_comments_with()", "type": "expression", "loc": [170, 170], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L169_C4", "vector": [8, 2, 0.6513, 0.0038, 2, 0.38, 0.0, 329, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "consume_comments_with", "arg_names": [], "import_names": [], "rhs_call_name": "consume_comments_with", "annotation": ""}, "snippet": " self._comments.consume_comments_with(function)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L172_C4", "label": "populate", "type": "function", "loc": [172, 174], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:ClassDef_L137_C0", "vector": [2, 1, 0.6628, 0.0115, 1, 0.22, 0.625, 265, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "populate", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def populate(self):\n self._populator.populate()\n self._flush_comments_with(self._populate_comment_row)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:Expr_L173_C8", "label": "populate()", "type": "expression", "loc": [173, 173], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L172_C4", "vector": [8, 2, 0.6628, 0.0038, 2, 0.02, 0.0, 265, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "populate", "arg_names": [], "import_names": [], "rhs_call_name": "populate", "annotation": ""}, "snippet": " self._populator.populate()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:Expr_L174_C8", "label": "_flush_comments_with()", "type": "expression", "loc": [174, 174], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L172_C4", "vector": [8, 2, 0.6667, 0.0038, 2, 0.02, 1.0, 294, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_flush_comments_with", "arg_names": [], "import_names": [], "rhs_call_name": "_flush_comments_with", "annotation": ""}, "snippet": " self._flush_comments_with(self._populate_comment_row)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L176_C4", "label": "_get_populator", "type": "function", "loc": [176, 182], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:ClassDef_L137_C0", "vector": [2, 1, 0.6858, 0.0268, 1, 0.22, 0.75, 220, 0, 2, 1, 0, 0, 0, 7], "semantic": {"name": "_get_populator", "arg_names": ["self", "row"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _get_populator(self, row):\n if row.starts_test_or_user_keyword_setting():\n setter = self._setting_setter(row)\n return SettingPopulator(setter) if setter else NullPopulator()\n if row.starts_for_loop():\n return ForLoopPopulator(self._test_or_uk.add_for_loop)\n return StepPopulator(self._test_or_uk.add_step)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:If_L177_C8", "label": "if", "type": "if", "loc": [177, 179], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L176_C4", "vector": [4, 2, 0.682, 0.0115, 2, 0.74, 0.0, 0, 3, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if row.starts_test_or_user_keyword_setting():\n setter = self._setting_setter(row)\n return SettingPopulator(setter) if setter else NullPopulator()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:Assign_L178_C12", "label": "setter = _setting_setter()", "type": "assigned_variable", "loc": [178, 178], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:If_L177_C8", "vector": [14, 3, 0.682, 0.0038, 3, 0.55, 0.0, 235, 3, 1, 0, 0, 271, 10, 1], "semantic": {"name": "setter", "arg_names": [], "import_names": [], "rhs_call_name": "_setting_setter", "annotation": ""}, "snippet": " setter = self._setting_setter(row)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:Return_L179_C12", "label": "return", "type": "return", "loc": [179, 179], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:If_L177_C8", "vector": [13, 3, 0.6858, 0.0038, 3, 0.55, 1.0, 0, 8, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return SettingPopulator(setter) if setter else NullPopulator()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:If_L180_C8", "label": "if", "type": "if", "loc": [180, 181], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L176_C4", "vector": [4, 2, 0.6916, 0.0077, 2, 0.74, 0.5, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if row.starts_for_loop():\n return ForLoopPopulator(self._test_or_uk.add_for_loop)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:Return_L181_C12", "label": "return", "type": "return", "loc": [181, 181], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:If_L180_C8", "vector": [13, 3, 0.6935, 0.0038, 3, 0.35, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ForLoopPopulator(self._test_or_uk.add_for_loop)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:Return_L182_C8", "label": "return", "type": "return", "loc": [182, 182], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L176_C4", "vector": [13, 2, 0.6973, 0.0038, 2, 0.74, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return StepPopulator(self._test_or_uk.add_step)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L184_C4", "label": "_continues", "type": "function", "loc": [184, 186], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:ClassDef_L137_C0", "vector": [2, 1, 0.7088, 0.0115, 1, 0.22, 0.875, 512, 0, 2, 1, 0, 0, 0, 3], "semantic": {"name": "_continues", "arg_names": ["self", "row"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _continues(self, row):\n return row.is_continuing() and self._populator or \\\n (isinstance(self._populator, ForLoopPopulator) and row.is_indented())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:Return_L185_C8", "label": "return", "type": "return", "loc": [185, 186], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L184_C4", "vector": [13, 2, 0.7107, 0.0077, 2, 0.92, 0.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return row.is_continuing() and self._populator or \\\n (isinstance(self._populator, ForLoopPopulator) and row.is_indented())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L188_C4", "label": "_setting_setter", "type": "function", "loc": [188, 190], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:ClassDef_L137_C0", "vector": [2, 1, 0.7241, 0.0115, 1, 0.22, 1.0, 271, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "_setting_setter", "arg_names": ["self", "row"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _setting_setter(self, row):\n setting_name = row.test_or_user_keyword_setting_name()\n return self._test_or_uk.get_setter(setting_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:Assign_L189_C8", "label": "setting_name = test_or_user_keyword_setting_name()", "type": "assigned_variable", "loc": [189, 189], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L188_C4", "vector": [14, 2, 0.7241, 0.0038, 2, 0.61, 0.0, 268, 3, 0, 0, 0, 803, 10, 1], "semantic": {"name": "setting_name", "arg_names": [], "import_names": [], "rhs_call_name": "test_or_user_keyword_setting_name", "annotation": ""}, "snippet": " setting_name = row.test_or_user_keyword_setting_name()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:Return_L190_C8", "label": "return", "type": "return", "loc": [190, 190], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L188_C4", "vector": [13, 2, 0.728, 0.0038, 2, 0.61, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._test_or_uk.get_setter(setting_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:ClassDef_L193_C0", "label": "TestCasePopulator", "type": "class", "loc": [193, 194], "level": 0, "parent": null, "vector": [3, 0, 0.7414, 0.0077, 0, 0.66, 0.5882, 118, 0, 0, 0, 0, 310, 0, 0], "semantic": {"name": "TestCasePopulator", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class TestCasePopulator(_TestCaseUserKeywordPopulator):\n _item_type = 'test case'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:Assign_L194_C4", "label": "_item_type =", "type": "assigned_variable", "loc": [194, 194], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:ClassDef_L193_C0", "vector": [14, 1, 0.7433, 0.0038, 1, 0.87, 0.0, 955, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "_item_type", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " _item_type = 'test case'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:ClassDef_L197_C0", "label": "UserKeywordPopulator", "type": "class", "loc": [197, 198], "level": 0, "parent": null, "vector": [3, 0, 0.7567, 0.0077, 0, 0.66, 0.6471, 561, 0, 0, 0, 0, 310, 0, 0], "semantic": {"name": "UserKeywordPopulator", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class UserKeywordPopulator(_TestCaseUserKeywordPopulator):\n _item_type = 'keyword'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:Assign_L198_C4", "label": "_item_type =", "type": "assigned_variable", "loc": [198, 198], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:ClassDef_L197_C0", "vector": [14, 1, 0.7586, 0.0038, 1, 0.01, 0.0, 955, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "_item_type", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " _item_type = 'keyword'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:ClassDef_L201_C0", "label": "Comments", "type": "class", "loc": [201, 212], "level": 0, "parent": null, "vector": [3, 0, 0.7912, 0.046, 0, 0.66, 0.7059, 483, 0, 3, 0, 0, 186, 0, 4], "semantic": {"name": "Comments", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Comments(object):\n\n def __init__(self):\n self._crows = []\n\n def add(self, row):\n if row.comments:\n self._crows.append(row.comments)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L203_C4", "label": "__init__", "type": "function", "loc": [203, 204], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:ClassDef_L201_C0", "vector": [2, 1, 0.7797, 0.0077, 1, 0.85, 0.0, 555, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self):\n self._crows = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:Assign_L204_C8", "label": "self._crows =", "type": "assigned_variable", "loc": [204, 204], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L203_C4", "vector": [14, 2, 0.7816, 0.0038, 2, 0.23, 0.0, 127, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self._crows", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._crows = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L206_C4", "label": "add", "type": "function", "loc": [206, 208], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:ClassDef_L201_C0", "vector": [2, 1, 0.7931, 0.0115, 1, 0.85, 0.5, 241, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "add", "arg_names": ["self", "row"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def add(self, row):\n if row.comments:\n self._crows.append(row.comments)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:If_L207_C8", "label": "if", "type": "if", "loc": [207, 208], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L206_C4", "vector": [4, 2, 0.795, 0.0077, 2, 0.91, 0.0, 0, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if row.comments:\n self._crows.append(row.comments)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:Expr_L208_C12", "label": "append()", "type": "expression", "loc": [208, 208], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:If_L207_C8", "vector": [8, 3, 0.7969, 0.0038, 3, 0.86, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self._crows.append(row.comments)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L210_C4", "label": "formatted_value", "type": "function", "loc": [210, 212], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:ClassDef_L201_C0", "vector": [2, 1, 0.8084, 0.0115, 1, 0.85, 1.0, 617, 0, 1, 1, 0, 0, 0, 3], "semantic": {"name": "formatted_value", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def formatted_value(self):\n rows = (' '.join(row).strip() for row in self._crows)\n return '\\n'.join(rows)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:Assign_L211_C8", "label": "rows =", "type": "assigned_variable", "loc": [211, 211], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L210_C4", "vector": [14, 2, 0.8084, 0.0038, 2, 0.21, 0.0, 275, 5, 0, 0, 0, 0, 0, 2], "semantic": {"name": "rows", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rows = (' '.join(row).strip() for row in self._crows)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:Return_L212_C8", "label": "return", "type": "return", "loc": [212, 212], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L210_C4", "vector": [13, 2, 0.8123, 0.0038, 2, 0.21, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return '\\n'.join(rows)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:ClassDef_L215_C0", "label": "_PropertyPopulator", "type": "class", "loc": [215, 228], "level": 0, "parent": null, "vector": [3, 0, 0.8487, 0.0536, 0, 0.66, 0.7647, 308, 0, 3, 0, 0, 532, 0, 6], "semantic": {"name": "_PropertyPopulator", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class _PropertyPopulator(Populator):\n\n def __init__(self, setter):\n self._setter = setter\n self._value = []\n self._comments = Comments()\n\n def add(self, row):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L217_C4", "label": "__init__", "type": "function", "loc": [217, 220], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:ClassDef_L215_C0", "vector": [2, 1, 0.8372, 0.0153, 1, 0.48, 0.0, 555, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": ["self", "setter"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, setter):\n self._setter = setter\n self._value = []\n self._comments = Comments()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:Assign_L218_C8", "label": "self._setter =", "type": "assigned_variable", "loc": [218, 218], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L217_C4", "vector": [14, 2, 0.8352, 0.0038, 2, 0.21, 0.0, 880, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._setter", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._setter = setter"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:Assign_L219_C8", "label": "self._value =", "type": "assigned_variable", "loc": [219, 219], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L217_C4", "vector": [14, 2, 0.8391, 0.0038, 2, 0.21, 0.5, 756, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self._value", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._value = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:Assign_L220_C8", "label": "self._comments = Comments()", "type": "assigned_variable", "loc": [220, 220], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L217_C4", "vector": [14, 2, 0.8429, 0.0038, 2, 0.21, 1.0, 96, 3, 0, 0, 0, 483, 10, 1], "semantic": {"name": "self._comments", "arg_names": [], "import_names": [], "rhs_call_name": "Comments", "annotation": ""}, "snippet": " self._comments = Comments()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L222_C4", "label": "add", "type": "function", "loc": [222, 225], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:ClassDef_L215_C0", "vector": [2, 1, 0.8563, 0.0153, 1, 0.48, 0.5, 241, 0, 2, 0, 0, 0, 0, 3], "semantic": {"name": "add", "arg_names": ["self", "row"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def add(self, row):\n if not row.is_commented():\n self._add(row)\n self._comments.add(row)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:If_L223_C8", "label": "if", "type": "if", "loc": [223, 224], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L222_C4", "vector": [4, 2, 0.8563, 0.0077, 2, 0.87, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not row.is_commented():\n self._add(row)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:Expr_L224_C12", "label": "_add()", "type": "expression", "loc": [224, 224], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:If_L223_C8", "vector": [8, 3, 0.8582, 0.0038, 3, 0.38, 0.0, 840, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_add", "arg_names": [], "import_names": [], "rhs_call_name": "_add", "annotation": ""}, "snippet": " self._add(row)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:Expr_L225_C8", "label": "add()", "type": "expression", "loc": [225, 225], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L222_C4", "vector": [8, 2, 0.8621, 0.0038, 2, 0.87, 1.0, 241, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " self._comments.add(row)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L227_C4", "label": "_add", "type": "function", "loc": [227, 228], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:ClassDef_L215_C0", "vector": [2, 1, 0.8716, 0.0077, 1, 0.48, 1.0, 840, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "_add", "arg_names": ["self", "row"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _add(self, row):\n self._value.extend(row.dedent().data)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:Expr_L228_C8", "label": "extend()", "type": "expression", "loc": [228, 228], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L227_C4", "vector": [8, 2, 0.8736, 0.0038, 2, 0.19, 0.0, 660, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "extend", "arg_names": [], "import_names": [], "rhs_call_name": "extend", "annotation": ""}, "snippet": " self._value.extend(row.dedent().data)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:ClassDef_L231_C0", "label": "VariablePopulator", "type": "class", "loc": [231, 239], "level": 0, "parent": null, "vector": [3, 0, 0.9004, 0.0345, 0, 0.66, 0.8235, 717, 0, 2, 0, 0, 308, 0, 3], "semantic": {"name": "VariablePopulator", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class VariablePopulator(_PropertyPopulator):\n\n def __init__(self, setter, name):\n _PropertyPopulator.__init__(self, setter)\n self._name = name\n\n def populate(self):\n self._setter(self._name, self._value,"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L233_C4", "label": "__init__", "type": "function", "loc": [233, 235], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:ClassDef_L231_C0", "vector": [2, 1, 0.8966, 0.0115, 1, 0.0, 0.0, 555, 0, 3, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": ["self", "setter", "name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, setter, name):\n _PropertyPopulator.__init__(self, setter)\n self._name = name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:Expr_L234_C8", "label": "__init__()", "type": "expression", "loc": [234, 234], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L233_C4", "vector": [8, 2, 0.8966, 0.0038, 2, 0.65, 0.0, 555, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " _PropertyPopulator.__init__(self, setter)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:Assign_L235_C8", "label": "self._name =", "type": "assigned_variable", "loc": [235, 235], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L233_C4", "vector": [14, 2, 0.9004, 0.0038, 2, 0.65, 1.0, 257, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._name = name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L237_C4", "label": "populate", "type": "function", "loc": [237, 239], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:ClassDef_L231_C0", "vector": [2, 1, 0.9119, 0.0115, 1, 0.0, 1.0, 265, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "populate", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def populate(self):\n self._setter(self._name, self._value,\n self._comments.formatted_value())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:Expr_L238_C8", "label": "_setter()", "type": "expression", "loc": [238, 239], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L237_C4", "vector": [8, 2, 0.9138, 0.0077, 2, 0.15, 0.0, 677, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "_setter", "arg_names": [], "import_names": [], "rhs_call_name": "_setter", "annotation": ""}, "snippet": " self._setter(self._name, self._value,\n self._comments.formatted_value())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:ClassDef_L242_C0", "label": "SettingPopulator", "type": "class", "loc": [242, 245], "level": 0, "parent": null, "vector": [3, 0, 0.933, 0.0153, 0, 0.66, 0.8824, 578, 0, 1, 0, 0, 308, 0, 2], "semantic": {"name": "SettingPopulator", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class SettingPopulator(_PropertyPopulator):\n\n def populate(self):\n self._setter(self._value, self._comments.formatted_value())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L244_C4", "label": "populate", "type": "function", "loc": [244, 245], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:ClassDef_L242_C0", "vector": [2, 1, 0.9368, 0.0077, 1, 0.64, 0.0, 265, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "populate", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def populate(self):\n self._setter(self._value, self._comments.formatted_value())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:Expr_L245_C8", "label": "_setter()", "type": "expression", "loc": [245, 245], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L244_C4", "vector": [8, 2, 0.9387, 0.0038, 2, 0.31, 0.0, 677, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "_setter", "arg_names": [], "import_names": [], "rhs_call_name": "_setter", "annotation": ""}, "snippet": " self._setter(self._value, self._comments.formatted_value())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:ClassDef_L248_C0", "label": "StepPopulator", "type": "class", "loc": [248, 255], "level": 0, "parent": null, "vector": [3, 0, 0.9636, 0.0307, 0, 0.66, 0.9412, 291, 0, 2, 0, 0, 308, 0, 3], "semantic": {"name": "StepPopulator", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class StepPopulator(_PropertyPopulator):\n\n def _add(self, row):\n self._value.extend(row.data)\n\n def populate(self):\n if self._value or self._comments:\n self._setter(self._value, self._comments.formatted_value())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L250_C4", "label": "_add", "type": "function", "loc": [250, 251], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:ClassDef_L248_C0", "vector": [2, 1, 0.9598, 0.0077, 1, 0.65, 0.0, 840, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "_add", "arg_names": ["self", "row"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _add(self, row):\n self._value.extend(row.data)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:Expr_L251_C8", "label": "extend()", "type": "expression", "loc": [251, 251], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L250_C4", "vector": [8, 2, 0.9617, 0.0038, 2, 0.53, 0.0, 660, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "extend", "arg_names": [], "import_names": [], "rhs_call_name": "extend", "annotation": ""}, "snippet": " self._value.extend(row.data)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L253_C4", "label": "populate", "type": "function", "loc": [253, 255], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:ClassDef_L248_C0", "vector": [2, 1, 0.9732, 0.0115, 1, 0.65, 1.0, 265, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "populate", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def populate(self):\n if self._value or self._comments:\n self._setter(self._value, self._comments.formatted_value())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:If_L254_C8", "label": "if", "type": "if", "loc": [254, 255], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L253_C4", "vector": [4, 2, 0.9751, 0.0077, 2, 0.58, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self._value or self._comments:\n self._setter(self._value, self._comments.formatted_value())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:Expr_L255_C12", "label": "_setter()", "type": "expression", "loc": [255, 255], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:If_L254_C8", "vector": [8, 3, 0.977, 0.0038, 3, 0.69, 0.0, 677, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "_setter", "arg_names": [], "import_names": [], "rhs_call_name": "_setter", "annotation": ""}, "snippet": " self._setter(self._value, self._comments.formatted_value())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:ClassDef_L258_C0", "label": "NullPopulator", "type": "class", "loc": [258, 261], "level": 0, "parent": null, "vector": [3, 0, 0.9943, 0.0153, 0, 0.66, 1.0, 308, 0, 3, 0, 0, 532, 0, 0], "semantic": {"name": "NullPopulator", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class NullPopulator(Populator):\n def add(self, row): pass\n def populate(self): pass\n def __nonzero__(self): return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L259_C4", "label": "add", "type": "function", "loc": [259, 259], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:ClassDef_L258_C0", "vector": [2, 1, 0.9923, 0.0038, 1, 0.05, 0.0, 241, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "add", "arg_names": ["self", "row"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def add(self, row): pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L260_C4", "label": "populate", "type": "function", "loc": [260, 260], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:ClassDef_L258_C0", "vector": [2, 1, 0.9962, 0.0038, 1, 0.05, 0.5, 265, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "populate", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def populate(self): pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L261_C4", "label": "__nonzero__", "type": "function", "loc": [261, 261], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:ClassDef_L258_C0", "vector": [2, 1, 1.0, 0.0038, 1, 0.05, 1.0, 322, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "__nonzero__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __nonzero__(self): return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99873:Return_L261_C27", "label": "return", "type": "return", "loc": [261, 261], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L261_C4", "vector": [13, 2, 1.0, 0.0038, 2, 0.97, 0.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __nonzero__(self): return False"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99873:ClassDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:Expr_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:ClassDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:ClassDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L24_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:Expr_L25_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L27_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L27_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:Assign_L28_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L30_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L30_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:Expr_L31_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L33_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L33_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:For_L34_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:For_L34_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:Expr_L35_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L33_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:Expr_L36_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:ClassDef_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L41_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L41_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:Assign_L42_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L41_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:Assign_L43_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L41_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:Assign_L44_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:ClassDef_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L46_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L46_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:If_L47_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:If_L47_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:Expr_L48_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:If_L47_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:Expr_L50_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:ClassDef_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L52_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L52_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:If_L53_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:If_L53_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:Expr_L54_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:If_L53_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:Assign_L55_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L52_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:Expr_L56_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L52_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:Expr_L57_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:ClassDef_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L59_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L59_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:Expr_L60_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L59_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:Expr_L61_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:ClassDef_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L63_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:Return_L64_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:ClassDef_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L66_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L66_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:Return_L67_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:ClassDef_L70_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L72_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L72_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:Expr_L73_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L72_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:Assign_L74_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L72_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:Return_L75_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:ClassDef_L78_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L80_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L80_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:Return_L81_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:ClassDef_L84_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L86_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L86_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:Return_L87_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:ClassDef_L84_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L89_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L89_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:Return_L90_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:ClassDef_L93_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L95_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L95_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:Return_L96_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:ClassDef_L99_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L101_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L101_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:Return_L102_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:ClassDef_L105_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L107_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L107_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:Assign_L108_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L107_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:Assign_L109_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L107_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:Assign_L110_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L107_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:Assign_L111_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:ClassDef_L105_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L113_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L113_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:Assign_L114_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L113_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:If_L115_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:If_L115_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:Assign_L116_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:If_L115_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:If_L117_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:If_L117_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:Return_L118_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:If_L115_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:Assign_L119_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L113_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:If_L120_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:If_L120_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:Expr_L121_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:If_L120_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:Assign_L122_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L113_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:Expr_L123_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:ClassDef_L105_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L125_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L125_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:If_L126_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:If_L126_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:Expr_L127_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:If_L126_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:Return_L128_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L125_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:Return_L129_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:ClassDef_L105_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L131_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L131_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:If_L132_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:If_L132_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:Expr_L133_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L131_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:Expr_L134_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:ClassDef_L137_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L139_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L139_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:Assign_L140_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L139_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:Assign_L141_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L139_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:Assign_L142_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L139_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:Assign_L143_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:ClassDef_L137_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L145_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L145_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:If_L146_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:If_L146_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:Expr_L147_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:If_L146_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:Return_L148_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L145_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:If_L149_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:If_L149_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:Assign_L150_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L145_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:Assign_L151_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L145_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:If_L152_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:If_L152_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:Expr_L153_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:ClassDef_L137_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L155_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L155_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:If_L156_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:If_L156_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:Expr_L157_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:If_L156_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:Assign_L158_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:If_L156_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:Expr_L159_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:If_L156_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:Expr_L161_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L155_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:Expr_L162_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:ClassDef_L137_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L164_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L164_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:Assign_L165_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L164_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:Expr_L166_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L164_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:Expr_L167_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:ClassDef_L137_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L169_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L169_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:Expr_L170_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:ClassDef_L137_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L172_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L172_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:Expr_L173_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L172_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:Expr_L174_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:ClassDef_L137_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L176_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L176_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:If_L177_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:If_L177_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:Assign_L178_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:If_L177_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:Return_L179_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L176_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:If_L180_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:If_L180_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:Return_L181_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L176_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:Return_L182_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:ClassDef_L137_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L184_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L184_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:Return_L185_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:ClassDef_L137_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L188_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L188_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:Assign_L189_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L188_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:Return_L190_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:ClassDef_L193_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:Assign_L194_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:ClassDef_L197_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:Assign_L198_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:ClassDef_L201_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L203_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L203_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:Assign_L204_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:ClassDef_L201_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L206_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L206_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:If_L207_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:If_L207_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:Expr_L208_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:ClassDef_L201_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L210_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L210_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:Assign_L211_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L210_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:Return_L212_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:ClassDef_L215_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L217_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L217_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:Assign_L218_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L217_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:Assign_L219_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L217_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:Assign_L220_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:ClassDef_L215_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L222_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L222_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:If_L223_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:If_L223_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:Expr_L224_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L222_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:Expr_L225_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:ClassDef_L215_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L227_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L227_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:Expr_L228_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:ClassDef_L231_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L233_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L233_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:Expr_L234_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L233_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:Assign_L235_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:ClassDef_L231_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L237_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L237_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:Expr_L238_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:ClassDef_L242_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L244_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L244_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:Expr_L245_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:ClassDef_L248_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L250_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L250_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:Expr_L251_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:ClassDef_L248_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L253_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L253_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:If_L254_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:If_L254_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:Expr_L255_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:ClassDef_L258_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L259_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:ClassDef_L258_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L260_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:ClassDef_L258_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L261_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99873:FunctionDef_L261_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99873:Return_L261_C27"}] |
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import os
from robot.errors import DataError
from robot.variables import is_var
from robot.output import LOGGER
from robot import utils
from settings import (Documentation, Fixture, Timeout, Tags, Metadata,
Library, Resource, Variables, Arguments, Return, Template)
from populators import FromFilePopulator, FromDirectoryPopulator
def TestData(parent=None, source=None, include_suites=[], warn_on_skipped=False):
if os.path.isdir(source):
return TestDataDirectory(parent, source, include_suites, warn_on_skipped)
return TestCaseFile(parent, source)
class _TestData(object):
def __init__(self, parent=None, source=None):
self.parent = parent
self.source = utils.abspath(source) if source else None
self.children = []
self._tables = None
def _get_tables(self):
if not self._tables:
self._tables = utils.NormalizedDict({'Setting': self.setting_table,
'Settings': self.setting_table,
'Metadata': self.setting_table,
'Variable': self.variable_table,
'Variables': self.variable_table,
'Keyword': self.keyword_table,
'Keywords': self.keyword_table,
'User Keyword': self.keyword_table,
'User Keywords': self.keyword_table,
'Test Case': self.testcase_table,
'Test Cases': self.testcase_table})
return self._tables
def start_table(self, header_row):
table_name = header_row[0]
try:
table = self._valid_table(self._get_tables()[table_name])
except KeyError:
return None
else:
if table is not None:
table.set_header(header_row)
return table
@property
def name(self):
if not self.source:
return None
name = self._get_basename()
name = name.split('__', 1)[-1] # Strip possible prefix
name = name.replace('_', ' ').strip()
if name.islower():
name = name.title()
return name
def _get_basename(self):
return os.path.splitext(os.path.basename(self.source))[0]
@property
def keywords(self):
return self.keyword_table.keywords
@property
def imports(self):
return self.setting_table.imports
def report_invalid_syntax(self, table, message, level='ERROR'):
initfile = getattr(self, 'initfile', None)
path = os.path.join(self.source, initfile) if initfile else self.source
LOGGER.write("Invalid syntax in file '%s' in table '%s': %s"
% (path, table, message), level)
class TestCaseFile(_TestData):
def __init__(self, parent=None, source=None):
_TestData.__init__(self, parent, source)
self.directory = os.path.dirname(self.source) if self.source else None
self.setting_table = TestCaseFileSettingTable(self)
self.variable_table = VariableTable(self)
self.testcase_table = TestCaseTable(self)
self.keyword_table = KeywordTable(self)
if source: # FIXME: model should be decoupled from populating
FromFilePopulator(self).populate(source)
self._validate()
def _validate(self):
if not self.testcase_table.is_started():
raise DataError('File has no test case table.')
def _valid_table(self, table):
return table
def has_tests(self):
return True
def __iter__(self):
for table in [self.setting_table, self.variable_table,
self.testcase_table, self.keyword_table]:
yield table
class ResourceFile(_TestData):
def __init__(self, source=None):
_TestData.__init__(self, source=source)
self.directory = os.path.dirname(self.source) if self.source else None
self.setting_table = ResourceFileSettingTable(self)
self.variable_table = VariableTable(self)
self.testcase_table = TestCaseTable(self)
self.keyword_table = KeywordTable(self)
if self.source:
FromFilePopulator(self).populate(source)
self._report_status()
def _report_status(self):
if self.setting_table or self.variable_table or self.keyword_table:
LOGGER.info("Imported resource file '%s' (%d keywords)."
% (self.source, len(self.keyword_table.keywords)))
else:
LOGGER.warn("Imported resource file '%s' is empty." % self.source)
def _valid_table(self, table):
if table is self.testcase_table:
raise DataError("Resource file '%s' contains a test case table "
"which is not allowed." % self.source)
return table
def __iter__(self):
for table in [self.setting_table, self.variable_table,
self.keyword_table]:
yield table
class TestDataDirectory(_TestData):
def __init__(self, parent=None, source=None, include_suites=[], warn_on_skipped=False):
_TestData.__init__(self, parent, source)
self.directory = self.source
self.initfile = None
self.setting_table = InitFileSettingTable(self)
self.variable_table = VariableTable(self)
self.testcase_table = TestCaseTable(self)
self.keyword_table = KeywordTable(self)
if self.source:
FromDirectoryPopulator().populate(self.source, self, include_suites, warn_on_skipped)
self.children = [ ch for ch in self.children if ch.has_tests() ]
def _get_basename(self):
return os.path.basename(self.source)
def _valid_table(self, table):
if table is self.testcase_table:
LOGGER.error("Test suite init file in '%s' contains a test case "
"table which is not allowed." % self.source)
return None
return table
def add_child(self, path, include_suites):
self.children.append(TestData(parent=self,source=path,
include_suites=include_suites))
def has_tests(self):
return any(ch.has_tests() for ch in self.children)
def __iter__(self):
for table in [self.setting_table, self.variable_table,
self.keyword_table]:
yield table
class _Table(object):
def __init__(self, parent):
self.parent = parent
self.header = None
def set_header(self, header):
self.header = header
@property
def name(self):
return self.header[0]
@property
def source(self):
return self.parent.source
@property
def directory(self):
return self.parent.directory
def report_invalid_syntax(self, message, level='ERROR'):
self.parent.report_invalid_syntax(self.name, message, level)
class _WithSettings(object):
def get_setter(self, setting_name):
normalized = self.normalize(setting_name)
if normalized in self._setters:
return self._setters[normalized](self)
self.report_invalid_syntax("Non-existing setting '%s'." % setting_name)
def is_setting(self, setting_name):
return self.normalize(setting_name) in self._setters
def normalize(self, setting):
result = utils.normalize(setting)
return result[0:-1] if result and result[-1]==':' else result
class _SettingTable(_Table, _WithSettings):
type = 'setting'
def __init__(self, parent):
_Table.__init__(self, parent)
self.doc = Documentation('Documentation', self)
self.suite_setup = Fixture('Suite Setup', self)
self.suite_teardown = Fixture('Suite Teardown', self)
self.test_setup = Fixture('Test Setup', self)
self.test_teardown = Fixture('Test Teardown', self)
self.force_tags = Tags('Force Tags', self)
self.default_tags = Tags('Default Tags', self)
self.test_template = Template('Test Template', self)
self.test_timeout = Timeout('Test Timeout', self)
self.metadata = []
self.imports = []
def _get_adder(self, adder_method):
def adder(value, comment):
name = value[0] if value else ''
adder_method(name, value[1:], comment)
return adder
def add_metadata(self, name, value='', comment=None):
self.metadata.append(Metadata('Metadata', self, name, value, comment))
return self.metadata[-1]
def add_library(self, name, args=None, comment=None):
self.imports.append(Library(self, name, args, comment=comment))
return self.imports[-1]
def add_resource(self, name, invalid_args=None, comment=None):
self.imports.append(Resource(self, name, invalid_args, comment=comment))
return self.imports[-1]
def add_variables(self, name, args=None, comment=None):
self.imports.append(Variables(self, name, args, comment=comment))
return self.imports[-1]
def __nonzero__(self):
return any(setting.is_set() for setting in self)
class TestCaseFileSettingTable(_SettingTable):
_setters = {'documentation': lambda s: s.doc.populate,
'document': lambda s: s.doc.populate,
'suitesetup': lambda s: s.suite_setup.populate,
'suiteprecondition': lambda s: s.suite_setup.populate,
'suiteteardown': lambda s: s.suite_teardown.populate,
'suitepostcondition': lambda s: s.suite_teardown.populate,
'testsetup': lambda s: s.test_setup.populate,
'testprecondition': lambda s: s.test_setup.populate,
'testteardown': lambda s: s.test_teardown.populate,
'testpostcondition': lambda s: s.test_teardown.populate,
'forcetags': lambda s: s.force_tags.populate,
'defaulttags': lambda s: s.default_tags.populate,
'testtemplate': lambda s: s.test_template.populate,
'testtimeout': lambda s: s.test_timeout.populate,
'library': lambda s: s._get_adder(s.add_library),
'resource': lambda s: s._get_adder(s.add_resource),
'variables': lambda s: s._get_adder(s.add_variables),
'metadata': lambda s: s._get_adder(s.add_metadata)}
def __iter__(self):
for setting in [self.doc, self.suite_setup, self.suite_teardown,
self.test_setup, self.test_teardown, self.force_tags,
self.default_tags, self.test_template, self.test_timeout] \
+ self.metadata + self.imports:
yield setting
class ResourceFileSettingTable(_SettingTable):
_setters = {'documentation': lambda s: s.doc.populate,
'document': lambda s: s.doc.populate,
'library': lambda s: s._get_adder(s.add_library),
'resource': lambda s: s._get_adder(s.add_resource),
'variables': lambda s: s._get_adder(s.add_variables)}
def __iter__(self):
for setting in [self.doc] + self.imports:
yield setting
class InitFileSettingTable(_SettingTable):
_setters = {'documentation': lambda s: s.doc.populate,
'document': lambda s: s.doc.populate,
'suitesetup': lambda s: s.suite_setup.populate,
'suiteprecondition': lambda s: s.suite_setup.populate,
'suiteteardown': lambda s: s.suite_teardown.populate,
'suitepostcondition': lambda s: s.suite_teardown.populate,
'testsetup': lambda s: s.test_setup.populate,
'testprecondition': lambda s: s.test_setup.populate,
'testteardown': lambda s: s.test_teardown.populate,
'testpostcondition': lambda s: s.test_teardown.populate,
'forcetags': lambda s: s.force_tags.populate,
'library': lambda s: s._get_adder(s.add_library),
'resource': lambda s: s._get_adder(s.add_resource),
'variables': lambda s: s._get_adder(s.add_variables),
'metadata': lambda s: s._get_adder(s.add_metadata)}
def __iter__(self):
for setting in [self.doc, self.suite_setup, self.suite_teardown,
self.test_setup, self.test_teardown, self.force_tags] \
+ self.metadata + self.imports:
yield setting
class VariableTable(_Table):
type = 'variable'
def __init__(self, parent):
_Table.__init__(self, parent)
self.variables = []
def add(self, name, value, comment=None):
self.variables.append(Variable(name, value, comment))
def __iter__(self):
return iter(self.variables)
def __nonzero__(self):
return bool(self.variables)
class TestCaseTable(_Table):
type = 'testcase'
def __init__(self, parent):
_Table.__init__(self, parent)
self.tests = []
def add(self, name):
self.tests.append(TestCase(self, name))
return self.tests[-1]
def __iter__(self):
return iter(self.tests)
def __nonzero__(self):
return bool(self.tests)
def is_started(self):
return bool(self.header)
class KeywordTable(_Table):
type = 'keyword'
def __init__(self, parent):
_Table.__init__(self, parent)
self.keywords = []
def add(self, name):
self.keywords.append(UserKeyword(self, name))
return self.keywords[-1]
def __iter__(self):
return iter(self.keywords)
def __nonzero__(self):
return bool(self.keywords)
class Variable(object):
def __init__(self, name, value, comment=None):
self.name = name.rstrip('= ')
if name.startswith('$') and value == []:
value = ''
if isinstance(value, basestring):
value = [value] # Need to support scalar lists until RF 2.6
self.value = value
self.comment = comment
def as_list(self):
ret = [self.name] + self.value
if self.comment:
ret.append('# %s' % self.comment)
return ret
def is_set(self):
return True
def is_for_loop(self):
return False
class _WithSteps(object):
def add_step(self, content, comment=None):
self.steps.append(Step(content, comment))
return self.steps[-1]
class TestCase(_WithSteps, _WithSettings):
def __init__(self, parent, name):
self.parent = parent
self.name = name
self.doc = Documentation('[Documentation]', self)
self.template = Template('[Template]', self)
self.tags = Tags('[Tags]', self)
self.setup = Fixture('[Setup]', self)
self.teardown = Fixture('[Teardown]', self)
self.timeout = Timeout('[Timeout]', self)
self.steps = []
_setters = {'documentation': lambda s: s.doc.populate,
'document': lambda s: s.doc.populate,
'template': lambda s: s.template.populate,
'setup': lambda s: s.setup.populate,
'precondition': lambda s: s.setup.populate,
'teardown': lambda s: s.teardown.populate,
'postcondition': lambda s: s.teardown.populate,
'tags': lambda s: s.tags.populate,
'timeout': lambda s: s.timeout.populate}
@property
def source(self):
return self.parent.source
@property
def directory(self):
return self.parent.directory
def add_for_loop(self, data):
self.steps.append(ForLoop(data))
return self.steps[-1]
def report_invalid_syntax(self, message, level='ERROR'):
type_ = 'test case' if type(self) is TestCase else 'keyword'
message = "Invalid syntax in %s '%s': %s" % (type_, self.name, message)
self.parent.report_invalid_syntax(message, level)
def __iter__(self):
for element in [self.doc, self.tags, self.setup,
self.template, self.timeout] \
+ self.steps + [self.teardown]:
yield element
class UserKeyword(TestCase):
def __init__(self, parent, name):
self.parent = parent
self.name = name
self.doc = Documentation('[Documentation]', self)
self.args = Arguments('[Arguments]', self)
self.return_ = Return('[Return]', self)
self.timeout = Timeout('[Timeout]', self)
self.teardown = Fixture('[Teardown]', self)
self.steps = []
_setters = {'documentation': lambda s: s.doc.populate,
'document': lambda s: s.doc.populate,
'arguments': lambda s: s.args.populate,
'return': lambda s: s.return_.populate,
'timeout': lambda s: s.timeout.populate,
'teardown': lambda s: s.teardown.populate}
def __iter__(self):
for element in [self.args, self.doc, self.timeout] \
+ self.steps + [self.teardown, self.return_]:
yield element
class ForLoop(_WithSteps):
def __init__(self, content):
self.range, index = self._get_range_and_index(content)
self.vars = content[:index]
self.items = content[index+1:]
self.steps = []
def _get_range_and_index(self, content):
for index, item in enumerate(content):
item = item.upper().replace(' ', '')
if item in ['IN', 'INRANGE']:
return item == 'INRANGE', index
return False, len(content)
def is_comment(self):
return False
def is_for_loop(self):
return True
def apply_template(self, template):
return self
def as_list(self):
return [': FOR'] + self.vars + ['IN RANGE' if self.range else 'IN'] + self.items
def __iter__(self):
return iter(self.steps)
class Step(object):
def __init__(self, content, comment=None):
self.assign = self._get_assigned_vars(content)
try:
self.keyword = content[len(self.assign)]
except IndexError:
self.keyword = None
self.args = content[len(self.assign)+1:]
self.comment = comment
def _get_assigned_vars(self, content):
vars = []
for item in content:
if not is_var(item.rstrip('= ')):
break
vars.append(item)
return vars
def is_comment(self):
return not (self.assign or self.keyword or self.args)
def is_for_loop(self):
return False
def apply_template(self, template):
if self.is_comment():
return self
return Step([template] + self.as_list(include_comment=False))
def is_set(self):
return True
def as_list(self, indent=False, include_comment=True):
kw = [self.keyword] if self.keyword is not None else []
ret = self.assign + kw + self.args
if indent:
ret.insert(0, '')
if include_comment and self.comment:
ret.append('# %s' % self.comment)
return ret
| ajibawa-2023/Python-Code-Large/train/row_99874 | 342 | 575 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Import_L15_C0", "label": "os import os", "type": "import", "loc": [15, 15], "level": 0, "parent": null, "vector": [1, 0, 0.0261, 0.0017, 0, 0.66, 0.0, 688, 0, 1, 0, 0, 688, 0, 0], "semantic": {"name": "os", "arg_names": [], "import_names": ["os"], "rhs_call_name": "", "annotation": ""}, "snippet": "import os"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:ImportFrom_L17_C0", "label": "from robot.errors import DataError", "type": "import", "loc": [17, 17], "level": 0, "parent": null, "vector": [1, 0, 0.0296, 0.0017, 0, 0.66, 0.0385, 299, 0, 1, 0, 0, 299, 0, 0], "semantic": {"name": "robot.errors", "arg_names": [], "import_names": ["DataError"], "rhs_call_name": "", "annotation": ""}, "snippet": "from robot.errors import DataError"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:ImportFrom_L18_C0", "label": "from robot.variables import is_var", "type": "import", "loc": [18, 18], "level": 0, "parent": null, "vector": [1, 0, 0.0313, 0.0017, 0, 0.66, 0.0769, 595, 0, 1, 0, 0, 595, 0, 0], "semantic": {"name": "robot.variables", "arg_names": [], "import_names": ["is_var"], "rhs_call_name": "", "annotation": ""}, "snippet": "from robot.variables import is_var"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:ImportFrom_L19_C0", "label": "from robot.output import LOGGER", "type": "import", "loc": [19, 19], "level": 0, "parent": null, "vector": [1, 0, 0.033, 0.0017, 0, 0.66, 0.1154, 596, 0, 1, 0, 0, 596, 0, 0], "semantic": {"name": "robot.output", "arg_names": [], "import_names": ["LOGGER"], "rhs_call_name": "", "annotation": ""}, "snippet": "from robot.output import LOGGER"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:ImportFrom_L20_C0", "label": "from robot import utils", "type": "import", "loc": [20, 20], "level": 0, "parent": null, "vector": [1, 0, 0.0348, 0.0017, 0, 0.66, 0.1538, 735, 0, 1, 0, 0, 735, 0, 0], "semantic": {"name": "robot", "arg_names": [], "import_names": ["utils"], "rhs_call_name": "", "annotation": ""}, "snippet": "from robot import utils"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:ImportFrom_L22_C0", "label": "from settings import Documentation, Fixture, Timeout\u2026", "type": "import", "loc": [22, 23], "level": 0, "parent": null, "vector": [1, 0, 0.0391, 0.0035, 0, 0.66, 0.1923, 168, 0, 11, 0, 0, 168, 0, 0], "semantic": {"name": "settings", "arg_names": [], "import_names": ["Documentation", "Fixture", "Timeout", "Tags", "Metadata", "Library", "Resource", "Variables", "Arguments", "Return", "Template"], "rhs_call_name": "", "annotation": ""}, "snippet": "from settings import (Documentation, Fixture, Timeout, Tags, Metadata,\n Library, Resource, Variables, Arguments, Return, Template)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:ImportFrom_L24_C0", "label": "from populators import FromFilePopulator, FromDirectoryPopulator", "type": "import", "loc": [24, 24], "level": 0, "parent": null, "vector": [1, 0, 0.0417, 0.0017, 0, 0.66, 0.2308, 612, 0, 2, 0, 0, 612, 0, 0], "semantic": {"name": "populators", "arg_names": [], "import_names": ["FromFilePopulator", "FromDirectoryPopulator"], "rhs_call_name": "", "annotation": ""}, "snippet": "from populators import FromFilePopulator, FromDirectoryPopulator"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L27_C0", "label": "TestData", "type": "function", "loc": [27, 30], "level": 0, "parent": null, "vector": [2, 0, 0.0496, 0.007, 0, 0.66, 0.2692, 621, 0, 4, 1, 0, 0, 0, 3], "semantic": {"name": "TestData", "arg_names": ["parent", "source", "include_suites", "warn_on_skipped"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def TestData(parent=None, source=None, include_suites=[], warn_on_skipped=False):\n if os.path.isdir(source):\n return TestDataDirectory(parent, source, include_suites, warn_on_skipped)\n return TestCaseFile(parent, source)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:If_L28_C4", "label": "if", "type": "if", "loc": [28, 29], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L27_C0", "vector": [4, 1, 0.0496, 0.0035, 1, 0.51, 0.0, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if os.path.isdir(source):\n return TestDataDirectory(parent, source, include_suites, warn_on_skipped)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Return_L29_C8", "label": "return", "type": "return", "loc": [29, 29], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:If_L28_C4", "vector": [13, 2, 0.0504, 0.0017, 2, 0.29, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return TestDataDirectory(parent, source, include_suites, warn_on_skipped)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Return_L30_C4", "label": "return", "type": "return", "loc": [30, 30], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L27_C0", "vector": [13, 1, 0.0522, 0.0017, 1, 0.51, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return TestCaseFile(parent, source)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L33_C0", "label": "_TestData", "type": "class", "loc": [33, 93], "level": 0, "parent": null, "vector": [3, 0, 0.1096, 0.1061, 0, 0.66, 0.3077, 743, 0, 8, 0, 0, 186, 0, 16], "semantic": {"name": "_TestData", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class _TestData(object):\n\n def __init__(self, parent=None, source=None):\n self.parent = parent\n self.source = utils.abspath(source) if source else None\n self.children = []\n self._tables = None\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L35_C4", "label": "__init__", "type": "function", "loc": [35, 39], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L33_C0", "vector": [2, 1, 0.0643, 0.0087, 1, 0.56, 0.0, 555, 0, 3, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": ["self", "parent", "source"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, parent=None, source=None):\n self.parent = parent\n self.source = utils.abspath(source) if source else None\n self.children = []\n self._tables = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L36_C8", "label": "self.parent =", "type": "assigned_variable", "loc": [36, 36], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L35_C4", "vector": [14, 2, 0.0626, 0.0017, 2, 0.22, 0.0, 428, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.parent", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.parent = parent"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L37_C8", "label": "self.source =", "type": "assigned_variable", "loc": [37, 37], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L35_C4", "vector": [14, 2, 0.0643, 0.0017, 2, 0.22, 0.3333, 848, 8, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self.source", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.source = utils.abspath(source) if source else None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L38_C8", "label": "self.children =", "type": "assigned_variable", "loc": [38, 38], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L35_C4", "vector": [14, 2, 0.0661, 0.0017, 2, 0.22, 0.6667, 278, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.children", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.children = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L39_C8", "label": "self._tables =", "type": "assigned_variable", "loc": [39, 39], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L35_C4", "vector": [14, 2, 0.0678, 0.0017, 2, 0.22, 1.0, 567, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self._tables", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._tables = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L41_C4", "label": "_get_tables", "type": "function", "loc": [41, 54], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L33_C0", "vector": [2, 1, 0.0826, 0.0243, 1, 0.56, 0.1429, 861, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "_get_tables", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _get_tables(self):\n if not self._tables:\n self._tables = utils.NormalizedDict({'Setting': self.setting_table,\n 'Settings': self.setting_table,\n 'Metadata': self.setting_table,\n 'Variable': self.variable_table,\n 'Variables': self.variable_table,\n 'Keyword': self.keyword_table,"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:If_L42_C8", "label": "if", "type": "if", "loc": [42, 53], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L41_C4", "vector": [4, 2, 0.0826, 0.0209, 2, 0.77, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not self._tables:\n self._tables = utils.NormalizedDict({'Setting': self.setting_table,\n 'Settings': self.setting_table,\n 'Metadata': self.setting_table,\n 'Variable': self.variable_table,\n 'Variables': self.variable_table,\n 'Keyword': self.keyword_table,\n 'Keywords': self.keyword_table,"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L43_C12", "label": "self._tables = NormalizedDict()", "type": "assigned_variable", "loc": [43, 53], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:If_L42_C8", "vector": [14, 3, 0.0835, 0.0191, 3, 0.99, 0.0, 567, 3, 1, 0, 0, 696, 10, 1], "semantic": {"name": "self._tables", "arg_names": [], "import_names": [], "rhs_call_name": "NormalizedDict", "annotation": ""}, "snippet": " self._tables = utils.NormalizedDict({'Setting': self.setting_table,\n 'Settings': self.setting_table,\n 'Metadata': self.setting_table,\n 'Variable': self.variable_table,\n 'Variables': self.variable_table,\n 'Keyword': self.keyword_table,\n 'Keywords': self.keyword_table,\n 'User Keyword': self.keyword_table,"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Return_L54_C8", "label": "return", "type": "return", "loc": [54, 54], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L41_C4", "vector": [13, 2, 0.0939, 0.0017, 2, 0.77, 1.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._tables"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L56_C4", "label": "start_table", "type": "function", "loc": [56, 65], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L33_C0", "vector": [2, 1, 0.1052, 0.0174, 1, 0.56, 0.2857, 157, 0, 2, 1, 0, 0, 0, 3], "semantic": {"name": "start_table", "arg_names": ["self", "header_row"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def start_table(self, header_row):\n table_name = header_row[0]\n try:\n table = self._valid_table(self._get_tables()[table_name])\n except KeyError:\n return None\n else:\n if table is not None:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L57_C8", "label": "table_name =", "type": "assigned_variable", "loc": [57, 57], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L56_C4", "vector": [14, 2, 0.0991, 0.0017, 2, 0.18, 0.0, 894, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "table_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " table_name = header_row[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Try_L58_C8", "label": "try", "type": "try", "loc": [58, 65], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L56_C4", "vector": [7, 2, 0.107, 0.0139, 2, 0.18, 1.0, 0, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n table = self._valid_table(self._get_tables()[table_name])\n except KeyError:\n return None\n else:\n if table is not None:\n table.set_header(header_row)\n return table"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L59_C12", "label": "table = _valid_table()", "type": "assigned_variable", "loc": [59, 59], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:Try_L58_C8", "vector": [14, 3, 0.1026, 0.0017, 3, 0.47, 0.0, 338, 3, 1, 0, 0, 199, 10, 2], "semantic": {"name": "table", "arg_names": [], "import_names": [], "rhs_call_name": "_valid_table", "annotation": ""}, "snippet": " table = self._valid_table(self._get_tables()[table_name])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Return_L61_C12", "label": "return", "type": "return", "loc": [61, 61], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:Try_L58_C8", "vector": [13, 3, 0.1061, 0.0017, 3, 0.47, 0.0, 0, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:If_L63_C12", "label": "if", "type": "if", "loc": [63, 64], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:Try_L58_C8", "vector": [4, 3, 0.1104, 0.0035, 3, 0.47, 0.5, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if table is not None:\n table.set_header(header_row)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Expr_L64_C16", "label": "set_header()", "type": "expression", "loc": [64, 64], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:If_L63_C12", "vector": [8, 4, 0.1113, 0.0017, 4, 0.53, 0.0, 374, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_header", "arg_names": [], "import_names": [], "rhs_call_name": "set_header", "annotation": ""}, "snippet": " table.set_header(header_row)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Return_L65_C12", "label": "return", "type": "return", "loc": [65, 65], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:Try_L58_C8", "vector": [13, 3, 0.113, 0.0017, 3, 0.47, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return table"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L68_C4", "label": "name", "type": "function", "loc": [68, 76], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L33_C0", "vector": [2, 1, 0.1252, 0.0157, 1, 0.56, 0.4286, 57, 0, 1, 1, 0, 0, 0, 6], "semantic": {"name": "name", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def name(self):\n if not self.source:\n return None\n name = self._get_basename()\n name = name.split('__', 1)[-1] # Strip possible prefix\n name = name.replace('_', ' ').strip()\n if name.islower():\n name = name.title()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:If_L69_C8", "label": "if", "type": "if", "loc": [69, 70], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L68_C4", "vector": [4, 2, 0.1209, 0.0035, 2, 0.87, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not self.source:\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Return_L70_C12", "label": "return", "type": "return", "loc": [70, 70], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:If_L69_C8", "vector": [13, 3, 0.1217, 0.0017, 3, 0.98, 0.0, 0, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L71_C8", "label": "name = _get_basename()", "type": "assigned_variable", "loc": [71, 71], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L68_C4", "vector": [14, 2, 0.1235, 0.0017, 2, 0.87, 0.2, 57, 3, 0, 0, 0, 309, 10, 1], "semantic": {"name": "name", "arg_names": [], "import_names": [], "rhs_call_name": "_get_basename", "annotation": ""}, "snippet": " name = self._get_basename()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L72_C8", "label": "name =", "type": "assigned_variable", "loc": [72, 72], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L68_C4", "vector": [14, 2, 0.1252, 0.0017, 2, 0.87, 0.4, 57, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " name = name.split('__', 1)[-1] # Strip possible prefix"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L73_C8", "label": "name = strip()", "type": "assigned_variable", "loc": [73, 73], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L68_C4", "vector": [14, 2, 0.127, 0.0017, 2, 0.87, 0.6, 57, 3, 0, 0, 0, 973, 10, 2], "semantic": {"name": "name", "arg_names": [], "import_names": [], "rhs_call_name": "strip", "annotation": ""}, "snippet": " name = name.replace('_', ' ').strip()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:If_L74_C8", "label": "if", "type": "if", "loc": [74, 75], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L68_C4", "vector": [4, 2, 0.1296, 0.0035, 2, 0.87, 0.8, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if name.islower():\n name = name.title()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L75_C12", "label": "name = title()", "type": "assigned_variable", "loc": [75, 75], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:If_L74_C8", "vector": [14, 3, 0.1304, 0.0017, 3, 0.02, 0.0, 57, 3, 0, 0, 0, 48, 10, 1], "semantic": {"name": "name", "arg_names": [], "import_names": [], "rhs_call_name": "title", "annotation": ""}, "snippet": " name = name.title()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Return_L76_C8", "label": "return", "type": "return", "loc": [76, 76], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L68_C4", "vector": [13, 2, 0.1322, 0.0017, 2, 0.87, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L78_C4", "label": "_get_basename", "type": "function", "loc": [78, 79], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L33_C0", "vector": [2, 1, 0.1365, 0.0035, 1, 0.56, 0.5714, 309, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "_get_basename", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _get_basename(self):\n return os.path.splitext(os.path.basename(self.source))[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Return_L79_C8", "label": "return", "type": "return", "loc": [79, 79], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L78_C4", "vector": [13, 2, 0.1374, 0.0017, 2, 0.15, 0.0, 0, 6, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return os.path.splitext(os.path.basename(self.source))[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L82_C4", "label": "keywords", "type": "function", "loc": [82, 83], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L33_C0", "vector": [2, 1, 0.1435, 0.0035, 1, 0.56, 0.7143, 211, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "keywords", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def keywords(self):\n return self.keyword_table.keywords"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Return_L83_C8", "label": "return", "type": "return", "loc": [83, 83], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L82_C4", "vector": [13, 2, 0.1443, 0.0017, 2, 0.99, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.keyword_table.keywords"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L86_C4", "label": "imports", "type": "function", "loc": [86, 87], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L33_C0", "vector": [2, 1, 0.1504, 0.0035, 1, 0.56, 0.8571, 117, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "imports", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def imports(self):\n return self.setting_table.imports"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Return_L87_C8", "label": "return", "type": "return", "loc": [87, 87], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L86_C4", "vector": [13, 2, 0.1513, 0.0017, 2, 0.73, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.setting_table.imports"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L89_C4", "label": "report_invalid_syntax", "type": "function", "loc": [89, 93], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L33_C0", "vector": [2, 1, 0.1583, 0.0087, 1, 0.56, 1.0, 782, 0, 4, 0, 0, 0, 0, 3], "semantic": {"name": "report_invalid_syntax", "arg_names": ["self", "table", "message", "level"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def report_invalid_syntax(self, table, message, level='ERROR'):\n initfile = getattr(self, 'initfile', None)\n path = os.path.join(self.source, initfile) if initfile else self.source\n LOGGER.write(\"Invalid syntax in file '%s' in table '%s': %s\"\n % (path, table, message), level)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L90_C8", "label": "initfile = getattr()", "type": "assigned_variable", "loc": [90, 90], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L89_C4", "vector": [14, 2, 0.1565, 0.0017, 2, 0.25, 0.0, 638, 3, 3, 0, 0, 121, 10, 1], "semantic": {"name": "initfile", "arg_names": [], "import_names": [], "rhs_call_name": "getattr", "annotation": ""}, "snippet": " initfile = getattr(self, 'initfile', None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L91_C8", "label": "path =", "type": "assigned_variable", "loc": [91, 91], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L89_C4", "vector": [14, 2, 0.1583, 0.0017, 2, 0.25, 0.5, 358, 8, 0, 0, 0, 0, 0, 1], "semantic": {"name": "path", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " path = os.path.join(self.source, initfile) if initfile else self.source"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Expr_L92_C8", "label": "write()", "type": "expression", "loc": [92, 93], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L89_C4", "vector": [8, 2, 0.1609, 0.0035, 2, 0.25, 1.0, 837, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " LOGGER.write(\"Invalid syntax in file '%s' in table '%s': %s\"\n % (path, table, message), level)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L96_C0", "label": "TestCaseFile", "type": "class", "loc": [96, 122], "level": 0, "parent": null, "vector": [3, 0, 0.1896, 0.047, 0, 0.66, 0.3462, 714, 0, 5, 0, 0, 743, 0, 11], "semantic": {"name": "TestCaseFile", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class TestCaseFile(_TestData):\n\n def __init__(self, parent=None, source=None):\n _TestData.__init__(self, parent, source)\n self.directory = os.path.dirname(self.source) if self.source else None\n self.setting_table = TestCaseFileSettingTable(self)\n self.variable_table = VariableTable(self)\n self.testcase_table = TestCaseTable(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L98_C4", "label": "__init__", "type": "function", "loc": [98, 107], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L96_C0", "vector": [2, 1, 0.1783, 0.0174, 1, 0.54, 0.0, 555, 0, 3, 0, 0, 0, 0, 9], "semantic": {"name": "__init__", "arg_names": ["self", "parent", "source"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, parent=None, source=None):\n _TestData.__init__(self, parent, source)\n self.directory = os.path.dirname(self.source) if self.source else None\n self.setting_table = TestCaseFileSettingTable(self)\n self.variable_table = VariableTable(self)\n self.testcase_table = TestCaseTable(self)\n self.keyword_table = KeywordTable(self)\n if source: # FIXME: model should be decoupled from populating"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Expr_L99_C8", "label": "__init__()", "type": "expression", "loc": [99, 99], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L98_C4", "vector": [8, 2, 0.1722, 0.0017, 2, 0.92, 0.0, 555, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " _TestData.__init__(self, parent, source)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L100_C8", "label": "self.directory =", "type": "assigned_variable", "loc": [100, 100], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L98_C4", "vector": [14, 2, 0.1739, 0.0017, 2, 0.92, 0.1667, 652, 8, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self.directory", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.directory = os.path.dirname(self.source) if self.source else None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L101_C8", "label": "self.setting_table = TestCaseFileSettingTable()", "type": "assigned_variable", "loc": [101, 101], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L98_C4", "vector": [14, 2, 0.1757, 0.0017, 2, 0.92, 0.3333, 280, 3, 1, 0, 0, 716, 10, 1], "semantic": {"name": "self.setting_table", "arg_names": [], "import_names": [], "rhs_call_name": "TestCaseFileSettingTable", "annotation": ""}, "snippet": " self.setting_table = TestCaseFileSettingTable(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L102_C8", "label": "self.variable_table = VariableTable()", "type": "assigned_variable", "loc": [102, 102], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L98_C4", "vector": [14, 2, 0.1774, 0.0017, 2, 0.92, 0.5, 499, 3, 1, 0, 0, 749, 10, 1], "semantic": {"name": "self.variable_table", "arg_names": [], "import_names": [], "rhs_call_name": "VariableTable", "annotation": ""}, "snippet": " self.variable_table = VariableTable(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L103_C8", "label": "self.testcase_table = TestCaseTable()", "type": "assigned_variable", "loc": [103, 103], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L98_C4", "vector": [14, 2, 0.1791, 0.0017, 2, 0.92, 0.6667, 877, 3, 1, 0, 0, 784, 10, 1], "semantic": {"name": "self.testcase_table", "arg_names": [], "import_names": [], "rhs_call_name": "TestCaseTable", "annotation": ""}, "snippet": " self.testcase_table = TestCaseTable(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L104_C8", "label": "self.keyword_table = KeywordTable()", "type": "assigned_variable", "loc": [104, 104], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L98_C4", "vector": [14, 2, 0.1809, 0.0017, 2, 0.92, 0.8333, 189, 3, 1, 0, 0, 716, 10, 1], "semantic": {"name": "self.keyword_table", "arg_names": [], "import_names": [], "rhs_call_name": "KeywordTable", "annotation": ""}, "snippet": " self.keyword_table = KeywordTable(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:If_L105_C8", "label": "if", "type": "if", "loc": [105, 107], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L98_C4", "vector": [4, 2, 0.1843, 0.0052, 2, 0.92, 1.0, 0, 2, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if source: # FIXME: model should be decoupled from populating\n FromFilePopulator(self).populate(source)\n self._validate()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Expr_L106_C12", "label": "populate()", "type": "expression", "loc": [106, 106], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:If_L105_C8", "vector": [8, 3, 0.1843, 0.0017, 3, 0.5, 0.0, 265, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "populate", "arg_names": [], "import_names": [], "rhs_call_name": "populate", "annotation": ""}, "snippet": " FromFilePopulator(self).populate(source)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Expr_L107_C12", "label": "_validate()", "type": "expression", "loc": [107, 107], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:If_L105_C8", "vector": [8, 3, 0.1861, 0.0017, 3, 0.5, 1.0, 939, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_validate", "arg_names": [], "import_names": [], "rhs_call_name": "_validate", "annotation": ""}, "snippet": " self._validate()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L109_C4", "label": "_validate", "type": "function", "loc": [109, 111], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L96_C0", "vector": [2, 1, 0.1913, 0.0052, 1, 0.54, 0.25, 939, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "_validate", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _validate(self):\n if not self.testcase_table.is_started():\n raise DataError('File has no test case table.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:If_L110_C8", "label": "if", "type": "if", "loc": [110, 111], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L109_C4", "vector": [4, 2, 0.1922, 0.0035, 2, 0.27, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not self.testcase_table.is_started():\n raise DataError('File has no test case table.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L113_C4", "label": "_valid_table", "type": "function", "loc": [113, 114], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L96_C0", "vector": [2, 1, 0.1974, 0.0035, 1, 0.54, 0.5, 199, 0, 2, 1, 0, 0, 0, 0], "semantic": {"name": "_valid_table", "arg_names": ["self", "table"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _valid_table(self, table):\n return table"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Return_L114_C8", "label": "return", "type": "return", "loc": [114, 114], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L113_C4", "vector": [13, 2, 0.1983, 0.0017, 2, 0.85, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return table"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L116_C4", "label": "has_tests", "type": "function", "loc": [116, 117], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L96_C0", "vector": [2, 1, 0.2026, 0.0035, 1, 0.54, 0.75, 618, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "has_tests", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def has_tests(self):\n return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Return_L117_C8", "label": "return", "type": "return", "loc": [117, 117], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L116_C4", "vector": [13, 2, 0.2035, 0.0017, 2, 0.44, 0.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L119_C4", "label": "__iter__", "type": "function", "loc": [119, 122], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L96_C0", "vector": [2, 1, 0.2096, 0.007, 1, 0.54, 1.0, 891, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "__iter__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __iter__(self):\n for table in [self.setting_table, self.variable_table,\n self.testcase_table, self.keyword_table]:\n yield table"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:For_L120_C8", "label": "for table", "type": "for", "loc": [120, 122], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L119_C4", "vector": [6, 2, 0.2104, 0.0052, 2, 0.77, 0.0, 338, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "table", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for table in [self.setting_table, self.variable_table,\n self.testcase_table, self.keyword_table]:\n yield table"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Expr_L122_C12", "label": "expression", "type": "expression", "loc": [122, 122], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:For_L120_C8", "vector": [8, 3, 0.2122, 0.0017, 3, 0.82, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " yield table"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L125_C0", "label": "ResourceFile", "type": "class", "loc": [125, 154], "level": 0, "parent": null, "vector": [3, 0, 0.2426, 0.0522, 0, 0.66, 0.3846, 764, 0, 4, 0, 0, 743, 0, 13], "semantic": {"name": "ResourceFile", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class ResourceFile(_TestData):\n\n def __init__(self, source=None):\n _TestData.__init__(self, source=source)\n self.directory = os.path.dirname(self.source) if self.source else None\n self.setting_table = ResourceFileSettingTable(self)\n self.variable_table = VariableTable(self)\n self.testcase_table = TestCaseTable(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L127_C4", "label": "__init__", "type": "function", "loc": [127, 136], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L125_C0", "vector": [2, 1, 0.2287, 0.0174, 1, 0.58, 0.0, 555, 0, 2, 0, 0, 0, 0, 9], "semantic": {"name": "__init__", "arg_names": ["self", "source"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, source=None):\n _TestData.__init__(self, source=source)\n self.directory = os.path.dirname(self.source) if self.source else None\n self.setting_table = ResourceFileSettingTable(self)\n self.variable_table = VariableTable(self)\n self.testcase_table = TestCaseTable(self)\n self.keyword_table = KeywordTable(self)\n if self.source:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Expr_L128_C8", "label": "__init__()", "type": "expression", "loc": [128, 128], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L127_C4", "vector": [8, 2, 0.2226, 0.0017, 2, 0.08, 0.0, 555, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " _TestData.__init__(self, source=source)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L129_C8", "label": "self.directory =", "type": "assigned_variable", "loc": [129, 129], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L127_C4", "vector": [14, 2, 0.2243, 0.0017, 2, 0.08, 0.1667, 652, 8, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self.directory", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.directory = os.path.dirname(self.source) if self.source else None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L130_C8", "label": "self.setting_table = ResourceFileSettingTable()", "type": "assigned_variable", "loc": [130, 130], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L127_C4", "vector": [14, 2, 0.2261, 0.0017, 2, 0.08, 0.3333, 280, 3, 1, 0, 0, 31, 10, 1], "semantic": {"name": "self.setting_table", "arg_names": [], "import_names": [], "rhs_call_name": "ResourceFileSettingTable", "annotation": ""}, "snippet": " self.setting_table = ResourceFileSettingTable(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L131_C8", "label": "self.variable_table = VariableTable()", "type": "assigned_variable", "loc": [131, 131], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L127_C4", "vector": [14, 2, 0.2278, 0.0017, 2, 0.08, 0.5, 499, 3, 1, 0, 0, 749, 10, 1], "semantic": {"name": "self.variable_table", "arg_names": [], "import_names": [], "rhs_call_name": "VariableTable", "annotation": ""}, "snippet": " self.variable_table = VariableTable(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L132_C8", "label": "self.testcase_table = TestCaseTable()", "type": "assigned_variable", "loc": [132, 132], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L127_C4", "vector": [14, 2, 0.2296, 0.0017, 2, 0.08, 0.6667, 877, 3, 1, 0, 0, 784, 10, 1], "semantic": {"name": "self.testcase_table", "arg_names": [], "import_names": [], "rhs_call_name": "TestCaseTable", "annotation": ""}, "snippet": " self.testcase_table = TestCaseTable(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L133_C8", "label": "self.keyword_table = KeywordTable()", "type": "assigned_variable", "loc": [133, 133], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L127_C4", "vector": [14, 2, 0.2313, 0.0017, 2, 0.08, 0.8333, 189, 3, 1, 0, 0, 716, 10, 1], "semantic": {"name": "self.keyword_table", "arg_names": [], "import_names": [], "rhs_call_name": "KeywordTable", "annotation": ""}, "snippet": " self.keyword_table = KeywordTable(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:If_L134_C8", "label": "if", "type": "if", "loc": [134, 136], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L127_C4", "vector": [4, 2, 0.2348, 0.0052, 2, 0.08, 1.0, 0, 7, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.source:\n FromFilePopulator(self).populate(source)\n self._report_status()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Expr_L135_C12", "label": "populate()", "type": "expression", "loc": [135, 135], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:If_L134_C8", "vector": [8, 3, 0.2348, 0.0017, 3, 0.39, 0.0, 265, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "populate", "arg_names": [], "import_names": [], "rhs_call_name": "populate", "annotation": ""}, "snippet": " FromFilePopulator(self).populate(source)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Expr_L136_C12", "label": "_report_status()", "type": "expression", "loc": [136, 136], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:If_L134_C8", "vector": [8, 3, 0.2365, 0.0017, 3, 0.39, 1.0, 12, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_report_status", "arg_names": [], "import_names": [], "rhs_call_name": "_report_status", "annotation": ""}, "snippet": " self._report_status()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L138_C4", "label": "_report_status", "type": "function", "loc": [138, 143], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L125_C0", "vector": [2, 1, 0.2443, 0.0104, 1, 0.58, 0.3333, 12, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "_report_status", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _report_status(self):\n if self.setting_table or self.variable_table or self.keyword_table:\n LOGGER.info(\"Imported resource file '%s' (%d keywords).\"\n % (self.source, len(self.keyword_table.keywords)))\n else:\n LOGGER.warn(\"Imported resource file '%s' is empty.\" % self.source)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:If_L139_C8", "label": "if", "type": "if", "loc": [139, 143], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L138_C4", "vector": [4, 2, 0.2452, 0.0087, 2, 0.82, 0.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.setting_table or self.variable_table or self.keyword_table:\n LOGGER.info(\"Imported resource file '%s' (%d keywords).\"\n % (self.source, len(self.keyword_table.keywords)))\n else:\n LOGGER.warn(\"Imported resource file '%s' is empty.\" % self.source)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Expr_L140_C12", "label": "info()", "type": "expression", "loc": [140, 141], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:If_L139_C8", "vector": [8, 3, 0.2443, 0.0035, 3, 0.21, 0.0, 730, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "info", "arg_names": [], "import_names": [], "rhs_call_name": "info", "annotation": ""}, "snippet": " LOGGER.info(\"Imported resource file '%s' (%d keywords).\"\n % (self.source, len(self.keyword_table.keywords)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Expr_L143_C12", "label": "warn()", "type": "expression", "loc": [143, 143], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:If_L139_C8", "vector": [8, 3, 0.2487, 0.0017, 3, 0.21, 1.0, 960, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "warn", "arg_names": [], "import_names": [], "rhs_call_name": "warn", "annotation": ""}, "snippet": " LOGGER.warn(\"Imported resource file '%s' is empty.\" % self.source)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L145_C4", "label": "_valid_table", "type": "function", "loc": [145, 149], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L125_C0", "vector": [2, 1, 0.2557, 0.0087, 1, 0.58, 0.6667, 199, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "_valid_table", "arg_names": ["self", "table"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _valid_table(self, table):\n if table is self.testcase_table:\n raise DataError(\"Resource file '%s' contains a test case table \"\n \"which is not allowed.\" % self.source)\n return table"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:If_L146_C8", "label": "if", "type": "if", "loc": [146, 148], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L145_C4", "vector": [4, 2, 0.2557, 0.0052, 2, 0.4, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if table is self.testcase_table:\n raise DataError(\"Resource file '%s' contains a test case table \"\n \"which is not allowed.\" % self.source)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Return_L149_C8", "label": "return", "type": "return", "loc": [149, 149], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L145_C4", "vector": [13, 2, 0.2591, 0.0017, 2, 0.4, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return table"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L151_C4", "label": "__iter__", "type": "function", "loc": [151, 154], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L125_C0", "vector": [2, 1, 0.2652, 0.007, 1, 0.58, 1.0, 891, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "__iter__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __iter__(self):\n for table in [self.setting_table, self.variable_table,\n self.keyword_table]:\n yield table"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:For_L152_C8", "label": "for table", "type": "for", "loc": [152, 154], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L151_C4", "vector": [6, 2, 0.2661, 0.0052, 2, 0.72, 0.0, 338, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "table", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for table in [self.setting_table, self.variable_table,\n self.keyword_table]:\n yield table"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Expr_L154_C12", "label": "expression", "type": "expression", "loc": [154, 154], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:For_L152_C8", "vector": [8, 3, 0.2678, 0.0017, 3, 0.54, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " yield table"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L157_C0", "label": "TestDataDirectory", "type": "class", "loc": [157, 191], "level": 0, "parent": null, "vector": [3, 0, 0.3026, 0.0609, 0, 0.66, 0.4231, 825, 0, 6, 0, 0, 743, 0, 14], "semantic": {"name": "TestDataDirectory", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class TestDataDirectory(_TestData):\n\n def __init__(self, parent=None, source=None, include_suites=[], warn_on_skipped=False):\n _TestData.__init__(self, parent, source)\n self.directory = self.source\n self.initfile = None\n self.setting_table = InitFileSettingTable(self)\n self.variable_table = VariableTable(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L159_C4", "label": "__init__", "type": "function", "loc": [159, 169], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L157_C0", "vector": [2, 1, 0.2852, 0.0191, 1, 0.67, 0.0, 555, 0, 5, 0, 0, 0, 0, 8], "semantic": {"name": "__init__", "arg_names": ["self", "parent", "source", "include_suites", "warn_on_skipped"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, parent=None, source=None, include_suites=[], warn_on_skipped=False):\n _TestData.__init__(self, parent, source)\n self.directory = self.source\n self.initfile = None\n self.setting_table = InitFileSettingTable(self)\n self.variable_table = VariableTable(self)\n self.testcase_table = TestCaseTable(self)\n self.keyword_table = KeywordTable(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Expr_L160_C8", "label": "__init__()", "type": "expression", "loc": [160, 160], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L159_C4", "vector": [8, 2, 0.2783, 0.0017, 2, 0.84, 0.0, 555, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " _TestData.__init__(self, parent, source)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L161_C8", "label": "self.directory =", "type": "assigned_variable", "loc": [161, 161], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L159_C4", "vector": [14, 2, 0.28, 0.0017, 2, 0.84, 0.1429, 652, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.directory", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.directory = self.source"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L162_C8", "label": "self.initfile =", "type": "assigned_variable", "loc": [162, 162], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L159_C4", "vector": [14, 2, 0.2817, 0.0017, 2, 0.84, 0.2857, 137, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.initfile", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.initfile = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L163_C8", "label": "self.setting_table = InitFileSettingTable()", "type": "assigned_variable", "loc": [163, 163], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L159_C4", "vector": [14, 2, 0.2835, 0.0017, 2, 0.84, 0.4286, 280, 3, 1, 0, 0, 141, 10, 1], "semantic": {"name": "self.setting_table", "arg_names": [], "import_names": [], "rhs_call_name": "InitFileSettingTable", "annotation": ""}, "snippet": " self.setting_table = InitFileSettingTable(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L164_C8", "label": "self.variable_table = VariableTable()", "type": "assigned_variable", "loc": [164, 164], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L159_C4", "vector": [14, 2, 0.2852, 0.0017, 2, 0.84, 0.5714, 499, 3, 1, 0, 0, 749, 10, 1], "semantic": {"name": "self.variable_table", "arg_names": [], "import_names": [], "rhs_call_name": "VariableTable", "annotation": ""}, "snippet": " self.variable_table = VariableTable(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L165_C8", "label": "self.testcase_table = TestCaseTable()", "type": "assigned_variable", "loc": [165, 165], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L159_C4", "vector": [14, 2, 0.287, 0.0017, 2, 0.84, 0.7143, 877, 3, 1, 0, 0, 784, 10, 1], "semantic": {"name": "self.testcase_table", "arg_names": [], "import_names": [], "rhs_call_name": "TestCaseTable", "annotation": ""}, "snippet": " self.testcase_table = TestCaseTable(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L166_C8", "label": "self.keyword_table = KeywordTable()", "type": "assigned_variable", "loc": [166, 166], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L159_C4", "vector": [14, 2, 0.2887, 0.0017, 2, 0.84, 0.8571, 189, 3, 1, 0, 0, 716, 10, 1], "semantic": {"name": "self.keyword_table", "arg_names": [], "import_names": [], "rhs_call_name": "KeywordTable", "annotation": ""}, "snippet": " self.keyword_table = KeywordTable(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:If_L167_C8", "label": "if", "type": "if", "loc": [167, 169], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L159_C4", "vector": [4, 2, 0.2922, 0.0052, 2, 0.84, 1.0, 0, 7, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.source:\n FromDirectoryPopulator().populate(self.source, self, include_suites, warn_on_skipped)\n self.children = [ ch for ch in self.children if ch.has_tests() ]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Expr_L168_C12", "label": "populate()", "type": "expression", "loc": [168, 168], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:If_L167_C8", "vector": [8, 3, 0.2922, 0.0017, 3, 0.68, 0.0, 265, 3, 4, 0, 0, 0, 0, 2], "semantic": {"name": "populate", "arg_names": [], "import_names": [], "rhs_call_name": "populate", "annotation": ""}, "snippet": " FromDirectoryPopulator().populate(self.source, self, include_suites, warn_on_skipped)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L169_C12", "label": "self.children =", "type": "assigned_variable", "loc": [169, 169], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:If_L167_C8", "vector": [14, 3, 0.2939, 0.0017, 3, 0.68, 1.0, 278, 5, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self.children", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.children = [ ch for ch in self.children if ch.has_tests() ]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L171_C4", "label": "_get_basename", "type": "function", "loc": [171, 172], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L157_C0", "vector": [2, 1, 0.2983, 0.0035, 1, 0.67, 0.2, 309, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "_get_basename", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _get_basename(self):\n return os.path.basename(self.source)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Return_L172_C8", "label": "return", "type": "return", "loc": [172, 172], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L171_C4", "vector": [13, 2, 0.2991, 0.0017, 2, 0.61, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return os.path.basename(self.source)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L174_C4", "label": "_valid_table", "type": "function", "loc": [174, 179], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L157_C0", "vector": [2, 1, 0.307, 0.0104, 1, 0.67, 0.4, 199, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "_valid_table", "arg_names": ["self", "table"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _valid_table(self, table):\n if table is self.testcase_table:\n LOGGER.error(\"Test suite init file in '%s' contains a test case \"\n \"table which is not allowed.\" % self.source)\n return None\n return table"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:If_L175_C8", "label": "if", "type": "if", "loc": [175, 178], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L174_C4", "vector": [4, 2, 0.307, 0.007, 2, 0.46, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if table is self.testcase_table:\n LOGGER.error(\"Test suite init file in '%s' contains a test case \"\n \"table which is not allowed.\" % self.source)\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Expr_L176_C12", "label": "error()", "type": "expression", "loc": [176, 177], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:If_L175_C8", "vector": [8, 3, 0.307, 0.0035, 3, 0.58, 0.0, 771, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "error", "arg_names": [], "import_names": [], "rhs_call_name": "error", "annotation": ""}, "snippet": " LOGGER.error(\"Test suite init file in '%s' contains a test case \"\n \"table which is not allowed.\" % self.source)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Return_L178_C12", "label": "return", "type": "return", "loc": [178, 178], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:If_L175_C8", "vector": [13, 3, 0.3096, 0.0017, 3, 0.58, 1.0, 0, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Return_L179_C8", "label": "return", "type": "return", "loc": [179, 179], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L174_C4", "vector": [13, 2, 0.3113, 0.0017, 2, 0.46, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return table"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L181_C4", "label": "add_child", "type": "function", "loc": [181, 183], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L157_C0", "vector": [2, 1, 0.3165, 0.0052, 1, 0.67, 0.6, 279, 0, 3, 0, 0, 0, 0, 2], "semantic": {"name": "add_child", "arg_names": ["self", "path", "include_suites"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def add_child(self, path, include_suites):\n self.children.append(TestData(parent=self,source=path,\n include_suites=include_suites))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Expr_L182_C8", "label": "append()", "type": "expression", "loc": [182, 183], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L181_C4", "vector": [8, 2, 0.3174, 0.0035, 2, 0.46, 0.0, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.children.append(TestData(parent=self,source=path,\n include_suites=include_suites))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L185_C4", "label": "has_tests", "type": "function", "loc": [185, 186], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L157_C0", "vector": [2, 1, 0.3226, 0.0035, 1, 0.67, 0.8, 618, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "has_tests", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def has_tests(self):\n return any(ch.has_tests() for ch in self.children)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Return_L186_C8", "label": "return", "type": "return", "loc": [186, 186], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L185_C4", "vector": [13, 2, 0.3235, 0.0017, 2, 0.96, 0.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return any(ch.has_tests() for ch in self.children)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L188_C4", "label": "__iter__", "type": "function", "loc": [188, 191], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L157_C0", "vector": [2, 1, 0.3296, 0.007, 1, 0.67, 1.0, 891, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "__iter__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __iter__(self):\n for table in [self.setting_table, self.variable_table,\n self.keyword_table]:\n yield table"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:For_L189_C8", "label": "for table", "type": "for", "loc": [189, 191], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L188_C4", "vector": [6, 2, 0.3304, 0.0052, 2, 0.43, 0.0, 338, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "table", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for table in [self.setting_table, self.variable_table,\n self.keyword_table]:\n yield table"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Expr_L191_C12", "label": "expression", "type": "expression", "loc": [191, 191], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:For_L189_C8", "vector": [8, 3, 0.3322, 0.0017, 3, 0.88, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " yield table"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L194_C0", "label": "_Table", "type": "class", "loc": [194, 216], "level": 0, "parent": null, "vector": [3, 0, 0.3565, 0.04, 0, 0.66, 0.4615, 969, 0, 6, 0, 0, 186, 0, 1], "semantic": {"name": "_Table", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class _Table(object):\n\n def __init__(self, parent):\n self.parent = parent\n self.header = None\n\n def set_header(self, header):\n self.header = header"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L196_C4", "label": "__init__", "type": "function", "loc": [196, 198], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L194_C0", "vector": [2, 1, 0.3426, 0.0052, 1, 0.84, 0.0, 555, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "parent"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, parent):\n self.parent = parent\n self.header = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L197_C8", "label": "self.parent =", "type": "assigned_variable", "loc": [197, 197], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L196_C4", "vector": [14, 2, 0.3426, 0.0017, 2, 0.14, 0.0, 428, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.parent", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.parent = parent"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L198_C8", "label": "self.header =", "type": "assigned_variable", "loc": [198, 198], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L196_C4", "vector": [14, 2, 0.3443, 0.0017, 2, 0.14, 1.0, 208, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.header", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.header = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L200_C4", "label": "set_header", "type": "function", "loc": [200, 201], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L194_C0", "vector": [2, 1, 0.3487, 0.0035, 1, 0.84, 0.2, 374, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "set_header", "arg_names": ["self", "header"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def set_header(self, header):\n self.header = header"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L201_C8", "label": "self.header =", "type": "assigned_variable", "loc": [201, 201], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L200_C4", "vector": [14, 2, 0.3496, 0.0017, 2, 0.84, 0.0, 208, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.header", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.header = header"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L204_C4", "label": "name", "type": "function", "loc": [204, 205], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L194_C0", "vector": [2, 1, 0.3557, 0.0035, 1, 0.84, 0.4, 57, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "name", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def name(self):\n return self.header[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Return_L205_C8", "label": "return", "type": "return", "loc": [205, 205], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L204_C4", "vector": [13, 2, 0.3565, 0.0017, 2, 0.34, 0.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.header[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L208_C4", "label": "source", "type": "function", "loc": [208, 209], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L194_C0", "vector": [2, 1, 0.3626, 0.0035, 1, 0.84, 0.6, 703, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "source", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def source(self):\n return self.parent.source"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Return_L209_C8", "label": "return", "type": "return", "loc": [209, 209], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L208_C4", "vector": [13, 2, 0.3635, 0.0017, 2, 0.93, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.parent.source"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L212_C4", "label": "directory", "type": "function", "loc": [212, 213], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L194_C0", "vector": [2, 1, 0.3696, 0.0035, 1, 0.84, 0.8, 229, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "directory", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def directory(self):\n return self.parent.directory"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Return_L213_C8", "label": "return", "type": "return", "loc": [213, 213], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L212_C4", "vector": [13, 2, 0.3704, 0.0017, 2, 0.2, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.parent.directory"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L215_C4", "label": "report_invalid_syntax", "type": "function", "loc": [215, 216], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L194_C0", "vector": [2, 1, 0.3748, 0.0035, 1, 0.84, 1.0, 782, 0, 3, 0, 0, 0, 0, 1], "semantic": {"name": "report_invalid_syntax", "arg_names": ["self", "message", "level"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def report_invalid_syntax(self, message, level='ERROR'):\n self.parent.report_invalid_syntax(self.name, message, level)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Expr_L216_C8", "label": "report_invalid_syntax()", "type": "expression", "loc": [216, 216], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L215_C4", "vector": [8, 2, 0.3757, 0.0017, 2, 0.35, 0.0, 782, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "report_invalid_syntax", "arg_names": [], "import_names": [], "rhs_call_name": "report_invalid_syntax", "annotation": ""}, "snippet": " self.parent.report_invalid_syntax(self.name, message, level)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L219_C0", "label": "_WithSettings", "type": "class", "loc": [219, 232], "level": 0, "parent": null, "vector": [3, 0, 0.3922, 0.0243, 0, 0.66, 0.5, 189, 0, 3, 0, 0, 186, 0, 5], "semantic": {"name": "_WithSettings", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class _WithSettings(object):\n\n def get_setter(self, setting_name):\n normalized = self.normalize(setting_name)\n if normalized in self._setters:\n return self._setters[normalized](self)\n self.report_invalid_syntax(\"Non-existing setting '%s'.\" % setting_name)\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L221_C4", "label": "get_setter", "type": "function", "loc": [221, 225], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L219_C0", "vector": [2, 1, 0.3878, 0.0087, 1, 0.93, 0.0, 277, 0, 2, 1, 0, 0, 0, 3], "semantic": {"name": "get_setter", "arg_names": ["self", "setting_name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_setter(self, setting_name):\n normalized = self.normalize(setting_name)\n if normalized in self._setters:\n return self._setters[normalized](self)\n self.report_invalid_syntax(\"Non-existing setting '%s'.\" % setting_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L222_C8", "label": "normalized = normalize()", "type": "assigned_variable", "loc": [222, 222], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L221_C4", "vector": [14, 2, 0.3861, 0.0017, 2, 0.73, 0.0, 828, 3, 1, 0, 0, 257, 10, 1], "semantic": {"name": "normalized", "arg_names": [], "import_names": [], "rhs_call_name": "normalize", "annotation": ""}, "snippet": " normalized = self.normalize(setting_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:If_L223_C8", "label": "if", "type": "if", "loc": [223, 224], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L221_C4", "vector": [4, 2, 0.3887, 0.0035, 2, 0.73, 0.5, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if normalized in self._setters:\n return self._setters[normalized](self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Return_L224_C12", "label": "return", "type": "return", "loc": [224, 224], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:If_L223_C8", "vector": [13, 3, 0.3896, 0.0017, 3, 0.13, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._setters[normalized](self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Expr_L225_C8", "label": "report_invalid_syntax()", "type": "expression", "loc": [225, 225], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L221_C4", "vector": [8, 2, 0.3913, 0.0017, 2, 0.73, 1.0, 782, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "report_invalid_syntax", "arg_names": [], "import_names": [], "rhs_call_name": "report_invalid_syntax", "annotation": ""}, "snippet": " self.report_invalid_syntax(\"Non-existing setting '%s'.\" % setting_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L227_C4", "label": "is_setting", "type": "function", "loc": [227, 228], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L219_C0", "vector": [2, 1, 0.3957, 0.0035, 1, 0.93, 0.5, 47, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "is_setting", "arg_names": ["self", "setting_name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def is_setting(self, setting_name):\n return self.normalize(setting_name) in self._setters"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Return_L228_C8", "label": "return", "type": "return", "loc": [228, 228], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L227_C4", "vector": [13, 2, 0.3965, 0.0017, 2, 0.91, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.normalize(setting_name) in self._setters"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L230_C4", "label": "normalize", "type": "function", "loc": [230, 232], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L219_C0", "vector": [2, 1, 0.4017, 0.0052, 1, 0.93, 1.0, 257, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "normalize", "arg_names": ["self", "setting"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def normalize(self, setting):\n result = utils.normalize(setting)\n return result[0:-1] if result and result[-1]==':' else result"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L231_C8", "label": "result = normalize()", "type": "assigned_variable", "loc": [231, 231], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L230_C4", "vector": [14, 2, 0.4017, 0.0017, 2, 0.27, 0.0, 51, 3, 1, 0, 0, 257, 10, 1], "semantic": {"name": "result", "arg_names": [], "import_names": [], "rhs_call_name": "normalize", "annotation": ""}, "snippet": " result = utils.normalize(setting)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Return_L232_C8", "label": "return", "type": "return", "loc": [232, 232], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L230_C4", "vector": [13, 2, 0.4035, 0.0017, 2, 0.27, 1.0, 0, 8, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return result[0:-1] if result and result[-1]==':' else result"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L234_C0", "label": "_SettingTable", "type": "class", "loc": [234, 274], "level": 0, "parent": null, "vector": [3, 0, 0.4417, 0.0713, 0, 0.66, 0.5385, 99, 0, 8, 0, 0, 969, 0, 21], "semantic": {"name": "_SettingTable", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class _SettingTable(_Table, _WithSettings):\n type = 'setting'\n\n def __init__(self, parent):\n _Table.__init__(self, parent)\n self.doc = Documentation('Documentation', self)\n self.suite_setup = Fixture('Suite Setup', self)\n self.suite_teardown = Fixture('Suite Teardown', self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L235_C4", "label": "type =", "type": "assigned_variable", "loc": [235, 235], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L234_C0", "vector": [14, 1, 0.4087, 0.0017, 1, 0.05, 0.0, 801, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "type", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " type = 'setting'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L237_C4", "label": "__init__", "type": "function", "loc": [237, 249], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L234_C0", "vector": [2, 1, 0.4226, 0.0226, 1, 0.05, 0.1429, 555, 0, 2, 0, 0, 0, 0, 10], "semantic": {"name": "__init__", "arg_names": ["self", "parent"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, parent):\n _Table.__init__(self, parent)\n self.doc = Documentation('Documentation', self)\n self.suite_setup = Fixture('Suite Setup', self)\n self.suite_teardown = Fixture('Suite Teardown', self)\n self.test_setup = Fixture('Test Setup', self)\n self.test_teardown = Fixture('Test Teardown', self)\n self.force_tags = Tags('Force Tags', self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Expr_L238_C8", "label": "__init__()", "type": "expression", "loc": [238, 238], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L237_C4", "vector": [8, 2, 0.4139, 0.0017, 2, 0.43, 0.0, 555, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " _Table.__init__(self, parent)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L239_C8", "label": "self.doc = Documentation()", "type": "assigned_variable", "loc": [239, 239], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L237_C4", "vector": [14, 2, 0.4157, 0.0017, 2, 0.43, 0.0909, 114, 3, 2, 0, 0, 564, 10, 1], "semantic": {"name": "self.doc", "arg_names": [], "import_names": [], "rhs_call_name": "Documentation", "annotation": ""}, "snippet": " self.doc = Documentation('Documentation', self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L240_C8", "label": "self.suite_setup = Fixture()", "type": "assigned_variable", "loc": [240, 240], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L237_C4", "vector": [14, 2, 0.4174, 0.0017, 2, 0.43, 0.1818, 664, 3, 2, 0, 0, 488, 10, 1], "semantic": {"name": "self.suite_setup", "arg_names": [], "import_names": [], "rhs_call_name": "Fixture", "annotation": ""}, "snippet": " self.suite_setup = Fixture('Suite Setup', self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L241_C8", "label": "self.suite_teardown = Fixture()", "type": "assigned_variable", "loc": [241, 241], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L237_C4", "vector": [14, 2, 0.4191, 0.0017, 2, 0.43, 0.2727, 375, 3, 2, 0, 0, 488, 10, 1], "semantic": {"name": "self.suite_teardown", "arg_names": [], "import_names": [], "rhs_call_name": "Fixture", "annotation": ""}, "snippet": " self.suite_teardown = Fixture('Suite Teardown', self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L242_C8", "label": "self.test_setup = Fixture()", "type": "assigned_variable", "loc": [242, 242], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L237_C4", "vector": [14, 2, 0.4209, 0.0017, 2, 0.43, 0.3636, 31, 3, 2, 0, 0, 488, 10, 1], "semantic": {"name": "self.test_setup", "arg_names": [], "import_names": [], "rhs_call_name": "Fixture", "annotation": ""}, "snippet": " self.test_setup = Fixture('Test Setup', self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L243_C8", "label": "self.test_teardown = Fixture()", "type": "assigned_variable", "loc": [243, 243], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L237_C4", "vector": [14, 2, 0.4226, 0.0017, 2, 0.43, 0.4545, 747, 3, 2, 0, 0, 488, 10, 1], "semantic": {"name": "self.test_teardown", "arg_names": [], "import_names": [], "rhs_call_name": "Fixture", "annotation": ""}, "snippet": " self.test_teardown = Fixture('Test Teardown', self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L244_C8", "label": "self.force_tags = Tags()", "type": "assigned_variable", "loc": [244, 244], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L237_C4", "vector": [14, 2, 0.4243, 0.0017, 2, 0.43, 0.5455, 904, 3, 2, 0, 0, 344, 10, 1], "semantic": {"name": "self.force_tags", "arg_names": [], "import_names": [], "rhs_call_name": "Tags", "annotation": ""}, "snippet": " self.force_tags = Tags('Force Tags', self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L245_C8", "label": "self.default_tags = Tags()", "type": "assigned_variable", "loc": [245, 245], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L237_C4", "vector": [14, 2, 0.4261, 0.0017, 2, 0.43, 0.6364, 150, 3, 2, 0, 0, 344, 10, 1], "semantic": {"name": "self.default_tags", "arg_names": [], "import_names": [], "rhs_call_name": "Tags", "annotation": ""}, "snippet": " self.default_tags = Tags('Default Tags', self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L246_C8", "label": "self.test_template = Template()", "type": "assigned_variable", "loc": [246, 246], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L237_C4", "vector": [14, 2, 0.4278, 0.0017, 2, 0.43, 0.7273, 342, 3, 2, 0, 0, 137, 10, 1], "semantic": {"name": "self.test_template", "arg_names": [], "import_names": [], "rhs_call_name": "Template", "annotation": ""}, "snippet": " self.test_template = Template('Test Template', self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L247_C8", "label": "self.test_timeout = Timeout()", "type": "assigned_variable", "loc": [247, 247], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L237_C4", "vector": [14, 2, 0.4296, 0.0017, 2, 0.43, 0.8182, 292, 3, 2, 0, 0, 508, 10, 1], "semantic": {"name": "self.test_timeout", "arg_names": [], "import_names": [], "rhs_call_name": "Timeout", "annotation": ""}, "snippet": " self.test_timeout = Timeout('Test Timeout', self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L248_C8", "label": "self.metadata =", "type": "assigned_variable", "loc": [248, 248], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L237_C4", "vector": [14, 2, 0.4313, 0.0017, 2, 0.43, 0.9091, 83, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.metadata", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.metadata = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L249_C8", "label": "self.imports =", "type": "assigned_variable", "loc": [249, 249], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L237_C4", "vector": [14, 2, 0.433, 0.0017, 2, 0.43, 1.0, 703, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.imports", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.imports = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L251_C4", "label": "_get_adder", "type": "function", "loc": [251, 255], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L234_C0", "vector": [2, 1, 0.44, 0.0087, 1, 0.05, 0.2857, 390, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "_get_adder", "arg_names": ["self", "adder_method"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _get_adder(self, adder_method):\n def adder(value, comment):\n name = value[0] if value else ''\n adder_method(name, value[1:], comment)\n return adder"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L252_C8", "label": "adder", "type": "function", "loc": [252, 254], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L251_C4", "vector": [2, 2, 0.44, 0.0052, 2, 0.14, 0.0, 681, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "adder", "arg_names": ["value", "comment"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def adder(value, comment):\n name = value[0] if value else ''\n adder_method(name, value[1:], comment)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L253_C12", "label": "name =", "type": "assigned_variable", "loc": [253, 253], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L252_C8", "vector": [14, 3, 0.44, 0.0017, 3, 0.51, 0.0, 57, 8, 0, 0, 0, 0, 0, 0], "semantic": {"name": "name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " name = value[0] if value else ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Expr_L254_C12", "label": "adder_method()", "type": "expression", "loc": [254, 254], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L252_C8", "vector": [8, 3, 0.4417, 0.0017, 3, 0.51, 1.0, 86, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "adder_method", "arg_names": [], "import_names": [], "rhs_call_name": "adder_method", "annotation": ""}, "snippet": " adder_method(name, value[1:], comment)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Return_L255_C8", "label": "return", "type": "return", "loc": [255, 255], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L251_C4", "vector": [13, 2, 0.4435, 0.0017, 2, 0.14, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return adder"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L257_C4", "label": "add_metadata", "type": "function", "loc": [257, 259], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L234_C0", "vector": [2, 1, 0.4487, 0.0052, 1, 0.05, 0.4286, 217, 0, 4, 1, 0, 0, 0, 2], "semantic": {"name": "add_metadata", "arg_names": ["self", "name", "value", "comment"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def add_metadata(self, name, value='', comment=None):\n self.metadata.append(Metadata('Metadata', self, name, value, comment))\n return self.metadata[-1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Expr_L258_C8", "label": "append()", "type": "expression", "loc": [258, 258], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L257_C4", "vector": [8, 2, 0.4487, 0.0017, 2, 0.82, 0.0, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.metadata.append(Metadata('Metadata', self, name, value, comment))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Return_L259_C8", "label": "return", "type": "return", "loc": [259, 259], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L257_C4", "vector": [13, 2, 0.4504, 0.0017, 2, 0.82, 1.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.metadata[-1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L261_C4", "label": "add_library", "type": "function", "loc": [261, 263], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L234_C0", "vector": [2, 1, 0.4557, 0.0052, 1, 0.05, 0.5714, 216, 0, 4, 1, 0, 0, 0, 2], "semantic": {"name": "add_library", "arg_names": ["self", "name", "args", "comment"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def add_library(self, name, args=None, comment=None):\n self.imports.append(Library(self, name, args, comment=comment))\n return self.imports[-1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Expr_L262_C8", "label": "append()", "type": "expression", "loc": [262, 262], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L261_C4", "vector": [8, 2, 0.4557, 0.0017, 2, 0.25, 0.0, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.imports.append(Library(self, name, args, comment=comment))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Return_L263_C8", "label": "return", "type": "return", "loc": [263, 263], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L261_C4", "vector": [13, 2, 0.4574, 0.0017, 2, 0.25, 1.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.imports[-1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L265_C4", "label": "add_resource", "type": "function", "loc": [265, 267], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L234_C0", "vector": [2, 1, 0.4626, 0.0052, 1, 0.05, 0.7143, 134, 0, 4, 1, 0, 0, 0, 2], "semantic": {"name": "add_resource", "arg_names": ["self", "name", "invalid_args", "comment"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def add_resource(self, name, invalid_args=None, comment=None):\n self.imports.append(Resource(self, name, invalid_args, comment=comment))\n return self.imports[-1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Expr_L266_C8", "label": "append()", "type": "expression", "loc": [266, 266], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L265_C4", "vector": [8, 2, 0.4626, 0.0017, 2, 0.31, 0.0, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.imports.append(Resource(self, name, invalid_args, comment=comment))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Return_L267_C8", "label": "return", "type": "return", "loc": [267, 267], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L265_C4", "vector": [13, 2, 0.4643, 0.0017, 2, 0.31, 1.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.imports[-1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L269_C4", "label": "add_variables", "type": "function", "loc": [269, 271], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L234_C0", "vector": [2, 1, 0.4696, 0.0052, 1, 0.05, 0.8571, 262, 0, 4, 1, 0, 0, 0, 2], "semantic": {"name": "add_variables", "arg_names": ["self", "name", "args", "comment"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def add_variables(self, name, args=None, comment=None):\n self.imports.append(Variables(self, name, args, comment=comment))\n return self.imports[-1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Expr_L270_C8", "label": "append()", "type": "expression", "loc": [270, 270], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L269_C4", "vector": [8, 2, 0.4696, 0.0017, 2, 0.84, 0.0, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.imports.append(Variables(self, name, args, comment=comment))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Return_L271_C8", "label": "return", "type": "return", "loc": [271, 271], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L269_C4", "vector": [13, 2, 0.4713, 0.0017, 2, 0.84, 1.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.imports[-1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L273_C4", "label": "__nonzero__", "type": "function", "loc": [273, 274], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L234_C0", "vector": [2, 1, 0.4757, 0.0035, 1, 0.05, 1.0, 322, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "__nonzero__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __nonzero__(self):\n return any(setting.is_set() for setting in self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Return_L274_C8", "label": "return", "type": "return", "loc": [274, 274], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L273_C4", "vector": [13, 2, 0.4765, 0.0017, 2, 0.13, 0.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return any(setting.is_set() for setting in self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L277_C0", "label": "TestCaseFileSettingTable", "type": "class", "loc": [277, 303], "level": 0, "parent": null, "vector": [3, 0, 0.5043, 0.047, 0, 0.66, 0.5769, 716, 0, 1, 0, 0, 99, 0, 4], "semantic": {"name": "TestCaseFileSettingTable", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class TestCaseFileSettingTable(_SettingTable):\n\n _setters = {'documentation': lambda s: s.doc.populate,\n 'document': lambda s: s.doc.populate,\n 'suitesetup': lambda s: s.suite_setup.populate,\n 'suiteprecondition': lambda s: s.suite_setup.populate,\n 'suiteteardown': lambda s: s.suite_teardown.populate,\n 'suitepostcondition': lambda s: s.suite_teardown.populate,"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L279_C4", "label": "_setters =", "type": "assigned_variable", "loc": [279, 296], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L277_C0", "vector": [14, 1, 0.5, 0.0313, 1, 0.07, 0.0, 702, 0, 0, 0, 0, 0, 6, 4], "semantic": {"name": "_setters", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " _setters = {'documentation': lambda s: s.doc.populate,\n 'document': lambda s: s.doc.populate,\n 'suitesetup': lambda s: s.suite_setup.populate,\n 'suiteprecondition': lambda s: s.suite_setup.populate,\n 'suiteteardown': lambda s: s.suite_teardown.populate,\n 'suitepostcondition': lambda s: s.suite_teardown.populate,\n 'testsetup': lambda s: s.test_setup.populate,\n 'testprecondition': lambda s: s.test_setup.populate,"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L298_C4", "label": "__iter__", "type": "function", "loc": [298, 303], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L277_C0", "vector": [2, 1, 0.5226, 0.0104, 1, 0.07, 1.0, 891, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "__iter__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __iter__(self):\n for setting in [self.doc, self.suite_setup, self.suite_teardown,\n self.test_setup, self.test_teardown, self.force_tags,\n self.default_tags, self.test_template, self.test_timeout] \\\n + self.metadata + self.imports:\n yield setting"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:For_L299_C8", "label": "for setting", "type": "for", "loc": [299, 303], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L298_C4", "vector": [6, 2, 0.5235, 0.0087, 2, 0.82, 0.0, 368, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "setting", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for setting in [self.doc, self.suite_setup, self.suite_teardown,\n self.test_setup, self.test_teardown, self.force_tags,\n self.default_tags, self.test_template, self.test_timeout] \\\n + self.metadata + self.imports:\n yield setting"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Expr_L303_C12", "label": "expression", "type": "expression", "loc": [303, 303], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:For_L299_C8", "vector": [8, 3, 0.527, 0.0017, 3, 0.66, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " yield setting"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L306_C0", "label": "ResourceFileSettingTable", "type": "class", "loc": [306, 316], "level": 0, "parent": null, "vector": [3, 0, 0.5409, 0.0191, 0, 0.66, 0.6154, 31, 0, 1, 0, 0, 99, 0, 3], "semantic": {"name": "ResourceFileSettingTable", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class ResourceFileSettingTable(_SettingTable):\n\n _setters = {'documentation': lambda s: s.doc.populate,\n 'document': lambda s: s.doc.populate,\n 'library': lambda s: s._get_adder(s.add_library),\n 'resource': lambda s: s._get_adder(s.add_resource),\n 'variables': lambda s: s._get_adder(s.add_variables)}\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L308_C4", "label": "_setters =", "type": "assigned_variable", "loc": [308, 312], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L306_C0", "vector": [14, 1, 0.5391, 0.0087, 1, 0.18, 0.0, 702, 0, 0, 0, 0, 0, 6, 3], "semantic": {"name": "_setters", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " _setters = {'documentation': lambda s: s.doc.populate,\n 'document': lambda s: s.doc.populate,\n 'library': lambda s: s._get_adder(s.add_library),\n 'resource': lambda s: s._get_adder(s.add_resource),\n 'variables': lambda s: s._get_adder(s.add_variables)}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L314_C4", "label": "__iter__", "type": "function", "loc": [314, 316], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L306_C0", "vector": [2, 1, 0.5478, 0.0052, 1, 0.18, 1.0, 891, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "__iter__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __iter__(self):\n for setting in [self.doc] + self.imports:\n yield setting"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:For_L315_C8", "label": "for setting", "type": "for", "loc": [315, 316], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L314_C4", "vector": [6, 2, 0.5487, 0.0035, 2, 0.23, 0.0, 368, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "setting", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for setting in [self.doc] + self.imports:\n yield setting"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Expr_L316_C12", "label": "expression", "type": "expression", "loc": [316, 316], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:For_L315_C8", "vector": [8, 3, 0.5496, 0.0017, 3, 0.26, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " yield setting"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L319_C0", "label": "InitFileSettingTable", "type": "class", "loc": [319, 341], "level": 0, "parent": null, "vector": [3, 0, 0.5739, 0.04, 0, 0.66, 0.6538, 141, 0, 1, 0, 0, 99, 0, 4], "semantic": {"name": "InitFileSettingTable", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class InitFileSettingTable(_SettingTable):\n\n _setters = {'documentation': lambda s: s.doc.populate,\n 'document': lambda s: s.doc.populate,\n 'suitesetup': lambda s: s.suite_setup.populate,\n 'suiteprecondition': lambda s: s.suite_setup.populate,\n 'suiteteardown': lambda s: s.suite_teardown.populate,\n 'suitepostcondition': lambda s: s.suite_teardown.populate,"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L321_C4", "label": "_setters =", "type": "assigned_variable", "loc": [321, 335], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L319_C0", "vector": [14, 1, 0.5704, 0.0261, 1, 0.06, 0.0, 702, 0, 0, 0, 0, 0, 6, 4], "semantic": {"name": "_setters", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " _setters = {'documentation': lambda s: s.doc.populate,\n 'document': lambda s: s.doc.populate,\n 'suitesetup': lambda s: s.suite_setup.populate,\n 'suiteprecondition': lambda s: s.suite_setup.populate,\n 'suiteteardown': lambda s: s.suite_teardown.populate,\n 'suitepostcondition': lambda s: s.suite_teardown.populate,\n 'testsetup': lambda s: s.test_setup.populate,\n 'testprecondition': lambda s: s.test_setup.populate,"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L337_C4", "label": "__iter__", "type": "function", "loc": [337, 341], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L319_C0", "vector": [2, 1, 0.5896, 0.0087, 1, 0.06, 1.0, 891, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "__iter__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __iter__(self):\n for setting in [self.doc, self.suite_setup, self.suite_teardown,\n self.test_setup, self.test_teardown, self.force_tags] \\\n + self.metadata + self.imports:\n yield setting"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:For_L338_C8", "label": "for setting", "type": "for", "loc": [338, 341], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L337_C4", "vector": [6, 2, 0.5904, 0.007, 2, 0.72, 0.0, 368, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "setting", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for setting in [self.doc, self.suite_setup, self.suite_teardown,\n self.test_setup, self.test_teardown, self.force_tags] \\\n + self.metadata + self.imports:\n yield setting"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Expr_L341_C12", "label": "expression", "type": "expression", "loc": [341, 341], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:For_L338_C8", "vector": [8, 3, 0.593, 0.0017, 3, 0.84, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " yield setting"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L344_C0", "label": "VariableTable", "type": "class", "loc": [344, 358], "level": 0, "parent": null, "vector": [3, 0, 0.6104, 0.0261, 0, 0.66, 0.6923, 749, 0, 4, 0, 0, 969, 0, 5], "semantic": {"name": "VariableTable", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class VariableTable(_Table):\n type = 'variable'\n\n def __init__(self, parent):\n _Table.__init__(self, parent)\n self.variables = []\n\n def add(self, name, value, comment=None):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L345_C4", "label": "type =", "type": "assigned_variable", "loc": [345, 345], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L344_C0", "vector": [14, 1, 0.6, 0.0017, 1, 0.32, 0.0, 801, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "type", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " type = 'variable'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L347_C4", "label": "__init__", "type": "function", "loc": [347, 349], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L344_C0", "vector": [2, 1, 0.6052, 0.0052, 1, 0.32, 0.25, 555, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": ["self", "parent"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, parent):\n _Table.__init__(self, parent)\n self.variables = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Expr_L348_C8", "label": "__init__()", "type": "expression", "loc": [348, 348], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L347_C4", "vector": [8, 2, 0.6052, 0.0017, 2, 0.06, 0.0, 555, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " _Table.__init__(self, parent)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L349_C8", "label": "self.variables =", "type": "assigned_variable", "loc": [349, 349], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L347_C4", "vector": [14, 2, 0.607, 0.0017, 2, 0.06, 1.0, 990, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.variables", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.variables = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L351_C4", "label": "add", "type": "function", "loc": [351, 352], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L344_C0", "vector": [2, 1, 0.6113, 0.0035, 1, 0.32, 0.5, 241, 0, 4, 0, 0, 0, 0, 2], "semantic": {"name": "add", "arg_names": ["self", "name", "value", "comment"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def add(self, name, value, comment=None):\n self.variables.append(Variable(name, value, comment))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Expr_L352_C8", "label": "append()", "type": "expression", "loc": [352, 352], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L351_C4", "vector": [8, 2, 0.6122, 0.0017, 2, 0.85, 0.0, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.variables.append(Variable(name, value, comment))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L354_C4", "label": "__iter__", "type": "function", "loc": [354, 355], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L344_C0", "vector": [2, 1, 0.6165, 0.0035, 1, 0.32, 0.75, 891, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "__iter__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __iter__(self):\n return iter(self.variables)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Return_L355_C8", "label": "return", "type": "return", "loc": [355, 355], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L354_C4", "vector": [13, 2, 0.6174, 0.0017, 2, 0.91, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return iter(self.variables)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L357_C4", "label": "__nonzero__", "type": "function", "loc": [357, 358], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L344_C0", "vector": [2, 1, 0.6217, 0.0035, 1, 0.32, 1.0, 322, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "__nonzero__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __nonzero__(self):\n return bool(self.variables)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Return_L358_C8", "label": "return", "type": "return", "loc": [358, 358], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L357_C4", "vector": [13, 2, 0.6226, 0.0017, 2, 0.3, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return bool(self.variables)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L361_C0", "label": "TestCaseTable", "type": "class", "loc": [361, 379], "level": 0, "parent": null, "vector": [3, 0, 0.6435, 0.033, 0, 0.66, 0.7308, 784, 0, 5, 0, 0, 969, 0, 6], "semantic": {"name": "TestCaseTable", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class TestCaseTable(_Table):\n type = 'testcase'\n\n def __init__(self, parent):\n _Table.__init__(self, parent)\n self.tests = []\n\n def add(self, name):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L362_C4", "label": "type =", "type": "assigned_variable", "loc": [362, 362], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L361_C0", "vector": [14, 1, 0.6296, 0.0017, 1, 0.14, 0.0, 801, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "type", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " type = 'testcase'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L364_C4", "label": "__init__", "type": "function", "loc": [364, 366], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L361_C0", "vector": [2, 1, 0.6348, 0.0052, 1, 0.14, 0.2, 555, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": ["self", "parent"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, parent):\n _Table.__init__(self, parent)\n self.tests = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Expr_L365_C8", "label": "__init__()", "type": "expression", "loc": [365, 365], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L364_C4", "vector": [8, 2, 0.6348, 0.0017, 2, 0.93, 0.0, 555, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " _Table.__init__(self, parent)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L366_C8", "label": "self.tests =", "type": "assigned_variable", "loc": [366, 366], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L364_C4", "vector": [14, 2, 0.6365, 0.0017, 2, 0.93, 1.0, 606, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.tests", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.tests = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L368_C4", "label": "add", "type": "function", "loc": [368, 370], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L361_C0", "vector": [2, 1, 0.6417, 0.0052, 1, 0.14, 0.4, 241, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "add", "arg_names": ["self", "name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def add(self, name):\n self.tests.append(TestCase(self, name))\n return self.tests[-1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Expr_L369_C8", "label": "append()", "type": "expression", "loc": [369, 369], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L368_C4", "vector": [8, 2, 0.6417, 0.0017, 2, 0.9, 0.0, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.tests.append(TestCase(self, name))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Return_L370_C8", "label": "return", "type": "return", "loc": [370, 370], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L368_C4", "vector": [13, 2, 0.6435, 0.0017, 2, 0.9, 1.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.tests[-1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L372_C4", "label": "__iter__", "type": "function", "loc": [372, 373], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L361_C0", "vector": [2, 1, 0.6478, 0.0035, 1, 0.14, 0.6, 891, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "__iter__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __iter__(self):\n return iter(self.tests)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Return_L373_C8", "label": "return", "type": "return", "loc": [373, 373], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L372_C4", "vector": [13, 2, 0.6487, 0.0017, 2, 0.74, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return iter(self.tests)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L375_C4", "label": "__nonzero__", "type": "function", "loc": [375, 376], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L361_C0", "vector": [2, 1, 0.653, 0.0035, 1, 0.14, 0.8, 322, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "__nonzero__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __nonzero__(self):\n return bool(self.tests)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Return_L376_C8", "label": "return", "type": "return", "loc": [376, 376], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L375_C4", "vector": [13, 2, 0.6539, 0.0017, 2, 0.39, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return bool(self.tests)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L378_C4", "label": "is_started", "type": "function", "loc": [378, 379], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L361_C0", "vector": [2, 1, 0.6583, 0.0035, 1, 0.14, 1.0, 143, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "is_started", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def is_started(self):\n return bool(self.header)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Return_L379_C8", "label": "return", "type": "return", "loc": [379, 379], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L378_C4", "vector": [13, 2, 0.6591, 0.0017, 2, 0.2, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return bool(self.header)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L382_C0", "label": "KeywordTable", "type": "class", "loc": [382, 397], "level": 0, "parent": null, "vector": [3, 0, 0.6774, 0.0278, 0, 0.66, 0.7692, 716, 0, 4, 0, 0, 969, 0, 5], "semantic": {"name": "KeywordTable", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class KeywordTable(_Table):\n type = 'keyword'\n\n def __init__(self, parent):\n _Table.__init__(self, parent)\n self.keywords = []\n\n def add(self, name):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L383_C4", "label": "type =", "type": "assigned_variable", "loc": [383, 383], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L382_C0", "vector": [14, 1, 0.6661, 0.0017, 1, 0.2, 0.0, 801, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "type", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " type = 'keyword'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L385_C4", "label": "__init__", "type": "function", "loc": [385, 387], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L382_C0", "vector": [2, 1, 0.6713, 0.0052, 1, 0.2, 0.25, 555, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": ["self", "parent"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, parent):\n _Table.__init__(self, parent)\n self.keywords = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Expr_L386_C8", "label": "__init__()", "type": "expression", "loc": [386, 386], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L385_C4", "vector": [8, 2, 0.6713, 0.0017, 2, 0.57, 0.0, 555, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " _Table.__init__(self, parent)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L387_C8", "label": "self.keywords =", "type": "assigned_variable", "loc": [387, 387], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L385_C4", "vector": [14, 2, 0.673, 0.0017, 2, 0.57, 1.0, 627, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.keywords", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.keywords = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L389_C4", "label": "add", "type": "function", "loc": [389, 391], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L382_C0", "vector": [2, 1, 0.6783, 0.0052, 1, 0.2, 0.5, 241, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "add", "arg_names": ["self", "name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def add(self, name):\n self.keywords.append(UserKeyword(self, name))\n return self.keywords[-1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Expr_L390_C8", "label": "append()", "type": "expression", "loc": [390, 390], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L389_C4", "vector": [8, 2, 0.6783, 0.0017, 2, 0.08, 0.0, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.keywords.append(UserKeyword(self, name))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Return_L391_C8", "label": "return", "type": "return", "loc": [391, 391], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L389_C4", "vector": [13, 2, 0.68, 0.0017, 2, 0.08, 1.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.keywords[-1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L393_C4", "label": "__iter__", "type": "function", "loc": [393, 394], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L382_C0", "vector": [2, 1, 0.6843, 0.0035, 1, 0.2, 0.75, 891, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "__iter__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __iter__(self):\n return iter(self.keywords)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Return_L394_C8", "label": "return", "type": "return", "loc": [394, 394], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L393_C4", "vector": [13, 2, 0.6852, 0.0017, 2, 0.73, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return iter(self.keywords)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L396_C4", "label": "__nonzero__", "type": "function", "loc": [396, 397], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L382_C0", "vector": [2, 1, 0.6896, 0.0035, 1, 0.2, 1.0, 322, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "__nonzero__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __nonzero__(self):\n return bool(self.keywords)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Return_L397_C8", "label": "return", "type": "return", "loc": [397, 397], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L396_C4", "vector": [13, 2, 0.6904, 0.0017, 2, 0.12, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return bool(self.keywords)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L400_C0", "label": "Variable", "type": "class", "loc": [400, 421], "level": 0, "parent": null, "vector": [3, 0, 0.7139, 0.0383, 0, 0.66, 0.8077, 807, 0, 4, 0, 0, 186, 0, 4], "semantic": {"name": "Variable", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Variable(object):\n\n def __init__(self, name, value, comment=None):\n self.name = name.rstrip('= ')\n if name.startswith('$') and value == []:\n value = ''\n if isinstance(value, basestring):\n value = [value] # Need to support scalar lists until RF 2.6"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L402_C4", "label": "__init__", "type": "function", "loc": [402, 409], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L400_C0", "vector": [2, 1, 0.7052, 0.0139, 1, 0.75, 0.0, 555, 0, 4, 0, 0, 0, 0, 3], "semantic": {"name": "__init__", "arg_names": ["self", "name", "value", "comment"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, name, value, comment=None):\n self.name = name.rstrip('= ')\n if name.startswith('$') and value == []:\n value = ''\n if isinstance(value, basestring):\n value = [value] # Need to support scalar lists until RF 2.6\n self.value = value\n self.comment = comment"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L403_C8", "label": "self.name = rstrip()", "type": "assigned_variable", "loc": [403, 403], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L402_C4", "vector": [14, 2, 0.7009, 0.0017, 2, 0.57, 0.0, 689, 3, 1, 0, 0, 807, 10, 1], "semantic": {"name": "self.name", "arg_names": [], "import_names": [], "rhs_call_name": "rstrip", "annotation": ""}, "snippet": " self.name = name.rstrip('= ')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:If_L404_C8", "label": "if", "type": "if", "loc": [404, 405], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L402_C4", "vector": [4, 2, 0.7035, 0.0035, 2, 0.57, 0.25, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if name.startswith('$') and value == []:\n value = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L405_C12", "label": "value =", "type": "assigned_variable", "loc": [405, 405], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:If_L404_C8", "vector": [14, 3, 0.7043, 0.0017, 3, 0.79, 0.0, 441, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "value", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " value = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:If_L406_C8", "label": "if", "type": "if", "loc": [406, 407], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L402_C4", "vector": [4, 2, 0.707, 0.0035, 2, 0.57, 0.5, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if isinstance(value, basestring):\n value = [value] # Need to support scalar lists until RF 2.6"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L407_C12", "label": "value =", "type": "assigned_variable", "loc": [407, 407], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:If_L406_C8", "vector": [14, 3, 0.7078, 0.0017, 3, 0.87, 0.0, 441, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "value", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " value = [value] # Need to support scalar lists until RF 2.6"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L408_C8", "label": "self.value =", "type": "assigned_variable", "loc": [408, 408], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L402_C4", "vector": [14, 2, 0.7096, 0.0017, 2, 0.57, 0.75, 966, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.value", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.value = value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L409_C8", "label": "self.comment =", "type": "assigned_variable", "loc": [409, 409], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L402_C4", "vector": [14, 2, 0.7113, 0.0017, 2, 0.57, 1.0, 450, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.comment", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.comment = comment"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L411_C4", "label": "as_list", "type": "function", "loc": [411, 415], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L400_C0", "vector": [2, 1, 0.7183, 0.0087, 1, 0.75, 0.3333, 817, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "as_list", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def as_list(self):\n ret = [self.name] + self.value\n if self.comment:\n ret.append('# %s' % self.comment)\n return ret"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L412_C8", "label": "ret =", "type": "assigned_variable", "loc": [412, 412], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L411_C4", "vector": [14, 2, 0.7165, 0.0017, 2, 0.47, 0.0, 501, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ret", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ret = [self.name] + self.value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:If_L413_C8", "label": "if", "type": "if", "loc": [413, 414], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L411_C4", "vector": [4, 2, 0.7191, 0.0035, 2, 0.47, 0.5, 0, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.comment:\n ret.append('# %s' % self.comment)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Expr_L414_C12", "label": "append()", "type": "expression", "loc": [414, 414], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:If_L413_C8", "vector": [8, 3, 0.72, 0.0017, 3, 0.5, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " ret.append('# %s' % self.comment)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Return_L415_C8", "label": "return", "type": "return", "loc": [415, 415], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L411_C4", "vector": [13, 2, 0.7217, 0.0017, 2, 0.47, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ret"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L417_C4", "label": "is_set", "type": "function", "loc": [417, 418], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L400_C0", "vector": [2, 1, 0.7261, 0.0035, 1, 0.75, 0.6667, 896, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "is_set", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def is_set(self):\n return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Return_L418_C8", "label": "return", "type": "return", "loc": [418, 418], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L417_C4", "vector": [13, 2, 0.727, 0.0017, 2, 0.97, 0.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L420_C4", "label": "is_for_loop", "type": "function", "loc": [420, 421], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L400_C0", "vector": [2, 1, 0.7313, 0.0035, 1, 0.75, 1.0, 153, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "is_for_loop", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def is_for_loop(self):\n return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Return_L421_C8", "label": "return", "type": "return", "loc": [421, 421], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L420_C4", "vector": [13, 2, 0.7322, 0.0017, 2, 0.58, 0.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L424_C0", "label": "_WithSteps", "type": "class", "loc": [424, 428], "level": 0, "parent": null, "vector": [3, 0, 0.7409, 0.0087, 0, 0.66, 0.8462, 963, 0, 1, 0, 0, 186, 0, 2], "semantic": {"name": "_WithSteps", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class _WithSteps(object):\n\n def add_step(self, content, comment=None):\n self.steps.append(Step(content, comment))\n return self.steps[-1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L426_C4", "label": "add_step", "type": "function", "loc": [426, 428], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L424_C0", "vector": [2, 1, 0.7426, 0.0052, 1, 0.06, 0.0, 816, 0, 3, 1, 0, 0, 0, 2], "semantic": {"name": "add_step", "arg_names": ["self", "content", "comment"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def add_step(self, content, comment=None):\n self.steps.append(Step(content, comment))\n return self.steps[-1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Expr_L427_C8", "label": "append()", "type": "expression", "loc": [427, 427], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L426_C4", "vector": [8, 2, 0.7426, 0.0017, 2, 0.37, 0.0, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.steps.append(Step(content, comment))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Return_L428_C8", "label": "return", "type": "return", "loc": [428, 428], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L426_C4", "vector": [13, 2, 0.7443, 0.0017, 2, 0.37, 1.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.steps[-1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L431_C0", "label": "TestCase", "type": "class", "loc": [431, 476], "level": 0, "parent": null, "vector": [3, 0, 0.7887, 0.08, 0, 0.66, 0.8846, 3, 0, 6, 0, 0, 963, 0, 10], "semantic": {"name": "TestCase", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class TestCase(_WithSteps, _WithSettings):\n\n def __init__(self, parent, name):\n self.parent = parent\n self.name = name\n self.doc = Documentation('[Documentation]', self)\n self.template = Template('[Template]', self)\n self.tags = Tags('[Tags]', self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L433_C4", "label": "__init__", "type": "function", "loc": [433, 442], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L431_C0", "vector": [2, 1, 0.7609, 0.0174, 1, 0.28, 0.0, 555, 0, 3, 0, 0, 0, 0, 6], "semantic": {"name": "__init__", "arg_names": ["self", "parent", "name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, parent, name):\n self.parent = parent\n self.name = name\n self.doc = Documentation('[Documentation]', self)\n self.template = Template('[Template]', self)\n self.tags = Tags('[Tags]', self)\n self.setup = Fixture('[Setup]', self)\n self.teardown = Fixture('[Teardown]', self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L434_C8", "label": "self.parent =", "type": "assigned_variable", "loc": [434, 434], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L433_C4", "vector": [14, 2, 0.7548, 0.0017, 2, 0.72, 0.0, 428, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.parent", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.parent = parent"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L435_C8", "label": "self.name =", "type": "assigned_variable", "loc": [435, 435], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L433_C4", "vector": [14, 2, 0.7565, 0.0017, 2, 0.72, 0.125, 689, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.name = name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L436_C8", "label": "self.doc = Documentation()", "type": "assigned_variable", "loc": [436, 436], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L433_C4", "vector": [14, 2, 0.7583, 0.0017, 2, 0.72, 0.25, 114, 3, 2, 0, 0, 564, 10, 1], "semantic": {"name": "self.doc", "arg_names": [], "import_names": [], "rhs_call_name": "Documentation", "annotation": ""}, "snippet": " self.doc = Documentation('[Documentation]', self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L437_C8", "label": "self.template = Template()", "type": "assigned_variable", "loc": [437, 437], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L433_C4", "vector": [14, 2, 0.76, 0.0017, 2, 0.72, 0.375, 479, 3, 2, 0, 0, 137, 10, 1], "semantic": {"name": "self.template", "arg_names": [], "import_names": [], "rhs_call_name": "Template", "annotation": ""}, "snippet": " self.template = Template('[Template]', self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L438_C8", "label": "self.tags = Tags()", "type": "assigned_variable", "loc": [438, 438], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L433_C4", "vector": [14, 2, 0.7617, 0.0017, 2, 0.72, 0.5, 664, 3, 2, 0, 0, 344, 10, 1], "semantic": {"name": "self.tags", "arg_names": [], "import_names": [], "rhs_call_name": "Tags", "annotation": ""}, "snippet": " self.tags = Tags('[Tags]', self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L439_C8", "label": "self.setup = Fixture()", "type": "assigned_variable", "loc": [439, 439], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L433_C4", "vector": [14, 2, 0.7635, 0.0017, 2, 0.72, 0.625, 524, 3, 2, 0, 0, 488, 10, 1], "semantic": {"name": "self.setup", "arg_names": [], "import_names": [], "rhs_call_name": "Fixture", "annotation": ""}, "snippet": " self.setup = Fixture('[Setup]', self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L440_C8", "label": "self.teardown = Fixture()", "type": "assigned_variable", "loc": [440, 440], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L433_C4", "vector": [14, 2, 0.7652, 0.0017, 2, 0.72, 0.75, 281, 3, 2, 0, 0, 488, 10, 1], "semantic": {"name": "self.teardown", "arg_names": [], "import_names": [], "rhs_call_name": "Fixture", "annotation": ""}, "snippet": " self.teardown = Fixture('[Teardown]', self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L441_C8", "label": "self.timeout = Timeout()", "type": "assigned_variable", "loc": [441, 441], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L433_C4", "vector": [14, 2, 0.767, 0.0017, 2, 0.72, 0.875, 621, 3, 2, 0, 0, 508, 10, 1], "semantic": {"name": "self.timeout", "arg_names": [], "import_names": [], "rhs_call_name": "Timeout", "annotation": ""}, "snippet": " self.timeout = Timeout('[Timeout]', self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L442_C8", "label": "self.steps =", "type": "assigned_variable", "loc": [442, 442], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L433_C4", "vector": [14, 2, 0.7687, 0.0017, 2, 0.72, 1.0, 300, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.steps", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.steps = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L444_C4", "label": "_setters =", "type": "assigned_variable", "loc": [444, 452], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L431_C0", "vector": [14, 1, 0.7791, 0.0157, 1, 0.28, 0.1667, 702, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "_setters", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " _setters = {'documentation': lambda s: s.doc.populate,\n 'document': lambda s: s.doc.populate,\n 'template': lambda s: s.template.populate,\n 'setup': lambda s: s.setup.populate,\n 'precondition': lambda s: s.setup.populate,\n 'teardown': lambda s: s.teardown.populate,\n 'postcondition': lambda s: s.teardown.populate,\n 'tags': lambda s: s.tags.populate,"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L456_C4", "label": "source", "type": "function", "loc": [456, 457], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L431_C0", "vector": [2, 1, 0.7939, 0.0035, 1, 0.28, 0.3333, 703, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "source", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def source(self):\n return self.parent.source"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Return_L457_C8", "label": "return", "type": "return", "loc": [457, 457], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L456_C4", "vector": [13, 2, 0.7948, 0.0017, 2, 0.79, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.parent.source"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L460_C4", "label": "directory", "type": "function", "loc": [460, 461], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L431_C0", "vector": [2, 1, 0.8009, 0.0035, 1, 0.28, 0.5, 229, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "directory", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def directory(self):\n return self.parent.directory"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Return_L461_C8", "label": "return", "type": "return", "loc": [461, 461], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L460_C4", "vector": [13, 2, 0.8017, 0.0017, 2, 0.37, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.parent.directory"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L463_C4", "label": "add_for_loop", "type": "function", "loc": [463, 465], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L431_C0", "vector": [2, 1, 0.807, 0.0052, 1, 0.28, 0.6667, 551, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "add_for_loop", "arg_names": ["self", "data"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def add_for_loop(self, data):\n self.steps.append(ForLoop(data))\n return self.steps[-1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Expr_L464_C8", "label": "append()", "type": "expression", "loc": [464, 464], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L463_C4", "vector": [8, 2, 0.807, 0.0017, 2, 0.25, 0.0, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.steps.append(ForLoop(data))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Return_L465_C8", "label": "return", "type": "return", "loc": [465, 465], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L463_C4", "vector": [13, 2, 0.8087, 0.0017, 2, 0.25, 1.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.steps[-1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L467_C4", "label": "report_invalid_syntax", "type": "function", "loc": [467, 470], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L431_C0", "vector": [2, 1, 0.8148, 0.007, 1, 0.28, 0.8333, 782, 0, 3, 0, 0, 0, 0, 2], "semantic": {"name": "report_invalid_syntax", "arg_names": ["self", "message", "level"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def report_invalid_syntax(self, message, level='ERROR'):\n type_ = 'test case' if type(self) is TestCase else 'keyword'\n message = \"Invalid syntax in %s '%s': %s\" % (type_, self.name, message)\n self.parent.report_invalid_syntax(message, level)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L468_C8", "label": "type_ =", "type": "assigned_variable", "loc": [468, 468], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L467_C4", "vector": [14, 2, 0.8139, 0.0017, 2, 0.12, 0.0, 337, 8, 0, 0, 0, 0, 0, 1], "semantic": {"name": "type_", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " type_ = 'test case' if type(self) is TestCase else 'keyword'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L469_C8", "label": "message =", "type": "assigned_variable", "loc": [469, 469], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L467_C4", "vector": [14, 2, 0.8157, 0.0017, 2, 0.12, 0.5, 635, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "message", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " message = \"Invalid syntax in %s '%s': %s\" % (type_, self.name, message)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Expr_L470_C8", "label": "report_invalid_syntax()", "type": "expression", "loc": [470, 470], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L467_C4", "vector": [8, 2, 0.8174, 0.0017, 2, 0.12, 1.0, 782, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "report_invalid_syntax", "arg_names": [], "import_names": [], "rhs_call_name": "report_invalid_syntax", "annotation": ""}, "snippet": " self.parent.report_invalid_syntax(message, level)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L472_C4", "label": "__iter__", "type": "function", "loc": [472, 476], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L431_C0", "vector": [2, 1, 0.8243, 0.0087, 1, 0.28, 1.0, 891, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "__iter__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __iter__(self):\n for element in [self.doc, self.tags, self.setup,\n self.template, self.timeout] \\\n + self.steps + [self.teardown]:\n yield element"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:For_L473_C8", "label": "for element", "type": "for", "loc": [473, 476], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L472_C4", "vector": [6, 2, 0.8252, 0.007, 2, 0.71, 0.0, 736, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "element", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for element in [self.doc, self.tags, self.setup,\n self.template, self.timeout] \\\n + self.steps + [self.teardown]:\n yield element"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Expr_L476_C12", "label": "expression", "type": "expression", "loc": [476, 476], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:For_L473_C8", "vector": [8, 3, 0.8278, 0.0017, 3, 0.7, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " yield element"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L479_C0", "label": "UserKeyword", "type": "class", "loc": [479, 501], "level": 0, "parent": null, "vector": [3, 0, 0.8522, 0.04, 0, 0.66, 0.9231, 872, 0, 2, 0, 0, 3, 0, 5], "semantic": {"name": "UserKeyword", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class UserKeyword(TestCase):\n\n def __init__(self, parent, name):\n self.parent = parent\n self.name = name\n self.doc = Documentation('[Documentation]', self)\n self.args = Arguments('[Arguments]', self)\n self.return_ = Return('[Return]', self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L481_C4", "label": "__init__", "type": "function", "loc": [481, 489], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L479_C0", "vector": [2, 1, 0.8435, 0.0157, 1, 0.35, 0.0, 555, 0, 3, 0, 0, 0, 0, 5], "semantic": {"name": "__init__", "arg_names": ["self", "parent", "name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, parent, name):\n self.parent = parent\n self.name = name\n self.doc = Documentation('[Documentation]', self)\n self.args = Arguments('[Arguments]', self)\n self.return_ = Return('[Return]', self)\n self.timeout = Timeout('[Timeout]', self)\n self.teardown = Fixture('[Teardown]', self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L482_C8", "label": "self.parent =", "type": "assigned_variable", "loc": [482, 482], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L481_C4", "vector": [14, 2, 0.8383, 0.0017, 2, 0.59, 0.0, 428, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.parent", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.parent = parent"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L483_C8", "label": "self.name =", "type": "assigned_variable", "loc": [483, 483], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L481_C4", "vector": [14, 2, 0.84, 0.0017, 2, 0.59, 0.1429, 689, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.name = name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L484_C8", "label": "self.doc = Documentation()", "type": "assigned_variable", "loc": [484, 484], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L481_C4", "vector": [14, 2, 0.8417, 0.0017, 2, 0.59, 0.2857, 114, 3, 2, 0, 0, 564, 10, 1], "semantic": {"name": "self.doc", "arg_names": [], "import_names": [], "rhs_call_name": "Documentation", "annotation": ""}, "snippet": " self.doc = Documentation('[Documentation]', self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L485_C8", "label": "self.args = Arguments()", "type": "assigned_variable", "loc": [485, 485], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L481_C4", "vector": [14, 2, 0.8435, 0.0017, 2, 0.59, 0.4286, 640, 3, 2, 0, 0, 446, 10, 1], "semantic": {"name": "self.args", "arg_names": [], "import_names": [], "rhs_call_name": "Arguments", "annotation": ""}, "snippet": " self.args = Arguments('[Arguments]', self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L486_C8", "label": "self.return_ = Return()", "type": "assigned_variable", "loc": [486, 486], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L481_C4", "vector": [14, 2, 0.8452, 0.0017, 2, 0.59, 0.5714, 916, 3, 2, 0, 0, 50, 10, 1], "semantic": {"name": "self.return_", "arg_names": [], "import_names": [], "rhs_call_name": "Return", "annotation": ""}, "snippet": " self.return_ = Return('[Return]', self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L487_C8", "label": "self.timeout = Timeout()", "type": "assigned_variable", "loc": [487, 487], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L481_C4", "vector": [14, 2, 0.847, 0.0017, 2, 0.59, 0.7143, 621, 3, 2, 0, 0, 508, 10, 1], "semantic": {"name": "self.timeout", "arg_names": [], "import_names": [], "rhs_call_name": "Timeout", "annotation": ""}, "snippet": " self.timeout = Timeout('[Timeout]', self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L488_C8", "label": "self.teardown = Fixture()", "type": "assigned_variable", "loc": [488, 488], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L481_C4", "vector": [14, 2, 0.8487, 0.0017, 2, 0.59, 0.8571, 281, 3, 2, 0, 0, 488, 10, 1], "semantic": {"name": "self.teardown", "arg_names": [], "import_names": [], "rhs_call_name": "Fixture", "annotation": ""}, "snippet": " self.teardown = Fixture('[Teardown]', self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L489_C8", "label": "self.steps =", "type": "assigned_variable", "loc": [489, 489], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L481_C4", "vector": [14, 2, 0.8504, 0.0017, 2, 0.59, 1.0, 300, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.steps", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.steps = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L491_C4", "label": "_setters =", "type": "assigned_variable", "loc": [491, 496], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L479_C0", "vector": [14, 1, 0.8583, 0.0104, 1, 0.35, 0.5, 702, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "_setters", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " _setters = {'documentation': lambda s: s.doc.populate,\n 'document': lambda s: s.doc.populate,\n 'arguments': lambda s: s.args.populate,\n 'return': lambda s: s.return_.populate,\n 'timeout': lambda s: s.timeout.populate,\n 'teardown': lambda s: s.teardown.populate}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L498_C4", "label": "__iter__", "type": "function", "loc": [498, 501], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L479_C0", "vector": [2, 1, 0.8687, 0.007, 1, 0.35, 1.0, 891, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "__iter__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __iter__(self):\n for element in [self.args, self.doc, self.timeout] \\\n + self.steps + [self.teardown, self.return_]:\n yield element"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:For_L499_C8", "label": "for element", "type": "for", "loc": [499, 501], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L498_C4", "vector": [6, 2, 0.8696, 0.0052, 2, 0.19, 0.0, 736, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "element", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for element in [self.args, self.doc, self.timeout] \\\n + self.steps + [self.teardown, self.return_]:\n yield element"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Expr_L501_C12", "label": "expression", "type": "expression", "loc": [501, 501], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:For_L499_C8", "vector": [8, 3, 0.8713, 0.0017, 3, 0.88, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " yield element"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L504_C0", "label": "ForLoop", "type": "class", "loc": [504, 532], "level": 0, "parent": null, "vector": [3, 0, 0.9009, 0.0504, 0, 0.66, 0.9615, 142, 0, 7, 0, 0, 963, 0, 6], "semantic": {"name": "ForLoop", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class ForLoop(_WithSteps):\n\n def __init__(self, content):\n self.range, index = self._get_range_and_index(content)\n self.vars = content[:index]\n self.items = content[index+1:]\n self.steps = []\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L506_C4", "label": "__init__", "type": "function", "loc": [506, 510], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L504_C0", "vector": [2, 1, 0.8835, 0.0087, 1, 0.59, 0.0, 555, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": ["self", "content"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, content):\n self.range, index = self._get_range_and_index(content)\n self.vars = content[:index]\n self.items = content[index+1:]\n self.steps = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L507_C8", "label": "index = _get_range_and_index()", "type": "assigned_variable", "loc": [507, 507], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L506_C4", "vector": [14, 2, 0.8817, 0.0017, 2, 0.23, 0.0, 780, 3, 1, 0, 0, 846, 10, 1], "semantic": {"name": "index", "arg_names": [], "import_names": [], "rhs_call_name": "_get_range_and_index", "annotation": ""}, "snippet": " self.range, index = self._get_range_and_index(content)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L508_C8", "label": "self.vars =", "type": "assigned_variable", "loc": [508, 508], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L506_C4", "vector": [14, 2, 0.8835, 0.0017, 2, 0.23, 0.3333, 359, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.vars", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.vars = content[:index]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L509_C8", "label": "self.items =", "type": "assigned_variable", "loc": [509, 509], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L506_C4", "vector": [14, 2, 0.8852, 0.0017, 2, 0.23, 0.6667, 11, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.items", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.items = content[index+1:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L510_C8", "label": "self.steps =", "type": "assigned_variable", "loc": [510, 510], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L506_C4", "vector": [14, 2, 0.887, 0.0017, 2, 0.23, 1.0, 300, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.steps", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.steps = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L512_C4", "label": "_get_range_and_index", "type": "function", "loc": [512, 517], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L504_C0", "vector": [2, 1, 0.8948, 0.0104, 1, 0.59, 0.1667, 846, 0, 2, 1, 0, 0, 0, 4], "semantic": {"name": "_get_range_and_index", "arg_names": ["self", "content"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _get_range_and_index(self, content):\n for index, item in enumerate(content):\n item = item.upper().replace(' ', '')\n if item in ['IN', 'INRANGE']:\n return item == 'INRANGE', index\n return False, len(content)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:For_L513_C8", "label": "for index, item", "type": "for", "loc": [513, 516], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L512_C4", "vector": [6, 2, 0.8948, 0.007, 2, 0.25, 0.0, 387, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "index, item", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for index, item in enumerate(content):\n item = item.upper().replace(' ', '')\n if item in ['IN', 'INRANGE']:\n return item == 'INRANGE', index"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L514_C12", "label": "item = replace()", "type": "assigned_variable", "loc": [514, 514], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:For_L513_C8", "vector": [14, 3, 0.8939, 0.0017, 3, 0.27, 0.0, 434, 3, 2, 0, 0, 293, 10, 2], "semantic": {"name": "item", "arg_names": [], "import_names": [], "rhs_call_name": "replace", "annotation": ""}, "snippet": " item = item.upper().replace(' ', '')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:If_L515_C12", "label": "if", "type": "if", "loc": [515, 516], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:For_L513_C8", "vector": [4, 3, 0.8965, 0.0035, 3, 0.27, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if item in ['IN', 'INRANGE']:\n return item == 'INRANGE', index"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Return_L516_C16", "label": "return", "type": "return", "loc": [516, 516], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:If_L515_C12", "vector": [13, 4, 0.8974, 0.0017, 4, 0.29, 0.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return item == 'INRANGE', index"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Return_L517_C8", "label": "return", "type": "return", "loc": [517, 517], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L512_C4", "vector": [13, 2, 0.8991, 0.0017, 2, 0.25, 1.0, 0, 0, 0, 0, 0, 0, 8, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return False, len(content)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L519_C4", "label": "is_comment", "type": "function", "loc": [519, 520], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L504_C0", "vector": [2, 1, 0.9035, 0.0035, 1, 0.59, 0.3333, 530, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "is_comment", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def is_comment(self):\n return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Return_L520_C8", "label": "return", "type": "return", "loc": [520, 520], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L519_C4", "vector": [13, 2, 0.9043, 0.0017, 2, 0.41, 0.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L522_C4", "label": "is_for_loop", "type": "function", "loc": [522, 523], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L504_C0", "vector": [2, 1, 0.9087, 0.0035, 1, 0.59, 0.5, 153, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "is_for_loop", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def is_for_loop(self):\n return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Return_L523_C8", "label": "return", "type": "return", "loc": [523, 523], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L522_C4", "vector": [13, 2, 0.9096, 0.0017, 2, 0.8, 0.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L525_C4", "label": "apply_template", "type": "function", "loc": [525, 526], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L504_C0", "vector": [2, 1, 0.9139, 0.0035, 1, 0.59, 0.6667, 927, 0, 2, 1, 0, 0, 0, 0], "semantic": {"name": "apply_template", "arg_names": ["self", "template"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def apply_template(self, template):\n return self"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Return_L526_C8", "label": "return", "type": "return", "loc": [526, 526], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L525_C4", "vector": [13, 2, 0.9148, 0.0017, 2, 0.54, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L528_C4", "label": "as_list", "type": "function", "loc": [528, 529], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L504_C0", "vector": [2, 1, 0.9191, 0.0035, 1, 0.59, 0.8333, 817, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "as_list", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def as_list(self):\n return [': FOR'] + self.vars + ['IN RANGE' if self.range else 'IN'] + self.items"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Return_L529_C8", "label": "return", "type": "return", "loc": [529, 529], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L528_C4", "vector": [13, 2, 0.92, 0.0017, 2, 0.89, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return [': FOR'] + self.vars + ['IN RANGE' if self.range else 'IN'] + self.items"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L531_C4", "label": "__iter__", "type": "function", "loc": [531, 532], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L504_C0", "vector": [2, 1, 0.9243, 0.0035, 1, 0.59, 1.0, 891, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "__iter__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __iter__(self):\n return iter(self.steps)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Return_L532_C8", "label": "return", "type": "return", "loc": [532, 532], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L531_C4", "vector": [13, 2, 0.9252, 0.0017, 2, 0.57, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return iter(self.steps)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L535_C0", "label": "Step", "type": "class", "loc": [535, 575], "level": 0, "parent": null, "vector": [3, 0, 0.9652, 0.0713, 0, 0.66, 1.0, 230, 0, 7, 0, 0, 186, 0, 11], "semantic": {"name": "Step", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Step(object):\n\n def __init__(self, content, comment=None):\n self.assign = self._get_assigned_vars(content)\n try:\n self.keyword = content[len(self.assign)]\n except IndexError:\n self.keyword = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L537_C4", "label": "__init__", "type": "function", "loc": [537, 544], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L535_C0", "vector": [2, 1, 0.94, 0.0139, 1, 0.24, 0.0, 555, 0, 3, 0, 0, 0, 0, 3], "semantic": {"name": "__init__", "arg_names": ["self", "content", "comment"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, content, comment=None):\n self.assign = self._get_assigned_vars(content)\n try:\n self.keyword = content[len(self.assign)]\n except IndexError:\n self.keyword = None\n self.args = content[len(self.assign)+1:]\n self.comment = comment"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L538_C8", "label": "self.assign = _get_assigned_vars()", "type": "assigned_variable", "loc": [538, 538], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L537_C4", "vector": [14, 2, 0.9357, 0.0017, 2, 0.91, 0.0, 112, 3, 1, 0, 0, 786, 10, 1], "semantic": {"name": "self.assign", "arg_names": [], "import_names": [], "rhs_call_name": "_get_assigned_vars", "annotation": ""}, "snippet": " self.assign = self._get_assigned_vars(content)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Try_L539_C8", "label": "try", "type": "try", "loc": [539, 542], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L537_C4", "vector": [7, 2, 0.94, 0.007, 2, 0.91, 0.3333, 0, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n self.keyword = content[len(self.assign)]\n except IndexError:\n self.keyword = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L540_C12", "label": "self.keyword =", "type": "assigned_variable", "loc": [540, 540], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:Try_L539_C8", "vector": [14, 3, 0.9391, 0.0017, 3, 0.94, 0.0, 388, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self.keyword", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.keyword = content[len(self.assign)]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L542_C12", "label": "self.keyword =", "type": "assigned_variable", "loc": [542, 542], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:Try_L539_C8", "vector": [14, 3, 0.9426, 0.0017, 3, 0.94, 0.0, 388, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.keyword", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.keyword = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L543_C8", "label": "self.args =", "type": "assigned_variable", "loc": [543, 543], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L537_C4", "vector": [14, 2, 0.9443, 0.0017, 2, 0.91, 0.6667, 640, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self.args", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.args = content[len(self.assign)+1:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L544_C8", "label": "self.comment =", "type": "assigned_variable", "loc": [544, 544], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L537_C4", "vector": [14, 2, 0.9461, 0.0017, 2, 0.91, 1.0, 450, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.comment", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.comment = comment"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L546_C4", "label": "_get_assigned_vars", "type": "function", "loc": [546, 552], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L535_C0", "vector": [2, 1, 0.9548, 0.0122, 1, 0.24, 0.1667, 786, 0, 2, 1, 0, 0, 0, 3], "semantic": {"name": "_get_assigned_vars", "arg_names": ["self", "content"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _get_assigned_vars(self, content):\n vars = []\n for item in content:\n if not is_var(item.rstrip('= ')):\n break\n vars.append(item)\n return vars"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L547_C8", "label": "vars =", "type": "assigned_variable", "loc": [547, 547], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L546_C4", "vector": [14, 2, 0.9513, 0.0017, 2, 0.56, 0.0, 302, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "vars", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " vars = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:For_L548_C8", "label": "for item", "type": "for", "loc": [548, 551], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L546_C4", "vector": [6, 2, 0.9557, 0.007, 2, 0.56, 0.5, 434, 2, 0, 0, 0, 0, 0, 3], "semantic": {"name": "item", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for item in content:\n if not is_var(item.rstrip('= ')):\n break\n vars.append(item)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:If_L549_C12", "label": "if", "type": "if", "loc": [549, 550], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:For_L548_C8", "vector": [4, 3, 0.9557, 0.0035, 3, 0.25, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not is_var(item.rstrip('= ')):\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Expr_L551_C12", "label": "append()", "type": "expression", "loc": [551, 551], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:For_L548_C8", "vector": [8, 3, 0.9583, 0.0017, 3, 0.25, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " vars.append(item)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Return_L552_C8", "label": "return", "type": "return", "loc": [552, 552], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L546_C4", "vector": [13, 2, 0.96, 0.0017, 2, 0.56, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return vars"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L554_C4", "label": "is_comment", "type": "function", "loc": [554, 555], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L535_C0", "vector": [2, 1, 0.9643, 0.0035, 1, 0.24, 0.3333, 530, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "is_comment", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def is_comment(self):\n return not (self.assign or self.keyword or self.args)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Return_L555_C8", "label": "return", "type": "return", "loc": [555, 555], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L554_C4", "vector": [13, 2, 0.9652, 0.0017, 2, 0.82, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return not (self.assign or self.keyword or self.args)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L557_C4", "label": "is_for_loop", "type": "function", "loc": [557, 558], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L535_C0", "vector": [2, 1, 0.9696, 0.0035, 1, 0.24, 0.5, 153, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "is_for_loop", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def is_for_loop(self):\n return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Return_L558_C8", "label": "return", "type": "return", "loc": [558, 558], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L557_C4", "vector": [13, 2, 0.9704, 0.0017, 2, 0.02, 0.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L560_C4", "label": "apply_template", "type": "function", "loc": [560, 563], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L535_C0", "vector": [2, 1, 0.9765, 0.007, 1, 0.24, 0.6667, 927, 0, 2, 1, 0, 0, 0, 3], "semantic": {"name": "apply_template", "arg_names": ["self", "template"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def apply_template(self, template):\n if self.is_comment():\n return self\n return Step([template] + self.as_list(include_comment=False))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:If_L561_C8", "label": "if", "type": "if", "loc": [561, 562], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L560_C4", "vector": [4, 2, 0.9765, 0.0035, 2, 0.04, 0.0, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.is_comment():\n return self"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Return_L562_C12", "label": "return", "type": "return", "loc": [562, 562], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:If_L561_C8", "vector": [13, 3, 0.9774, 0.0017, 3, 0.66, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Return_L563_C8", "label": "return", "type": "return", "loc": [563, 563], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L560_C4", "vector": [13, 2, 0.9791, 0.0017, 2, 0.04, 1.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return Step([template] + self.as_list(include_comment=False))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L565_C4", "label": "is_set", "type": "function", "loc": [565, 566], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L535_C0", "vector": [2, 1, 0.9835, 0.0035, 1, 0.24, 0.8333, 896, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "is_set", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def is_set(self):\n return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Return_L566_C8", "label": "return", "type": "return", "loc": [566, 566], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L565_C4", "vector": [13, 2, 0.9843, 0.0017, 2, 0.04, 0.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L568_C4", "label": "as_list", "type": "function", "loc": [568, 575], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L535_C0", "vector": [2, 1, 0.9939, 0.0139, 1, 0.24, 1.0, 817, 0, 3, 1, 0, 0, 0, 2], "semantic": {"name": "as_list", "arg_names": ["self", "indent", "include_comment"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def as_list(self, indent=False, include_comment=True):\n kw = [self.keyword] if self.keyword is not None else []\n ret = self.assign + kw + self.args\n if indent:\n ret.insert(0, '')\n if include_comment and self.comment:\n ret.append('# %s' % self.comment)\n return ret"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L569_C8", "label": "kw =", "type": "assigned_variable", "loc": [569, 569], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L568_C4", "vector": [14, 2, 0.9896, 0.0017, 2, 0.97, 0.0, 755, 8, 0, 0, 0, 0, 0, 0], "semantic": {"name": "kw", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " kw = [self.keyword] if self.keyword is not None else []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L570_C8", "label": "ret =", "type": "assigned_variable", "loc": [570, 570], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L568_C4", "vector": [14, 2, 0.9913, 0.0017, 2, 0.97, 0.25, 501, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ret", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ret = self.assign + kw + self.args"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:If_L571_C8", "label": "if", "type": "if", "loc": [571, 572], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L568_C4", "vector": [4, 2, 0.9939, 0.0035, 2, 0.97, 0.5, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if indent:\n ret.insert(0, '')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Expr_L572_C12", "label": "insert()", "type": "expression", "loc": [572, 572], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:If_L571_C8", "vector": [8, 3, 0.9948, 0.0017, 3, 0.68, 0.0, 368, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "insert", "arg_names": [], "import_names": [], "rhs_call_name": "insert", "annotation": ""}, "snippet": " ret.insert(0, '')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:If_L573_C8", "label": "if", "type": "if", "loc": [573, 574], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L568_C4", "vector": [4, 2, 0.9974, 0.0035, 2, 0.97, 0.75, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if include_comment and self.comment:\n ret.append('# %s' % self.comment)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Expr_L574_C12", "label": "append()", "type": "expression", "loc": [574, 574], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:If_L573_C8", "vector": [8, 3, 0.9983, 0.0017, 3, 0.71, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " ret.append('# %s' % self.comment)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99874:Return_L575_C8", "label": "return", "type": "return", "loc": [575, 575], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L568_C4", "vector": [13, 2, 1.0, 0.0017, 2, 0.97, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ret"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:If_L28_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:If_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Return_L29_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Return_L30_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L33_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L35_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L35_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L36_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L35_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L37_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L35_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L38_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L35_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L39_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L33_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L41_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L41_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:If_L42_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:If_L42_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L43_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L41_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Return_L54_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L33_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L56_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L56_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L57_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L56_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Try_L58_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:Try_L58_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L59_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:Try_L58_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Return_L61_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:Try_L58_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:If_L63_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:If_L63_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Expr_L64_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:Try_L58_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Return_L65_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L33_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L68_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L68_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:If_L69_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:If_L69_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Return_L70_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L68_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L71_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L68_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L72_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L68_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L73_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L68_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:If_L74_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:If_L74_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L75_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L68_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Return_L76_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L33_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L78_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L78_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Return_L79_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L33_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L82_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L82_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Return_L83_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L33_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L86_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L86_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Return_L87_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L33_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L89_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L89_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L90_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L89_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L91_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L89_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Expr_L92_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L96_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L98_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L98_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Expr_L99_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L98_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L100_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L98_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L101_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L98_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L102_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L98_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L103_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L98_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L104_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L98_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:If_L105_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:If_L105_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Expr_L106_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:If_L105_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Expr_L107_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L96_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L109_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L109_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:If_L110_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L96_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L113_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L113_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Return_L114_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L96_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L116_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L116_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Return_L117_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L96_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L119_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L119_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:For_L120_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:For_L120_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Expr_L122_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L125_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L127_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L127_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Expr_L128_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L127_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L129_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L127_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L130_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L127_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L131_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L127_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L132_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L127_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L133_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L127_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:If_L134_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:If_L134_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Expr_L135_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:If_L134_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Expr_L136_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L125_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L138_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L138_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:If_L139_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:If_L139_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Expr_L140_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:If_L139_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Expr_L143_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L125_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L145_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L145_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:If_L146_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L145_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Return_L149_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L125_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L151_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L151_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:For_L152_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:For_L152_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Expr_L154_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L157_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L159_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L159_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Expr_L160_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L159_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L161_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L159_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L162_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L159_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L163_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L159_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L164_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L159_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L165_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L159_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L166_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L159_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:If_L167_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:If_L167_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Expr_L168_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:If_L167_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L169_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L157_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L171_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L171_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Return_L172_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L157_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L174_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L174_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:If_L175_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:If_L175_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Expr_L176_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:If_L175_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Return_L178_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L174_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Return_L179_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L157_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L181_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L181_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Expr_L182_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L157_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L185_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L185_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Return_L186_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L157_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L188_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L188_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:For_L189_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:For_L189_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Expr_L191_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L194_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L196_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L196_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L197_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L196_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L198_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L194_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L200_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L200_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L201_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L194_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L204_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L204_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Return_L205_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L194_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L208_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L208_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Return_L209_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L194_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L212_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L212_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Return_L213_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L194_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L215_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L215_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Expr_L216_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L219_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L221_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L221_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L222_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L221_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:If_L223_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:If_L223_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Return_L224_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L221_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Expr_L225_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L219_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L227_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L227_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Return_L228_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L219_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L230_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L230_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L231_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L230_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Return_L232_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L234_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L235_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L234_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L237_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L237_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Expr_L238_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L237_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L239_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L237_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L240_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L237_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L241_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L237_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L242_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L237_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L243_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L237_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L244_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L237_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L245_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L237_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L246_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L237_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L247_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L237_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L248_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L237_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L249_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L234_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L251_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L251_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L252_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L252_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L253_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L252_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Expr_L254_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L251_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Return_L255_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L234_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L257_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L257_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Expr_L258_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L257_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Return_L259_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L234_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L261_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L261_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Expr_L262_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L261_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Return_L263_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L234_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L265_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L265_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Expr_L266_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L265_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Return_L267_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L234_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L269_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L269_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Expr_L270_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L269_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Return_L271_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L234_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L273_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L273_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Return_L274_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L277_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L279_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L277_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L298_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L298_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:For_L299_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:For_L299_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Expr_L303_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L306_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L308_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L306_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L314_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L314_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:For_L315_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:For_L315_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Expr_L316_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L319_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L321_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L319_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L337_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L337_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:For_L338_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:For_L338_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Expr_L341_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L344_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L345_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L344_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L347_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L347_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Expr_L348_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L347_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L349_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L344_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L351_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L351_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Expr_L352_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L344_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L354_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L354_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Return_L355_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L344_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L357_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L357_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Return_L358_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L361_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L362_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L361_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L364_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L364_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Expr_L365_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L364_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L366_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L361_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L368_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L368_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Expr_L369_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L368_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Return_L370_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L361_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L372_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L372_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Return_L373_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L361_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L375_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L375_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Return_L376_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L361_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L378_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L378_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Return_L379_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L382_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L383_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L382_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L385_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L385_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Expr_L386_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L385_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L387_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L382_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L389_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L389_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Expr_L390_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L389_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Return_L391_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L382_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L393_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L393_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Return_L394_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L382_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L396_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L396_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Return_L397_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L400_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L402_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L402_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L403_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L402_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:If_L404_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:If_L404_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L405_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L402_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:If_L406_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:If_L406_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L407_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L402_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L408_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L402_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L409_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L400_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L411_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L411_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L412_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L411_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:If_L413_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:If_L413_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Expr_L414_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L411_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Return_L415_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L400_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L417_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L417_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Return_L418_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L400_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L420_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L420_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Return_L421_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L424_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L426_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L426_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Expr_L427_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L426_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Return_L428_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L431_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L433_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L433_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L434_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L433_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L435_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L433_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L436_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L433_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L437_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L433_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L438_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L433_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L439_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L433_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L440_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L433_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L441_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L433_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L442_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L431_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L444_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L431_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L456_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L456_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Return_L457_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L431_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L460_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L460_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Return_L461_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L431_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L463_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L463_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Expr_L464_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L463_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Return_L465_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L431_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L467_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L467_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L468_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L467_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L469_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L467_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Expr_L470_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L431_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L472_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L472_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:For_L473_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:For_L473_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Expr_L476_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L479_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L481_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L481_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L482_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L481_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L483_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L481_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L484_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L481_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L485_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L481_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L486_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L481_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L487_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L481_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L488_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L481_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L489_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L479_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L491_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L479_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L498_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L498_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:For_L499_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:For_L499_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Expr_L501_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L504_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L506_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L506_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L507_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L506_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L508_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L506_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L509_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L506_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L510_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L504_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L512_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L512_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:For_L513_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:For_L513_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L514_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:For_L513_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:If_L515_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:If_L515_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Return_L516_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L512_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Return_L517_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L504_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L519_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L519_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Return_L520_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L504_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L522_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L522_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Return_L523_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L504_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L525_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L525_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Return_L526_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L504_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L528_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L528_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Return_L529_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L504_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L531_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L531_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Return_L532_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L535_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L537_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L537_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L538_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L537_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Try_L539_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:Try_L539_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L540_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:Try_L539_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L542_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L537_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L543_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L537_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L544_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L535_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L546_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L546_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L547_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L546_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:For_L548_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:For_L548_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:If_L549_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:For_L548_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Expr_L551_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L546_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Return_L552_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L535_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L554_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L554_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Return_L555_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L535_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L557_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L557_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Return_L558_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L535_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L560_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L560_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:If_L561_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:If_L561_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Return_L562_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L560_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Return_L563_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L535_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L565_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L565_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Return_L566_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:ClassDef_L535_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L568_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L568_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L569_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L568_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Assign_L570_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L568_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:If_L571_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:If_L571_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Expr_L572_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L568_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:If_L573_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:If_L573_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Expr_L574_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99874:FunctionDef_L568_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99874:Return_L575_C8"}] |
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import re
from tsvreader import TsvReader
class TxtReader(TsvReader):
_space_splitter = re.compile(' {2,}')
_pipe_splitter = re.compile(' \|(?= )')
def _split_row(self, row):
row = row.rstrip().replace('\t', ' ')
if not row.startswith('| '):
return self._space_splitter.split(row)
if row.endswith(' |'):
row = row[1:-1]
else:
row = row[1:]
return self._pipe_splitter.split(row)
def _process(self, cell):
return cell.decode('UTF-8')
| ajibawa-2023/Python-Code-Large/train/row_99875 | 15 | 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_99875:Import_L15_C0", "label": "re import re", "type": "import", "loc": [15, 15], "level": 0, "parent": null, "vector": [1, 0, 0.4167, 0.0278, 0, 0.66, 0.0, 540, 0, 1, 0, 0, 540, 0, 0], "semantic": {"name": "re", "arg_names": [], "import_names": ["re"], "rhs_call_name": "", "annotation": ""}, "snippet": "import re"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99875:ImportFrom_L17_C0", "label": "from tsvreader import TsvReader", "type": "import", "loc": [17, 17], "level": 0, "parent": null, "vector": [1, 0, 0.4722, 0.0278, 0, 0.66, 0.5, 276, 0, 1, 0, 0, 276, 0, 0], "semantic": {"name": "tsvreader", "arg_names": [], "import_names": ["TsvReader"], "rhs_call_name": "", "annotation": ""}, "snippet": "from tsvreader import TsvReader"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99875:ClassDef_L20_C0", "label": "TxtReader", "type": "class", "loc": [20, 36], "level": 0, "parent": null, "vector": [3, 0, 0.7778, 0.4722, 0, 0.66, 1.0, 461, 0, 2, 0, 0, 619, 0, 9], "semantic": {"name": "TxtReader", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class TxtReader(TsvReader):\n\n _space_splitter = re.compile(' {2,}')\n _pipe_splitter = re.compile(' \\|(?= )')\n\n def _split_row(self, row):\n row = row.rstrip().replace('\\t', ' ')\n if not row.startswith('| '):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99875:Assign_L22_C4", "label": "_space_splitter = compile()", "type": "assigned_variable", "loc": [22, 22], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99875:ClassDef_L20_C0", "vector": [14, 1, 0.6111, 0.0278, 1, 0.15, 0.0, 305, 3, 1, 0, 0, 821, 10, 1], "semantic": {"name": "_space_splitter", "arg_names": [], "import_names": [], "rhs_call_name": "compile", "annotation": ""}, "snippet": " _space_splitter = re.compile(' {2,}')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99875:Assign_L23_C4", "label": "_pipe_splitter = compile()", "type": "assigned_variable", "loc": [23, 23], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99875:ClassDef_L20_C0", "vector": [14, 1, 0.6389, 0.0278, 1, 0.15, 0.3333, 173, 3, 1, 0, 0, 821, 10, 1], "semantic": {"name": "_pipe_splitter", "arg_names": [], "import_names": [], "rhs_call_name": "compile", "annotation": ""}, "snippet": " _pipe_splitter = re.compile(' \\|(?= )')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99875:FunctionDef_L25_C4", "label": "_split_row", "type": "function", "loc": [25, 33], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99875:ClassDef_L20_C0", "vector": [2, 1, 0.8056, 0.25, 1, 0.15, 0.6667, 633, 0, 2, 1, 0, 0, 0, 6], "semantic": {"name": "_split_row", "arg_names": ["self", "row"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _split_row(self, row):\n row = row.rstrip().replace('\\t', ' ')\n if not row.startswith('| '):\n return self._space_splitter.split(row)\n if row.endswith(' |'):\n row = row[1:-1]\n else:\n row = row[1:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99875:Assign_L26_C8", "label": "row = replace()", "type": "assigned_variable", "loc": [26, 26], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99875:FunctionDef_L25_C4", "vector": [14, 2, 0.7222, 0.0278, 2, 0.97, 0.0, 767, 3, 2, 0, 0, 293, 10, 2], "semantic": {"name": "row", "arg_names": [], "import_names": [], "rhs_call_name": "replace", "annotation": ""}, "snippet": " row = row.rstrip().replace('\\t', ' ')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99875:If_L27_C8", "label": "if", "type": "if", "loc": [27, 28], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99875:FunctionDef_L25_C4", "vector": [4, 2, 0.7639, 0.0556, 2, 0.97, 0.3333, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not row.startswith('| '):\n return self._space_splitter.split(row)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99875:Return_L28_C12", "label": "return", "type": "return", "loc": [28, 28], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99875:If_L27_C8", "vector": [13, 3, 0.7778, 0.0278, 3, 0.15, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._space_splitter.split(row)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99875:If_L29_C8", "label": "if", "type": "if", "loc": [29, 32], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99875:FunctionDef_L25_C4", "vector": [4, 2, 0.8472, 0.1111, 2, 0.97, 0.6667, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if row.endswith(' |'):\n row = row[1:-1]\n else:\n row = row[1:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99875:Assign_L30_C12", "label": "row =", "type": "assigned_variable", "loc": [30, 30], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99875:If_L29_C8", "vector": [14, 3, 0.8333, 0.0278, 3, 0.34, 0.0, 767, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "row", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " row = row[1:-1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99875:Assign_L32_C12", "label": "row =", "type": "assigned_variable", "loc": [32, 32], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99875:If_L29_C8", "vector": [14, 3, 0.8889, 0.0278, 3, 0.34, 1.0, 767, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "row", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " row = row[1:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99875:Return_L33_C8", "label": "return", "type": "return", "loc": [33, 33], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99875:FunctionDef_L25_C4", "vector": [13, 2, 0.9167, 0.0278, 2, 0.97, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._pipe_splitter.split(row)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99875:FunctionDef_L35_C4", "label": "_process", "type": "function", "loc": [35, 36], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99875:ClassDef_L20_C0", "vector": [2, 1, 0.9861, 0.0556, 1, 0.15, 1.0, 99, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "_process", "arg_names": ["self", "cell"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _process(self, cell):\n return cell.decode('UTF-8')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99875:Return_L36_C8", "label": "return", "type": "return", "loc": [36, 36], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99875:FunctionDef_L35_C4", "vector": [13, 2, 1.0, 0.0278, 2, 0.55, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return cell.decode('UTF-8')"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99875:ClassDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99875:Assign_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99875:ClassDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99875:Assign_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99875:ClassDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99875:FunctionDef_L25_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99875:FunctionDef_L25_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99875:Assign_L26_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99875:FunctionDef_L25_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99875:If_L27_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99875:If_L27_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99875:Return_L28_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99875:FunctionDef_L25_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99875:If_L29_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99875:If_L29_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99875:Assign_L30_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99875:If_L29_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99875:Assign_L32_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99875:FunctionDef_L25_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99875:Return_L33_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99875:ClassDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99875:FunctionDef_L35_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99875:FunctionDef_L35_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99875:Return_L36_C8"}] |
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from codecs import BOM_UTF8
class TsvReader:
def read(self, tsvfile, populator):
process = False
for index, row in enumerate(tsvfile.readlines()):
if index == 0 and row.startswith(BOM_UTF8):
row = row[len(BOM_UTF8):]
cells = [ self._process(cell) for cell in self._split_row(row) ]
name = cells and cells[0].strip() or ''
if name.startswith('*') and populator.start_table([ c.replace('*','') for c in cells ]):
process = True
elif process:
populator.add(cells)
populator.eof()
def _split_row(self, row):
return row.rstrip().split('\t')
def _process(self, cell):
if len(cell) > 1 and cell[0] == cell[-1] == '"':
cell = cell[1:-1].replace('""','"')
return cell.decode('UTF-8')
| ajibawa-2023/Python-Code-Large/train/row_99876 | 20 | 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_99876:ImportFrom_L15_C0", "label": "from codecs import BOM_UTF8", "type": "import", "loc": [15, 15], "level": 0, "parent": null, "vector": [1, 0, 0.3846, 0.0256, 0, 0.66, 0.0, 220, 0, 1, 0, 0, 220, 0, 0], "semantic": {"name": "codecs", "arg_names": [], "import_names": ["BOM_UTF8"], "rhs_call_name": "", "annotation": ""}, "snippet": "from codecs import BOM_UTF8"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99876:ClassDef_L18_C0", "label": "TsvReader", "type": "class", "loc": [18, 39], "level": 0, "parent": null, "vector": [3, 0, 0.7308, 0.5641, 0, 0.66, 1.0, 619, 0, 3, 0, 0, 0, 0, 17], "semantic": {"name": "TsvReader", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class TsvReader:\n\n def read(self, tsvfile, populator):\n process = False\n for index, row in enumerate(tsvfile.readlines()):\n if index == 0 and row.startswith(BOM_UTF8):\n row = row[len(BOM_UTF8):]\n cells = [ self._process(cell) for cell in self._split_row(row) ]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99876:FunctionDef_L20_C4", "label": "read", "type": "function", "loc": [20, 31], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99876:ClassDef_L18_C0", "vector": [2, 1, 0.6538, 0.3077, 1, 0.81, 0.0, 453, 0, 3, 0, 0, 0, 0, 12], "semantic": {"name": "read", "arg_names": ["self", "tsvfile", "populator"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def read(self, tsvfile, populator):\n process = False\n for index, row in enumerate(tsvfile.readlines()):\n if index == 0 and row.startswith(BOM_UTF8):\n row = row[len(BOM_UTF8):]\n cells = [ self._process(cell) for cell in self._split_row(row) ]\n name = cells and cells[0].strip() or ''\n if name.startswith('*') and populator.start_table([ c.replace('*','') for c in cells ]):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99876:Assign_L21_C8", "label": "process =", "type": "assigned_variable", "loc": [21, 21], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99876:FunctionDef_L20_C4", "vector": [14, 2, 0.5385, 0.0256, 2, 0.81, 0.0, 712, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "process", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " process = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99876:For_L22_C8", "label": "for index, row", "type": "for", "loc": [22, 30], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99876:FunctionDef_L20_C4", "vector": [6, 2, 0.6667, 0.2308, 2, 0.81, 0.5, 810, 3, 0, 0, 0, 0, 0, 11], "semantic": {"name": "index, row", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for index, row in enumerate(tsvfile.readlines()):\n if index == 0 and row.startswith(BOM_UTF8):\n row = row[len(BOM_UTF8):]\n cells = [ self._process(cell) for cell in self._split_row(row) ]\n name = cells and cells[0].strip() or ''\n if name.startswith('*') and populator.start_table([ c.replace('*','') for c in cells ]):\n process = True\n elif process:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99876:If_L23_C12", "label": "if", "type": "if", "loc": [23, 24], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99876:For_L22_C8", "vector": [4, 3, 0.6026, 0.0513, 3, 0.92, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if index == 0 and row.startswith(BOM_UTF8):\n row = row[len(BOM_UTF8):]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99876:Assign_L24_C16", "label": "row =", "type": "assigned_variable", "loc": [24, 24], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99876:If_L23_C12", "vector": [14, 4, 0.6154, 0.0256, 4, 0.19, 0.0, 767, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "row", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " row = row[len(BOM_UTF8):]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99876:Assign_L25_C12", "label": "cells =", "type": "assigned_variable", "loc": [25, 25], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99876:For_L22_C8", "vector": [14, 3, 0.641, 0.0256, 3, 0.92, 0.3333, 757, 5, 0, 0, 0, 0, 0, 2], "semantic": {"name": "cells", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cells = [ self._process(cell) for cell in self._split_row(row) ]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99876:Assign_L26_C12", "label": "name =", "type": "assigned_variable", "loc": [26, 26], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99876:For_L22_C8", "vector": [14, 3, 0.6667, 0.0256, 3, 0.92, 0.6667, 57, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " name = cells and cells[0].strip() or ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99876:If_L27_C12", "label": "if", "type": "if", "loc": [27, 30], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99876:For_L22_C8", "vector": [4, 3, 0.7308, 0.1026, 3, 0.92, 1.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if name.startswith('*') and populator.start_table([ c.replace('*','') for c in cells ]):\n process = True\n elif process:\n populator.add(cells)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99876:Assign_L28_C16", "label": "process =", "type": "assigned_variable", "loc": [28, 28], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99876:If_L27_C12", "vector": [14, 4, 0.7179, 0.0256, 4, 0.64, 0.0, 712, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "process", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " process = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99876:If_L29_C12", "label": "if", "type": "if", "loc": [29, 30], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99876:If_L27_C12", "vector": [4, 4, 0.7564, 0.0513, 4, 0.64, 1.0, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif process:\n populator.add(cells)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99876:Expr_L30_C16", "label": "add()", "type": "expression", "loc": [30, 30], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99876:If_L29_C12", "vector": [8, 5, 0.7692, 0.0256, 5, 0.6, 0.0, 241, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " populator.add(cells)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99876:Expr_L31_C8", "label": "eof()", "type": "expression", "loc": [31, 31], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99876:FunctionDef_L20_C4", "vector": [8, 2, 0.7949, 0.0256, 2, 0.81, 1.0, 797, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "eof", "arg_names": [], "import_names": [], "rhs_call_name": "eof", "annotation": ""}, "snippet": " populator.eof()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99876:FunctionDef_L33_C4", "label": "_split_row", "type": "function", "loc": [33, 34], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99876:ClassDef_L18_C0", "vector": [2, 1, 0.859, 0.0513, 1, 0.81, 0.5, 633, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "_split_row", "arg_names": ["self", "row"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _split_row(self, row):\n return row.rstrip().split('\\t')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99876:Return_L34_C8", "label": "return", "type": "return", "loc": [34, 34], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99876:FunctionDef_L33_C4", "vector": [13, 2, 0.8718, 0.0256, 2, 0.49, 0.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return row.rstrip().split('\\t')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99876:FunctionDef_L36_C4", "label": "_process", "type": "function", "loc": [36, 39], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99876:ClassDef_L18_C0", "vector": [2, 1, 0.9615, 0.1026, 1, 0.81, 1.0, 99, 0, 2, 1, 0, 0, 0, 3], "semantic": {"name": "_process", "arg_names": ["self", "cell"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _process(self, cell):\n if len(cell) > 1 and cell[0] == cell[-1] == '\"':\n cell = cell[1:-1].replace('\"\"','\"')\n return cell.decode('UTF-8')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99876:If_L37_C8", "label": "if", "type": "if", "loc": [37, 38], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99876:FunctionDef_L36_C4", "vector": [4, 2, 0.9615, 0.0513, 2, 0.55, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(cell) > 1 and cell[0] == cell[-1] == '\"':\n cell = cell[1:-1].replace('\"\"','\"')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99876:Assign_L38_C12", "label": "cell = replace()", "type": "assigned_variable", "loc": [38, 38], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99876:If_L37_C8", "vector": [14, 3, 0.9744, 0.0256, 3, 0.35, 0.0, 787, 3, 2, 0, 0, 293, 10, 1], "semantic": {"name": "cell", "arg_names": [], "import_names": [], "rhs_call_name": "replace", "annotation": ""}, "snippet": " cell = cell[1:-1].replace('\"\"','\"')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99876:Return_L39_C8", "label": "return", "type": "return", "loc": [39, 39], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99876:FunctionDef_L36_C4", "vector": [13, 2, 1.0, 0.0256, 2, 0.55, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return cell.decode('UTF-8')"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99876:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99876:FunctionDef_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99876:FunctionDef_L20_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99876:Assign_L21_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99876:FunctionDef_L20_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99876:For_L22_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99876:For_L22_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99876:If_L23_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99876:If_L23_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99876:Assign_L24_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99876:For_L22_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99876:Assign_L25_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99876:For_L22_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99876:Assign_L26_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99876:For_L22_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99876:If_L27_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99876:If_L27_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99876:Assign_L28_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99876:If_L27_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99876:If_L29_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99876:If_L29_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99876:Expr_L30_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99876:FunctionDef_L20_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99876:Expr_L31_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99876:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99876:FunctionDef_L33_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99876:FunctionDef_L33_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99876:Return_L34_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99876:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99876:FunctionDef_L36_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99876:FunctionDef_L36_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99876:If_L37_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99876:If_L37_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99876:Assign_L38_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99876:FunctionDef_L36_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99876:Return_L39_C8"}] |
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
class _Setting(object):
def __init__(self, setting_name, parent=None, comment=None):
self.setting_name = setting_name
self.parent = parent
self.comment = comment
self.reset()
def reset(self):
self.value = []
@property
def source(self):
return self.parent.source if self.parent else None
@property
def directory(self):
return self.parent.directory if self.parent else None
def populate(self, value, comment=None):
"""Mainly used at parsing time, later attributes can be set directly."""
self._populate(value)
self.comment = comment
def _populate(self, value):
self.value = value
def is_set(self):
return bool(self.value)
def is_for_loop(self):
return False
def report_invalid_syntax(self, message, level='ERROR'):
self.parent.report_invalid_syntax(message, level)
def _string_value(self, value):
return value if isinstance(value, basestring) else ' '.join(value)
def _concat_string_with_value(self, string, value):
if string:
return string + ' ' + self._string_value(value)
return self._string_value(value)
def as_list(self):
ret = self._data_as_list()
if self.comment:
ret.append('# %s' % self.comment)
return ret
def _data_as_list(self):
ret = [self.setting_name]
if self.value:
ret.extend(self.value)
return ret
class Documentation(_Setting):
def reset(self):
self.value = ''
def _populate(self, value):
self.value = self._concat_string_with_value(self.value, value)
def _data_as_list(self):
return [self.setting_name, self.value]
class Template(_Setting):
def reset(self):
self.value = None
def _populate(self, value):
self.value = self._concat_string_with_value(self.value, value)
def is_set(self):
return self.value is not None
def _data_as_list(self):
ret = [self.setting_name]
if self.value:
ret.append(self.value)
return ret
class Fixture(_Setting):
def reset(self):
self.name = None
self.args = []
def _populate(self, value):
if not self.name:
self.name = value[0] if value else ''
value = value[1:]
self.args.extend(value)
def is_set(self):
return self.name is not None
def _data_as_list(self):
ret = [self.setting_name]
if self.name or self.args:
ret.append(self.name or '')
if self.args:
ret.extend(self.args)
return ret
class Timeout(_Setting):
def reset(self):
self.value = None
self.message = ''
def _populate(self, value):
if not self.value:
self.value = value[0] if value else ''
value = value[1:]
self.message = self._concat_string_with_value(self.message, value)
def is_set(self):
return self.value is not None
def _data_as_list(self):
ret = [self.setting_name]
if self.value or self.message:
ret.append(self.value or '')
if self.message:
ret.append(self.message)
return ret
class Tags(_Setting):
def reset(self):
self.value = None
def _populate(self, value):
self.value = (self.value or []) + value
def is_set(self):
return self.value is not None
def __add__(self, other):
if not isinstance(other, Tags):
raise TypeError('Tags can only be added with tags')
tags = Tags('Tags')
tags.value = (self.value or []) + (other.value or [])
return tags
class Arguments(_Setting):
pass
class Return(_Setting):
pass
class Metadata(_Setting):
def __init__(self, setting_name, parent, name, value, comment=None):
self.setting_name = setting_name
self.parent = parent
self.name = name
self.value = self._string_value(value)
self.comment = comment
def is_set(self):
return True
def _data_as_list(self):
return [self.setting_name, self.name, self.value]
class _Import(_Setting):
def __init__(self, parent, name, args=None, alias=None, comment=None):
self.parent = parent
self.name = name
self.args = args or []
self.alias = alias
self.comment = comment
@property
def type(self):
return type(self).__name__
def is_set(self):
return True
def _data_as_list(self):
return [self.type, self.name] + self.args
class Library(_Import):
def __init__(self, parent, name, args=None, alias=None, comment=None):
if args and not alias:
args, alias = self._split_alias(args)
_Import.__init__(self, parent, name, args, alias, comment)
def _split_alias(self, args):
if len(args) >= 2 and args[-2].upper() == 'WITH NAME':
return args[:-2], args[-1]
return args, None
def _data_as_list(self):
alias = ['WITH NAME', self.alias] if self.alias else []
return ['Library', self.name] + self.args + alias
class Resource(_Import):
def __init__(self, parent, name, invalid_args=None, comment=None):
if invalid_args:
name += ' ' + ' '.join(invalid_args)
_Import.__init__(self, parent, name, comment=comment)
class Variables(_Import):
def __init__(self, parent, name, args=None, comment=None):
_Import.__init__(self, parent, name, args, comment=comment)
| ajibawa-2023/Python-Code-Large/train/row_99877 | 152 | 242 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99877:ClassDef_L16_C0", "label": "_Setting", "type": "class", "loc": [16, 70], "level": 0, "parent": null, "vector": [3, 0, 0.1777, 0.2273, 0, 0.66, 0.0, 307, 0, 13, 0, 0, 186, 0, 11], "semantic": {"name": "_Setting", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class _Setting(object):\n\n def __init__(self, setting_name, parent=None, comment=None):\n self.setting_name = setting_name\n self.parent = parent\n self.comment = comment\n self.reset()\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L18_C4", "label": "__init__", "type": "function", "loc": [18, 22], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:ClassDef_L16_C0", "vector": [2, 1, 0.0826, 0.0207, 1, 0.81, 0.0, 555, 0, 4, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": ["self", "setting_name", "parent", "comment"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, setting_name, parent=None, comment=None):\n self.setting_name = setting_name\n self.parent = parent\n self.comment = comment\n self.reset()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:Assign_L19_C8", "label": "self.setting_name =", "type": "assigned_variable", "loc": [19, 19], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L18_C4", "vector": [14, 2, 0.0785, 0.0041, 2, 0.01, 0.0, 647, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.setting_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.setting_name = setting_name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:Assign_L20_C8", "label": "self.parent =", "type": "assigned_variable", "loc": [20, 20], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L18_C4", "vector": [14, 2, 0.0826, 0.0041, 2, 0.01, 0.3333, 428, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.parent", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.parent = parent"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:Assign_L21_C8", "label": "self.comment =", "type": "assigned_variable", "loc": [21, 21], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L18_C4", "vector": [14, 2, 0.0868, 0.0041, 2, 0.01, 0.6667, 450, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.comment", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.comment = comment"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:Expr_L22_C8", "label": "reset()", "type": "expression", "loc": [22, 22], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L18_C4", "vector": [8, 2, 0.0909, 0.0041, 2, 0.01, 1.0, 944, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "reset", "arg_names": [], "import_names": [], "rhs_call_name": "reset", "annotation": ""}, "snippet": " self.reset()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L24_C4", "label": "reset", "type": "function", "loc": [24, 25], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:ClassDef_L16_C0", "vector": [2, 1, 0.1012, 0.0083, 1, 0.81, 0.0833, 944, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "reset", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def reset(self):\n self.value = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:Assign_L25_C8", "label": "self.value =", "type": "assigned_variable", "loc": [25, 25], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L24_C4", "vector": [14, 2, 0.1033, 0.0041, 2, 0.13, 0.0, 966, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.value", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.value = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L28_C4", "label": "source", "type": "function", "loc": [28, 29], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:ClassDef_L16_C0", "vector": [2, 1, 0.1178, 0.0083, 1, 0.81, 0.1667, 703, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "source", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def source(self):\n return self.parent.source if self.parent else None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:Return_L29_C8", "label": "return", "type": "return", "loc": [29, 29], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L28_C4", "vector": [13, 2, 0.1198, 0.0041, 2, 0.87, 0.0, 0, 8, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.parent.source if self.parent else None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L32_C4", "label": "directory", "type": "function", "loc": [32, 33], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:ClassDef_L16_C0", "vector": [2, 1, 0.1343, 0.0083, 1, 0.81, 0.25, 229, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "directory", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def directory(self):\n return self.parent.directory if self.parent else None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:Return_L33_C8", "label": "return", "type": "return", "loc": [33, 33], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L32_C4", "vector": [13, 2, 0.1364, 0.0041, 2, 0.35, 0.0, 0, 8, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.parent.directory if self.parent else None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L35_C4", "label": "populate", "type": "function", "loc": [35, 38], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:ClassDef_L16_C0", "vector": [2, 1, 0.1508, 0.0165, 1, 0.81, 0.3333, 265, 0, 3, 0, 0, 0, 0, 1], "semantic": {"name": "populate", "arg_names": ["self", "value", "comment"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def populate(self, value, comment=None):\n \"\"\"Mainly used at parsing time, later attributes can be set directly.\"\"\"\n self._populate(value)\n self.comment = comment"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:Expr_L36_C8", "label": "expression", "type": "expression", "loc": [36, 36], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L35_C4", "vector": [8, 2, 0.1488, 0.0041, 2, 0.37, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Mainly used at parsing time, later attributes can be set directly.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:Expr_L37_C8", "label": "_populate()", "type": "expression", "loc": [37, 37], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L35_C4", "vector": [8, 2, 0.1529, 0.0041, 2, 0.37, 0.5, 179, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_populate", "arg_names": [], "import_names": [], "rhs_call_name": "_populate", "annotation": ""}, "snippet": " self._populate(value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:Assign_L38_C8", "label": "self.comment =", "type": "assigned_variable", "loc": [38, 38], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L35_C4", "vector": [14, 2, 0.157, 0.0041, 2, 0.37, 1.0, 450, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.comment", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.comment = comment"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L40_C4", "label": "_populate", "type": "function", "loc": [40, 41], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:ClassDef_L16_C0", "vector": [2, 1, 0.1674, 0.0083, 1, 0.81, 0.4167, 179, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "_populate", "arg_names": ["self", "value"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _populate(self, value):\n self.value = value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:Assign_L41_C8", "label": "self.value =", "type": "assigned_variable", "loc": [41, 41], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L40_C4", "vector": [14, 2, 0.1694, 0.0041, 2, 0.22, 0.0, 966, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.value", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.value = value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L43_C4", "label": "is_set", "type": "function", "loc": [43, 44], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:ClassDef_L16_C0", "vector": [2, 1, 0.1798, 0.0083, 1, 0.81, 0.5, 896, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "is_set", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def is_set(self):\n return bool(self.value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:Return_L44_C8", "label": "return", "type": "return", "loc": [44, 44], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L43_C4", "vector": [13, 2, 0.1818, 0.0041, 2, 0.19, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return bool(self.value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L46_C4", "label": "is_for_loop", "type": "function", "loc": [46, 47], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:ClassDef_L16_C0", "vector": [2, 1, 0.1921, 0.0083, 1, 0.81, 0.5833, 153, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "is_for_loop", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def is_for_loop(self):\n return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:Return_L47_C8", "label": "return", "type": "return", "loc": [47, 47], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L46_C4", "vector": [13, 2, 0.1942, 0.0041, 2, 0.82, 0.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L49_C4", "label": "report_invalid_syntax", "type": "function", "loc": [49, 50], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:ClassDef_L16_C0", "vector": [2, 1, 0.2045, 0.0083, 1, 0.81, 0.6667, 782, 0, 3, 0, 0, 0, 0, 1], "semantic": {"name": "report_invalid_syntax", "arg_names": ["self", "message", "level"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def report_invalid_syntax(self, message, level='ERROR'):\n self.parent.report_invalid_syntax(message, level)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:Expr_L50_C8", "label": "report_invalid_syntax()", "type": "expression", "loc": [50, 50], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L49_C4", "vector": [8, 2, 0.2066, 0.0041, 2, 0.19, 0.0, 782, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "report_invalid_syntax", "arg_names": [], "import_names": [], "rhs_call_name": "report_invalid_syntax", "annotation": ""}, "snippet": " self.parent.report_invalid_syntax(message, level)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L52_C4", "label": "_string_value", "type": "function", "loc": [52, 53], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:ClassDef_L16_C0", "vector": [2, 1, 0.2169, 0.0083, 1, 0.81, 0.75, 743, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "_string_value", "arg_names": ["self", "value"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _string_value(self, value):\n return value if isinstance(value, basestring) else ' '.join(value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:Return_L53_C8", "label": "return", "type": "return", "loc": [53, 53], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L52_C4", "vector": [13, 2, 0.219, 0.0041, 2, 0.79, 0.0, 0, 8, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return value if isinstance(value, basestring) else ' '.join(value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L55_C4", "label": "_concat_string_with_value", "type": "function", "loc": [55, 58], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:ClassDef_L16_C0", "vector": [2, 1, 0.2335, 0.0165, 1, 0.81, 0.8333, 289, 0, 3, 1, 0, 0, 0, 2], "semantic": {"name": "_concat_string_with_value", "arg_names": ["self", "string", "value"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _concat_string_with_value(self, string, value):\n if string:\n return string + ' ' + self._string_value(value)\n return self._string_value(value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:If_L56_C8", "label": "if", "type": "if", "loc": [56, 57], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L55_C4", "vector": [4, 2, 0.2335, 0.0083, 2, 0.55, 0.0, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if string:\n return string + ' ' + self._string_value(value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:Return_L57_C12", "label": "return", "type": "return", "loc": [57, 57], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:If_L56_C8", "vector": [13, 3, 0.2355, 0.0041, 3, 0.37, 0.0, 0, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return string + ' ' + self._string_value(value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:Return_L58_C8", "label": "return", "type": "return", "loc": [58, 58], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L55_C4", "vector": [13, 2, 0.2397, 0.0041, 2, 0.55, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._string_value(value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L60_C4", "label": "as_list", "type": "function", "loc": [60, 64], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:ClassDef_L16_C0", "vector": [2, 1, 0.2562, 0.0207, 1, 0.81, 0.9167, 817, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "as_list", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def as_list(self):\n ret = self._data_as_list()\n if self.comment:\n ret.append('# %s' % self.comment)\n return ret"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:Assign_L61_C8", "label": "ret = _data_as_list()", "type": "assigned_variable", "loc": [61, 61], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L60_C4", "vector": [14, 2, 0.2521, 0.0041, 2, 0.61, 0.0, 501, 3, 0, 0, 0, 796, 10, 1], "semantic": {"name": "ret", "arg_names": [], "import_names": [], "rhs_call_name": "_data_as_list", "annotation": ""}, "snippet": " ret = self._data_as_list()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:If_L62_C8", "label": "if", "type": "if", "loc": [62, 63], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L60_C4", "vector": [4, 2, 0.2583, 0.0083, 2, 0.61, 0.5, 0, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.comment:\n ret.append('# %s' % self.comment)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:Expr_L63_C12", "label": "append()", "type": "expression", "loc": [63, 63], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:If_L62_C8", "vector": [8, 3, 0.2603, 0.0041, 3, 0.44, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " ret.append('# %s' % self.comment)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:Return_L64_C8", "label": "return", "type": "return", "loc": [64, 64], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L60_C4", "vector": [13, 2, 0.2645, 0.0041, 2, 0.61, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ret"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L66_C4", "label": "_data_as_list", "type": "function", "loc": [66, 70], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:ClassDef_L16_C0", "vector": [2, 1, 0.281, 0.0207, 1, 0.81, 1.0, 796, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "_data_as_list", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _data_as_list(self):\n ret = [self.setting_name]\n if self.value:\n ret.extend(self.value)\n return ret"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:Assign_L67_C8", "label": "ret =", "type": "assigned_variable", "loc": [67, 67], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L66_C4", "vector": [14, 2, 0.2769, 0.0041, 2, 0.76, 0.0, 501, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "ret", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ret = [self.setting_name]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:If_L68_C8", "label": "if", "type": "if", "loc": [68, 69], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L66_C4", "vector": [4, 2, 0.2831, 0.0083, 2, 0.76, 0.5, 0, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.value:\n ret.extend(self.value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:Expr_L69_C12", "label": "extend()", "type": "expression", "loc": [69, 69], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:If_L68_C8", "vector": [8, 3, 0.2851, 0.0041, 3, 0.72, 0.0, 660, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "extend", "arg_names": [], "import_names": [], "rhs_call_name": "extend", "annotation": ""}, "snippet": " ret.extend(self.value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:Return_L70_C8", "label": "return", "type": "return", "loc": [70, 70], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L66_C4", "vector": [13, 2, 0.2893, 0.0041, 2, 0.76, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ret"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:ClassDef_L73_C0", "label": "Documentation", "type": "class", "loc": [73, 82], "level": 0, "parent": null, "vector": [3, 0, 0.3202, 0.0413, 0, 0.66, 0.0833, 564, 0, 3, 0, 0, 307, 0, 1], "semantic": {"name": "Documentation", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Documentation(_Setting):\n\n def reset(self):\n self.value = ''\n\n def _populate(self, value):\n self.value = self._concat_string_with_value(self.value, value)\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L75_C4", "label": "reset", "type": "function", "loc": [75, 76], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:ClassDef_L73_C0", "vector": [2, 1, 0.312, 0.0083, 1, 0.89, 0.0, 944, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "reset", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def reset(self):\n self.value = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:Assign_L76_C8", "label": "self.value =", "type": "assigned_variable", "loc": [76, 76], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L75_C4", "vector": [14, 2, 0.314, 0.0041, 2, 0.87, 0.0, 966, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "self.value", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.value = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L78_C4", "label": "_populate", "type": "function", "loc": [78, 79], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:ClassDef_L73_C0", "vector": [2, 1, 0.3244, 0.0083, 1, 0.89, 0.5, 179, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "_populate", "arg_names": ["self", "value"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _populate(self, value):\n self.value = self._concat_string_with_value(self.value, value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:Assign_L79_C8", "label": "self.value = _concat_string_with_value()", "type": "assigned_variable", "loc": [79, 79], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L78_C4", "vector": [14, 2, 0.3264, 0.0041, 2, 0.72, 0.0, 966, 3, 2, 0, 0, 289, 10, 1], "semantic": {"name": "self.value", "arg_names": [], "import_names": [], "rhs_call_name": "_concat_string_with_value", "annotation": ""}, "snippet": " self.value = self._concat_string_with_value(self.value, value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L81_C4", "label": "_data_as_list", "type": "function", "loc": [81, 82], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:ClassDef_L73_C0", "vector": [2, 1, 0.3368, 0.0083, 1, 0.89, 1.0, 796, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "_data_as_list", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _data_as_list(self):\n return [self.setting_name, self.value]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:Return_L82_C8", "label": "return", "type": "return", "loc": [82, 82], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L81_C4", "vector": [13, 2, 0.3388, 0.0041, 2, 0.23, 0.0, 0, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return [self.setting_name, self.value]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:ClassDef_L85_C0", "label": "Template", "type": "class", "loc": [85, 100], "level": 0, "parent": null, "vector": [3, 0, 0.3822, 0.0661, 0, 0.66, 0.1667, 137, 0, 4, 0, 0, 307, 0, 2], "semantic": {"name": "Template", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Template(_Setting):\n\n def reset(self):\n self.value = None\n\n def _populate(self, value):\n self.value = self._concat_string_with_value(self.value, value)\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L87_C4", "label": "reset", "type": "function", "loc": [87, 88], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:ClassDef_L85_C0", "vector": [2, 1, 0.3616, 0.0083, 1, 0.96, 0.0, 944, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "reset", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def reset(self):\n self.value = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:Assign_L88_C8", "label": "self.value =", "type": "assigned_variable", "loc": [88, 88], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L87_C4", "vector": [14, 2, 0.3636, 0.0041, 2, 0.68, 0.0, 966, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.value", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.value = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L90_C4", "label": "_populate", "type": "function", "loc": [90, 91], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:ClassDef_L85_C0", "vector": [2, 1, 0.374, 0.0083, 1, 0.96, 0.3333, 179, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "_populate", "arg_names": ["self", "value"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _populate(self, value):\n self.value = self._concat_string_with_value(self.value, value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:Assign_L91_C8", "label": "self.value = _concat_string_with_value()", "type": "assigned_variable", "loc": [91, 91], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L90_C4", "vector": [14, 2, 0.376, 0.0041, 2, 0.2, 0.0, 966, 3, 2, 0, 0, 289, 10, 1], "semantic": {"name": "self.value", "arg_names": [], "import_names": [], "rhs_call_name": "_concat_string_with_value", "annotation": ""}, "snippet": " self.value = self._concat_string_with_value(self.value, value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L93_C4", "label": "is_set", "type": "function", "loc": [93, 94], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:ClassDef_L85_C0", "vector": [2, 1, 0.3864, 0.0083, 1, 0.96, 0.6667, 896, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "is_set", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def is_set(self):\n return self.value is not None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:Return_L94_C8", "label": "return", "type": "return", "loc": [94, 94], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L93_C4", "vector": [13, 2, 0.3884, 0.0041, 2, 0.73, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.value is not None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L96_C4", "label": "_data_as_list", "type": "function", "loc": [96, 100], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:ClassDef_L85_C0", "vector": [2, 1, 0.405, 0.0207, 1, 0.96, 1.0, 796, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "_data_as_list", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _data_as_list(self):\n ret = [self.setting_name]\n if self.value:\n ret.append(self.value)\n return ret"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:Assign_L97_C8", "label": "ret =", "type": "assigned_variable", "loc": [97, 97], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L96_C4", "vector": [14, 2, 0.4008, 0.0041, 2, 0.74, 0.0, 501, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "ret", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ret = [self.setting_name]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:If_L98_C8", "label": "if", "type": "if", "loc": [98, 99], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L96_C4", "vector": [4, 2, 0.407, 0.0083, 2, 0.74, 0.5, 0, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.value:\n ret.append(self.value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:Expr_L99_C12", "label": "append()", "type": "expression", "loc": [99, 99], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:If_L98_C8", "vector": [8, 3, 0.4091, 0.0041, 3, 0.75, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " ret.append(self.value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:Return_L100_C8", "label": "return", "type": "return", "loc": [100, 100], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L96_C4", "vector": [13, 2, 0.4132, 0.0041, 2, 0.74, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ret"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:ClassDef_L103_C0", "label": "Fixture", "type": "class", "loc": [103, 124], "level": 0, "parent": null, "vector": [3, 0, 0.469, 0.0909, 0, 0.66, 0.25, 488, 0, 4, 0, 0, 307, 0, 3], "semantic": {"name": "Fixture", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Fixture(_Setting):\n\n def reset(self):\n self.name = None\n self.args = []\n\n def _populate(self, value):\n if not self.name:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L105_C4", "label": "reset", "type": "function", "loc": [105, 107], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:ClassDef_L103_C0", "vector": [2, 1, 0.438, 0.0124, 1, 0.24, 0.0, 944, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "reset", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def reset(self):\n self.name = None\n self.args = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:Assign_L106_C8", "label": "self.name =", "type": "assigned_variable", "loc": [106, 106], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L105_C4", "vector": [14, 2, 0.438, 0.0041, 2, 0.3, 0.0, 689, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.name = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:Assign_L107_C8", "label": "self.args =", "type": "assigned_variable", "loc": [107, 107], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L105_C4", "vector": [14, 2, 0.4421, 0.0041, 2, 0.3, 1.0, 640, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.args", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.args = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L109_C4", "label": "_populate", "type": "function", "loc": [109, 113], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:ClassDef_L103_C0", "vector": [2, 1, 0.4587, 0.0207, 1, 0.24, 0.3333, 179, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "_populate", "arg_names": ["self", "value"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _populate(self, value):\n if not self.name:\n self.name = value[0] if value else ''\n value = value[1:]\n self.args.extend(value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:If_L110_C8", "label": "if", "type": "if", "loc": [110, 112], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L109_C4", "vector": [4, 2, 0.4587, 0.0124, 2, 0.85, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not self.name:\n self.name = value[0] if value else ''\n value = value[1:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:Assign_L111_C12", "label": "self.name =", "type": "assigned_variable", "loc": [111, 111], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:If_L110_C8", "vector": [14, 3, 0.4587, 0.0041, 3, 0.34, 0.0, 689, 8, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.name = value[0] if value else ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:Assign_L112_C12", "label": "value =", "type": "assigned_variable", "loc": [112, 112], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:If_L110_C8", "vector": [14, 3, 0.4628, 0.0041, 3, 0.34, 1.0, 441, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "value", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " value = value[1:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:Expr_L113_C8", "label": "extend()", "type": "expression", "loc": [113, 113], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L109_C4", "vector": [8, 2, 0.4669, 0.0041, 2, 0.85, 1.0, 660, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "extend", "arg_names": [], "import_names": [], "rhs_call_name": "extend", "annotation": ""}, "snippet": " self.args.extend(value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L115_C4", "label": "is_set", "type": "function", "loc": [115, 116], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:ClassDef_L103_C0", "vector": [2, 1, 0.4773, 0.0083, 1, 0.24, 0.6667, 896, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "is_set", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def is_set(self):\n return self.name is not None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:Return_L116_C8", "label": "return", "type": "return", "loc": [116, 116], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L115_C4", "vector": [13, 2, 0.4793, 0.0041, 2, 0.25, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.name is not None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L118_C4", "label": "_data_as_list", "type": "function", "loc": [118, 124], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:ClassDef_L103_C0", "vector": [2, 1, 0.5, 0.0289, 1, 0.24, 1.0, 796, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "_data_as_list", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _data_as_list(self):\n ret = [self.setting_name]\n if self.name or self.args:\n ret.append(self.name or '')\n if self.args:\n ret.extend(self.args)\n return ret"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:Assign_L119_C8", "label": "ret =", "type": "assigned_variable", "loc": [119, 119], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L118_C4", "vector": [14, 2, 0.4917, 0.0041, 2, 0.42, 0.0, 501, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "ret", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ret = [self.setting_name]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:If_L120_C8", "label": "if", "type": "if", "loc": [120, 121], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L118_C4", "vector": [4, 2, 0.4979, 0.0083, 2, 0.42, 0.3333, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.name or self.args:\n ret.append(self.name or '')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:Expr_L121_C12", "label": "append()", "type": "expression", "loc": [121, 121], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:If_L120_C8", "vector": [8, 3, 0.5, 0.0041, 3, 0.47, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " ret.append(self.name or '')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:If_L122_C8", "label": "if", "type": "if", "loc": [122, 123], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L118_C4", "vector": [4, 2, 0.5062, 0.0083, 2, 0.42, 0.6667, 0, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.args:\n ret.extend(self.args)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:Expr_L123_C12", "label": "extend()", "type": "expression", "loc": [123, 123], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:If_L122_C8", "vector": [8, 3, 0.5083, 0.0041, 3, 0.26, 0.0, 660, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "extend", "arg_names": [], "import_names": [], "rhs_call_name": "extend", "annotation": ""}, "snippet": " ret.extend(self.args)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:Return_L124_C8", "label": "return", "type": "return", "loc": [124, 124], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L118_C4", "vector": [13, 2, 0.5124, 0.0041, 2, 0.42, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ret"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:ClassDef_L127_C0", "label": "Timeout", "type": "class", "loc": [127, 148], "level": 0, "parent": null, "vector": [3, 0, 0.5682, 0.0909, 0, 0.66, 0.3333, 508, 0, 4, 0, 0, 307, 0, 3], "semantic": {"name": "Timeout", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Timeout(_Setting):\n\n def reset(self):\n self.value = None\n self.message = ''\n\n def _populate(self, value):\n if not self.value:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L129_C4", "label": "reset", "type": "function", "loc": [129, 131], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:ClassDef_L127_C0", "vector": [2, 1, 0.5372, 0.0124, 1, 0.68, 0.0, 944, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "reset", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def reset(self):\n self.value = None\n self.message = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:Assign_L130_C8", "label": "self.value =", "type": "assigned_variable", "loc": [130, 130], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L129_C4", "vector": [14, 2, 0.5372, 0.0041, 2, 0.87, 0.0, 966, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.value", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.value = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:Assign_L131_C8", "label": "self.message =", "type": "assigned_variable", "loc": [131, 131], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L129_C4", "vector": [14, 2, 0.5413, 0.0041, 2, 0.87, 1.0, 709, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "self.message", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.message = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L133_C4", "label": "_populate", "type": "function", "loc": [133, 137], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:ClassDef_L127_C0", "vector": [2, 1, 0.5579, 0.0207, 1, 0.68, 0.3333, 179, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "_populate", "arg_names": ["self", "value"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _populate(self, value):\n if not self.value:\n self.value = value[0] if value else ''\n value = value[1:]\n self.message = self._concat_string_with_value(self.message, value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:If_L134_C8", "label": "if", "type": "if", "loc": [134, 136], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L133_C4", "vector": [4, 2, 0.5579, 0.0124, 2, 0.63, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not self.value:\n self.value = value[0] if value else ''\n value = value[1:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:Assign_L135_C12", "label": "self.value =", "type": "assigned_variable", "loc": [135, 135], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:If_L134_C8", "vector": [14, 3, 0.5579, 0.0041, 3, 0.1, 0.0, 966, 8, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.value", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.value = value[0] if value else ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:Assign_L136_C12", "label": "value =", "type": "assigned_variable", "loc": [136, 136], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:If_L134_C8", "vector": [14, 3, 0.562, 0.0041, 3, 0.1, 1.0, 441, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "value", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " value = value[1:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:Assign_L137_C8", "label": "self.message = _concat_string_with_value()", "type": "assigned_variable", "loc": [137, 137], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L133_C4", "vector": [14, 2, 0.5661, 0.0041, 2, 0.63, 1.0, 709, 3, 2, 0, 0, 289, 10, 1], "semantic": {"name": "self.message", "arg_names": [], "import_names": [], "rhs_call_name": "_concat_string_with_value", "annotation": ""}, "snippet": " self.message = self._concat_string_with_value(self.message, value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L139_C4", "label": "is_set", "type": "function", "loc": [139, 140], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:ClassDef_L127_C0", "vector": [2, 1, 0.5764, 0.0083, 1, 0.68, 0.6667, 896, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "is_set", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def is_set(self):\n return self.value is not None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:Return_L140_C8", "label": "return", "type": "return", "loc": [140, 140], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L139_C4", "vector": [13, 2, 0.5785, 0.0041, 2, 0.24, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.value is not None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L142_C4", "label": "_data_as_list", "type": "function", "loc": [142, 148], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:ClassDef_L127_C0", "vector": [2, 1, 0.5992, 0.0289, 1, 0.68, 1.0, 796, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "_data_as_list", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _data_as_list(self):\n ret = [self.setting_name]\n if self.value or self.message:\n ret.append(self.value or '')\n if self.message:\n ret.append(self.message)\n return ret"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:Assign_L143_C8", "label": "ret =", "type": "assigned_variable", "loc": [143, 143], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L142_C4", "vector": [14, 2, 0.5909, 0.0041, 2, 0.6, 0.0, 501, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "ret", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ret = [self.setting_name]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:If_L144_C8", "label": "if", "type": "if", "loc": [144, 145], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L142_C4", "vector": [4, 2, 0.5971, 0.0083, 2, 0.6, 0.3333, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.value or self.message:\n ret.append(self.value or '')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:Expr_L145_C12", "label": "append()", "type": "expression", "loc": [145, 145], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:If_L144_C8", "vector": [8, 3, 0.5992, 0.0041, 3, 0.51, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " ret.append(self.value or '')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:If_L146_C8", "label": "if", "type": "if", "loc": [146, 147], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L142_C4", "vector": [4, 2, 0.6054, 0.0083, 2, 0.6, 0.6667, 0, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.message:\n ret.append(self.message)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:Expr_L147_C12", "label": "append()", "type": "expression", "loc": [147, 147], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:If_L146_C8", "vector": [8, 3, 0.6074, 0.0041, 3, 0.15, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " ret.append(self.message)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:Return_L148_C8", "label": "return", "type": "return", "loc": [148, 148], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L142_C4", "vector": [13, 2, 0.6116, 0.0041, 2, 0.6, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ret"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:ClassDef_L151_C0", "label": "Tags", "type": "class", "loc": [151, 167], "level": 0, "parent": null, "vector": [3, 0, 0.657, 0.0702, 0, 0.66, 0.4167, 344, 0, 4, 0, 0, 307, 0, 3], "semantic": {"name": "Tags", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Tags(_Setting):\n\n def reset(self):\n self.value = None\n\n def _populate(self, value):\n self.value = (self.value or []) + value\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L153_C4", "label": "reset", "type": "function", "loc": [153, 154], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:ClassDef_L151_C0", "vector": [2, 1, 0.6343, 0.0083, 1, 0.34, 0.0, 944, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "reset", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def reset(self):\n self.value = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:Assign_L154_C8", "label": "self.value =", "type": "assigned_variable", "loc": [154, 154], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L153_C4", "vector": [14, 2, 0.6364, 0.0041, 2, 0.18, 0.0, 966, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.value", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.value = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L156_C4", "label": "_populate", "type": "function", "loc": [156, 157], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:ClassDef_L151_C0", "vector": [2, 1, 0.6467, 0.0083, 1, 0.34, 0.3333, 179, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "_populate", "arg_names": ["self", "value"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _populate(self, value):\n self.value = (self.value or []) + value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:Assign_L157_C8", "label": "self.value =", "type": "assigned_variable", "loc": [157, 157], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L156_C4", "vector": [14, 2, 0.6488, 0.0041, 2, 0.68, 0.0, 966, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.value", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.value = (self.value or []) + value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L159_C4", "label": "is_set", "type": "function", "loc": [159, 160], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:ClassDef_L151_C0", "vector": [2, 1, 0.6591, 0.0083, 1, 0.34, 0.6667, 896, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "is_set", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def is_set(self):\n return self.value is not None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:Return_L160_C8", "label": "return", "type": "return", "loc": [160, 160], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L159_C4", "vector": [13, 2, 0.6612, 0.0041, 2, 0.42, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.value is not None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L162_C4", "label": "__add__", "type": "function", "loc": [162, 167], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:ClassDef_L151_C0", "vector": [2, 1, 0.6798, 0.0248, 1, 0.34, 1.0, 899, 0, 2, 1, 0, 0, 0, 3], "semantic": {"name": "__add__", "arg_names": ["self", "other"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __add__(self, other):\n if not isinstance(other, Tags):\n raise TypeError('Tags can only be added with tags')\n tags = Tags('Tags')\n tags.value = (self.value or []) + (other.value or [])\n return tags"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:If_L163_C8", "label": "if", "type": "if", "loc": [163, 164], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L162_C4", "vector": [4, 2, 0.6756, 0.0083, 2, 0.42, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not isinstance(other, Tags):\n raise TypeError('Tags can only be added with tags')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:Assign_L165_C8", "label": "tags = Tags()", "type": "assigned_variable", "loc": [165, 165], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L162_C4", "vector": [14, 2, 0.6818, 0.0041, 2, 0.42, 0.3333, 487, 3, 1, 0, 0, 344, 10, 1], "semantic": {"name": "tags", "arg_names": [], "import_names": [], "rhs_call_name": "Tags", "annotation": ""}, "snippet": " tags = Tags('Tags')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:Assign_L166_C8", "label": "tags.value =", "type": "assigned_variable", "loc": [166, 166], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L162_C4", "vector": [14, 2, 0.686, 0.0041, 2, 0.42, 0.6667, 713, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "tags.value", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tags.value = (self.value or []) + (other.value or [])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:Return_L167_C8", "label": "return", "type": "return", "loc": [167, 167], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L162_C4", "vector": [13, 2, 0.6901, 0.0041, 2, 0.42, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return tags"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:ClassDef_L170_C0", "label": "Arguments", "type": "class", "loc": [170, 171], "level": 0, "parent": null, "vector": [3, 0, 0.7045, 0.0083, 0, 0.66, 0.5, 446, 0, 0, 0, 0, 307, 0, 0], "semantic": {"name": "Arguments", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Arguments(_Setting):\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:ClassDef_L174_C0", "label": "Return", "type": "class", "loc": [174, 175], "level": 0, "parent": null, "vector": [3, 0, 0.7211, 0.0083, 0, 0.66, 0.5833, 50, 0, 0, 0, 0, 307, 0, 0], "semantic": {"name": "Return", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Return(_Setting):\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:ClassDef_L178_C0", "label": "Metadata", "type": "class", "loc": [178, 191], "level": 0, "parent": null, "vector": [3, 0, 0.7624, 0.0579, 0, 0.66, 0.6667, 215, 0, 3, 0, 0, 307, 0, 1], "semantic": {"name": "Metadata", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Metadata(_Setting):\n\n def __init__(self, setting_name, parent, name, value, comment=None):\n self.setting_name = setting_name\n self.parent = parent\n self.name = name\n self.value = self._string_value(value)\n self.comment = comment"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L180_C4", "label": "__init__", "type": "function", "loc": [180, 185], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:ClassDef_L178_C0", "vector": [2, 1, 0.7541, 0.0248, 1, 0.36, 0.0, 555, 0, 6, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": ["self", "setting_name", "parent", "name", "value", "comment"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, setting_name, parent, name, value, comment=None):\n self.setting_name = setting_name\n self.parent = parent\n self.name = name\n self.value = self._string_value(value)\n self.comment = comment"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:Assign_L181_C8", "label": "self.setting_name =", "type": "assigned_variable", "loc": [181, 181], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L180_C4", "vector": [14, 2, 0.7479, 0.0041, 2, 0.52, 0.0, 647, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.setting_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.setting_name = setting_name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:Assign_L182_C8", "label": "self.parent =", "type": "assigned_variable", "loc": [182, 182], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L180_C4", "vector": [14, 2, 0.7521, 0.0041, 2, 0.52, 0.25, 428, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.parent", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.parent = parent"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:Assign_L183_C8", "label": "self.name =", "type": "assigned_variable", "loc": [183, 183], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L180_C4", "vector": [14, 2, 0.7562, 0.0041, 2, 0.52, 0.5, 689, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.name = name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:Assign_L184_C8", "label": "self.value = _string_value()", "type": "assigned_variable", "loc": [184, 184], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L180_C4", "vector": [14, 2, 0.7603, 0.0041, 2, 0.52, 0.75, 966, 3, 1, 0, 0, 743, 10, 1], "semantic": {"name": "self.value", "arg_names": [], "import_names": [], "rhs_call_name": "_string_value", "annotation": ""}, "snippet": " self.value = self._string_value(value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:Assign_L185_C8", "label": "self.comment =", "type": "assigned_variable", "loc": [185, 185], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L180_C4", "vector": [14, 2, 0.7645, 0.0041, 2, 0.52, 1.0, 450, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.comment", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.comment = comment"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L187_C4", "label": "is_set", "type": "function", "loc": [187, 188], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:ClassDef_L178_C0", "vector": [2, 1, 0.7748, 0.0083, 1, 0.36, 0.5, 896, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "is_set", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def is_set(self):\n return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:Return_L188_C8", "label": "return", "type": "return", "loc": [188, 188], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L187_C4", "vector": [13, 2, 0.7769, 0.0041, 2, 0.46, 0.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L190_C4", "label": "_data_as_list", "type": "function", "loc": [190, 191], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:ClassDef_L178_C0", "vector": [2, 1, 0.7872, 0.0083, 1, 0.36, 1.0, 796, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "_data_as_list", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _data_as_list(self):\n return [self.setting_name, self.name, self.value]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:Return_L191_C8", "label": "return", "type": "return", "loc": [191, 191], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L190_C4", "vector": [13, 2, 0.7893, 0.0041, 2, 0.33, 0.0, 0, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return [self.setting_name, self.name, self.value]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:ClassDef_L194_C0", "label": "_Import", "type": "class", "loc": [194, 211], "level": 0, "parent": null, "vector": [3, 0, 0.8368, 0.0744, 0, 0.66, 0.75, 472, 0, 4, 0, 0, 307, 0, 1], "semantic": {"name": "_Import", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class _Import(_Setting):\n\n def __init__(self, parent, name, args=None, alias=None, comment=None):\n self.parent = parent\n self.name = name\n self.args = args or []\n self.alias = alias\n self.comment = comment"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L196_C4", "label": "__init__", "type": "function", "loc": [196, 201], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:ClassDef_L194_C0", "vector": [2, 1, 0.8202, 0.0248, 1, 0.57, 0.0, 555, 0, 6, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "parent", "name", "args", "alias", "comment"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, parent, name, args=None, alias=None, comment=None):\n self.parent = parent\n self.name = name\n self.args = args or []\n self.alias = alias\n self.comment = comment"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:Assign_L197_C8", "label": "self.parent =", "type": "assigned_variable", "loc": [197, 197], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L196_C4", "vector": [14, 2, 0.814, 0.0041, 2, 0.13, 0.0, 428, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.parent", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.parent = parent"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:Assign_L198_C8", "label": "self.name =", "type": "assigned_variable", "loc": [198, 198], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L196_C4", "vector": [14, 2, 0.8182, 0.0041, 2, 0.13, 0.25, 689, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.name = name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:Assign_L199_C8", "label": "self.args =", "type": "assigned_variable", "loc": [199, 199], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L196_C4", "vector": [14, 2, 0.8223, 0.0041, 2, 0.13, 0.5, 640, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.args", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.args = args or []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:Assign_L200_C8", "label": "self.alias =", "type": "assigned_variable", "loc": [200, 200], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L196_C4", "vector": [14, 2, 0.8264, 0.0041, 2, 0.13, 0.75, 503, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.alias", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.alias = alias"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:Assign_L201_C8", "label": "self.comment =", "type": "assigned_variable", "loc": [201, 201], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L196_C4", "vector": [14, 2, 0.8306, 0.0041, 2, 0.13, 1.0, 450, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.comment", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.comment = comment"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L204_C4", "label": "type", "type": "function", "loc": [204, 205], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:ClassDef_L194_C0", "vector": [2, 1, 0.845, 0.0083, 1, 0.57, 0.3333, 801, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "type", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def type(self):\n return type(self).__name__"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:Return_L205_C8", "label": "return", "type": "return", "loc": [205, 205], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L204_C4", "vector": [13, 2, 0.8471, 0.0041, 2, 0.99, 0.0, 0, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return type(self).__name__"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L207_C4", "label": "is_set", "type": "function", "loc": [207, 208], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:ClassDef_L194_C0", "vector": [2, 1, 0.8574, 0.0083, 1, 0.57, 0.6667, 896, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "is_set", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def is_set(self):\n return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:Return_L208_C8", "label": "return", "type": "return", "loc": [208, 208], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L207_C4", "vector": [13, 2, 0.8595, 0.0041, 2, 0.51, 0.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L210_C4", "label": "_data_as_list", "type": "function", "loc": [210, 211], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:ClassDef_L194_C0", "vector": [2, 1, 0.8698, 0.0083, 1, 0.57, 1.0, 796, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "_data_as_list", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _data_as_list(self):\n return [self.type, self.name] + self.args"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:Return_L211_C8", "label": "return", "type": "return", "loc": [211, 211], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L210_C4", "vector": [13, 2, 0.8719, 0.0041, 2, 0.94, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return [self.type, self.name] + self.args"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:ClassDef_L214_C0", "label": "Library", "type": "class", "loc": [214, 228], "level": 0, "parent": null, "vector": [3, 0, 0.9132, 0.062, 0, 0.66, 0.8333, 77, 0, 3, 0, 0, 472, 0, 4], "semantic": {"name": "Library", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Library(_Import):\n\n def __init__(self, parent, name, args=None, alias=None, comment=None):\n if args and not alias:\n args, alias = self._split_alias(args)\n _Import.__init__(self, parent, name, args, alias, comment)\n\n def _split_alias(self, args):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L216_C4", "label": "__init__", "type": "function", "loc": [216, 219], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:ClassDef_L214_C0", "vector": [2, 1, 0.8988, 0.0165, 1, 0.53, 0.0, 555, 0, 6, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": ["self", "parent", "name", "args", "alias", "comment"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, parent, name, args=None, alias=None, comment=None):\n if args and not alias:\n args, alias = self._split_alias(args)\n _Import.__init__(self, parent, name, args, alias, comment)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:If_L217_C8", "label": "if", "type": "if", "loc": [217, 218], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L216_C4", "vector": [4, 2, 0.8988, 0.0083, 2, 0.36, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if args and not alias:\n args, alias = self._split_alias(args)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:Assign_L218_C12", "label": "args, alias = _split_alias()", "type": "assigned_variable", "loc": [218, 218], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:If_L217_C8", "vector": [14, 3, 0.9008, 0.0041, 3, 0.29, 0.0, 464, 3, 1, 0, 0, 614, 10, 1], "semantic": {"name": "args, alias", "arg_names": [], "import_names": [], "rhs_call_name": "_split_alias", "annotation": ""}, "snippet": " args, alias = self._split_alias(args)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:Expr_L219_C8", "label": "__init__()", "type": "expression", "loc": [219, 219], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L216_C4", "vector": [8, 2, 0.905, 0.0041, 2, 0.36, 1.0, 555, 3, 6, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " _Import.__init__(self, parent, name, args, alias, comment)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L221_C4", "label": "_split_alias", "type": "function", "loc": [221, 224], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:ClassDef_L214_C0", "vector": [2, 1, 0.9194, 0.0165, 1, 0.53, 0.5, 614, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "_split_alias", "arg_names": ["self", "args"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _split_alias(self, args):\n if len(args) >= 2 and args[-2].upper() == 'WITH NAME':\n return args[:-2], args[-1]\n return args, None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:If_L222_C8", "label": "if", "type": "if", "loc": [222, 223], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L221_C4", "vector": [4, 2, 0.9194, 0.0083, 2, 0.46, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(args) >= 2 and args[-2].upper() == 'WITH NAME':\n return args[:-2], args[-1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:Return_L223_C12", "label": "return", "type": "return", "loc": [223, 223], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:If_L222_C8", "vector": [13, 3, 0.9215, 0.0041, 3, 0.44, 0.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return args[:-2], args[-1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:Return_L224_C8", "label": "return", "type": "return", "loc": [224, 224], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L221_C4", "vector": [13, 2, 0.9256, 0.0041, 2, 0.46, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return args, None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L226_C4", "label": "_data_as_list", "type": "function", "loc": [226, 228], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:ClassDef_L214_C0", "vector": [2, 1, 0.938, 0.0124, 1, 0.53, 1.0, 796, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "_data_as_list", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _data_as_list(self):\n alias = ['WITH NAME', self.alias] if self.alias else []\n return ['Library', self.name] + self.args + alias"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:Assign_L227_C8", "label": "alias =", "type": "assigned_variable", "loc": [227, 227], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L226_C4", "vector": [14, 2, 0.938, 0.0041, 2, 0.92, 0.0, 657, 8, 0, 0, 0, 0, 0, 0], "semantic": {"name": "alias", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " alias = ['WITH NAME', self.alias] if self.alias else []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:Return_L228_C8", "label": "return", "type": "return", "loc": [228, 228], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L226_C4", "vector": [13, 2, 0.9421, 0.0041, 2, 0.92, 1.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ['Library', self.name] + self.args + alias"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:ClassDef_L231_C0", "label": "Resource", "type": "class", "loc": [231, 236], "level": 0, "parent": null, "vector": [3, 0, 0.9649, 0.0248, 0, 0.66, 0.9167, 412, 0, 1, 0, 0, 472, 0, 2], "semantic": {"name": "Resource", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Resource(_Import):\n\n def __init__(self, parent, name, invalid_args=None, comment=None):\n if invalid_args:\n name += ' ' + ' '.join(invalid_args)\n _Import.__init__(self, parent, name, comment=comment)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L233_C4", "label": "__init__", "type": "function", "loc": [233, 236], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:ClassDef_L231_C0", "vector": [2, 1, 0.969, 0.0165, 1, 0.01, 0.0, 555, 0, 5, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": ["self", "parent", "name", "invalid_args", "comment"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, parent, name, invalid_args=None, comment=None):\n if invalid_args:\n name += ' ' + ' '.join(invalid_args)\n _Import.__init__(self, parent, name, comment=comment)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:If_L234_C8", "label": "if", "type": "if", "loc": [234, 235], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L233_C4", "vector": [4, 2, 0.969, 0.0083, 2, 0.07, 0.0, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if invalid_args:\n name += ' ' + ' '.join(invalid_args)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:Expr_L236_C8", "label": "__init__()", "type": "expression", "loc": [236, 236], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L233_C4", "vector": [8, 2, 0.9752, 0.0041, 2, 0.07, 1.0, 555, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " _Import.__init__(self, parent, name, comment=comment)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:ClassDef_L239_C0", "label": "Variables", "type": "class", "loc": [239, 242], "level": 0, "parent": null, "vector": [3, 0, 0.9938, 0.0165, 0, 0.66, 1.0, 821, 0, 1, 0, 0, 472, 0, 1], "semantic": {"name": "Variables", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Variables(_Import):\n\n def __init__(self, parent, name, args=None, comment=None):\n _Import.__init__(self, parent, name, args, comment=comment)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L241_C4", "label": "__init__", "type": "function", "loc": [241, 242], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:ClassDef_L239_C0", "vector": [2, 1, 0.9979, 0.0083, 1, 0.61, 0.0, 555, 0, 5, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": ["self", "parent", "name", "args", "comment"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, parent, name, args=None, comment=None):\n _Import.__init__(self, parent, name, args, comment=comment)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99877:Expr_L242_C8", "label": "__init__()", "type": "expression", "loc": [242, 242], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L241_C4", "vector": [8, 2, 1.0, 0.0041, 2, 0.1, 0.0, 555, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " _Import.__init__(self, parent, name, args, comment=comment)"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99877:ClassDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:Assign_L19_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:Assign_L20_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:Assign_L21_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:Expr_L22_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:ClassDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L24_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:Assign_L25_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:ClassDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L28_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:Return_L29_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:ClassDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L32_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L32_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:Return_L33_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:ClassDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L35_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L35_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:Expr_L36_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L35_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:Expr_L37_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L35_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:Assign_L38_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:ClassDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L40_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L40_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:Assign_L41_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:ClassDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L43_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L43_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:Return_L44_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:ClassDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L46_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L46_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:Return_L47_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:ClassDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L49_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L49_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:Expr_L50_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:ClassDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L52_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L52_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:Return_L53_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:ClassDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L55_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L55_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:If_L56_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:If_L56_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:Return_L57_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L55_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:Return_L58_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:ClassDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L60_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L60_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:Assign_L61_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L60_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:If_L62_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:If_L62_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:Expr_L63_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L60_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:Return_L64_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:ClassDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L66_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L66_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:Assign_L67_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L66_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:If_L68_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:If_L68_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:Expr_L69_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L66_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:Return_L70_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:ClassDef_L73_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L75_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L75_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:Assign_L76_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:ClassDef_L73_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L78_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L78_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:Assign_L79_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:ClassDef_L73_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L81_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L81_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:Return_L82_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:ClassDef_L85_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L87_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L87_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:Assign_L88_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:ClassDef_L85_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L90_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L90_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:Assign_L91_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:ClassDef_L85_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L93_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L93_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:Return_L94_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:ClassDef_L85_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L96_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L96_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:Assign_L97_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L96_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:If_L98_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:If_L98_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:Expr_L99_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L96_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:Return_L100_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:ClassDef_L103_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L105_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L105_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:Assign_L106_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L105_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:Assign_L107_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:ClassDef_L103_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L109_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L109_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:If_L110_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:If_L110_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:Assign_L111_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:If_L110_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:Assign_L112_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L109_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:Expr_L113_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:ClassDef_L103_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L115_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L115_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:Return_L116_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:ClassDef_L103_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L118_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L118_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:Assign_L119_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L118_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:If_L120_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:If_L120_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:Expr_L121_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L118_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:If_L122_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:If_L122_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:Expr_L123_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L118_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:Return_L124_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:ClassDef_L127_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L129_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L129_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:Assign_L130_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L129_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:Assign_L131_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:ClassDef_L127_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L133_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L133_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:If_L134_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:If_L134_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:Assign_L135_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:If_L134_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:Assign_L136_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L133_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:Assign_L137_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:ClassDef_L127_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L139_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L139_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:Return_L140_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:ClassDef_L127_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L142_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L142_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:Assign_L143_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L142_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:If_L144_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:If_L144_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:Expr_L145_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L142_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:If_L146_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:If_L146_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:Expr_L147_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L142_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:Return_L148_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:ClassDef_L151_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L153_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L153_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:Assign_L154_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:ClassDef_L151_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L156_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L156_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:Assign_L157_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:ClassDef_L151_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L159_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L159_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:Return_L160_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:ClassDef_L151_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L162_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L162_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:If_L163_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L162_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:Assign_L165_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L162_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:Assign_L166_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L162_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:Return_L167_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:ClassDef_L178_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L180_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L180_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:Assign_L181_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L180_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:Assign_L182_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L180_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:Assign_L183_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L180_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:Assign_L184_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L180_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:Assign_L185_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:ClassDef_L178_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L187_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L187_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:Return_L188_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:ClassDef_L178_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L190_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L190_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:Return_L191_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:ClassDef_L194_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L196_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L196_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:Assign_L197_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L196_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:Assign_L198_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L196_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:Assign_L199_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L196_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:Assign_L200_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L196_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:Assign_L201_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:ClassDef_L194_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L204_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L204_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:Return_L205_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:ClassDef_L194_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L207_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L207_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:Return_L208_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:ClassDef_L194_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L210_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L210_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:Return_L211_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:ClassDef_L214_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L216_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L216_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:If_L217_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:If_L217_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:Assign_L218_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L216_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:Expr_L219_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:ClassDef_L214_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L221_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L221_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:If_L222_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:If_L222_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:Return_L223_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L221_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:Return_L224_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:ClassDef_L214_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L226_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L226_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:Assign_L227_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L226_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:Return_L228_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:ClassDef_L231_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L233_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L233_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:If_L234_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L233_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:Expr_L236_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:ClassDef_L239_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L241_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99877:FunctionDef_L241_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99877:Expr_L242_C8"}] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.